Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_goodmoney
Commits
4013873d
Commit
4013873d
authored
Jan 27, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
7883e3a1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
20 deletions
+25
-20
Constant.kt
.../app/src/main/java/com/mints/goodmoney/common/Constant.kt
+3
-1
WrapperActivity.kt
.../java/com/mints/goodmoney/ui/activitys/WrapperActivity.kt
+16
-18
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+5
-0
fragment_main_kyl.xml
GoodMoney/app/src/main/res/layout/fragment_main_kyl.xml
+1
-1
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/common/Constant.kt
View file @
4013873d
...
...
@@ -187,6 +187,7 @@ object Constant {
const
val
HOT_ACTIVITY_DHGAME
=
"dhGame"
const
val
HOT_ACTIVITY_SHARE_NEWS
=
"TO_SHARE_NEWS"
const
val
HOT_ACTIVITY_CPD
=
"TO_CPD"
const
val
HOT_ACTIVITY_CALLSHOW
=
"TO_CALLSHOW"
// 打开激活
const
val
FIRST_DEVICE_FLAG
=
"first_device_flag"
...
...
@@ -213,11 +214,12 @@ object Constant {
const
val
MERGE_KEY
=
"merge_key"
// wrapper type 0-新闻 1-小说 2-平台分红
// wrapper type 0-新闻 1-小说 2-平台分红
3-来电秀
const
val
WRAPPER_TYPE
=
"wrapper_type"
const
val
WRAPPER_TYPE_NEWS
=
0
const
val
WRAPPER_TYPE_BOOK
=
1
const
val
WRAPPER_TYPE_FRIENDS
=
2
const
val
WRAPPER_TYPE_KYL
=
3
//1登录,2提现,3任务
const
val
RISK_EVENT_ID_LOGIN
=
1
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/WrapperActivity.kt
View file @
4013873d
...
...
@@ -2,10 +2,12 @@ package com.mints.goodmoney.ui.activitys
import
android.os.Bundle
import
android.view.View
import
androidx.fragment.app.Fragment
import
com.mints.goodmoney.R
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.ui.activitys.base.BaseActivity
import
com.mints.goodmoney.ui.fragment.FriendsFragment
import
com.mints.goodmoney.ui.fragment.KuYinYueFragment
import
com.mints.goodmoney.ui.fragment.MyZhangyueFragment
import
com.mints.goodmoney.ui.fragment.RsNewsFragment
import
kotlinx.android.synthetic.main.header_layout.*
...
...
@@ -45,34 +47,30 @@ class WrapperActivity : BaseActivity(), View.OnClickListener {
}
private
fun
initPage
()
{
var
currentFragment
:
Fragment
?
=
null
when
(
wrapperType
)
{
Constant
.
WRAPPER_TYPE_NEWS
->
{
tv_title
.
text
=
"新闻"
val
rsNewsFragment
=
RsNewsFragment
()
if
(!
rsNewsFragment
.
isAdded
)
{
// 提交事务
supportFragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
flWrapper
,
rsNewsFragment
).
commitAllowingStateLoss
()
}
currentFragment
=
RsNewsFragment
()
}
Constant
.
WRAPPER_TYPE_BOOK
->
{
tv_title
.
text
=
"书城"
val
zhangyueFragment
=
MyZhangyueFragment
()
if
(!
zhangyueFragment
.
isAdded
)
{
// 提交事务
supportFragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
flWrapper
,
zhangyueFragment
).
commit
()
}
currentFragment
=
MyZhangyueFragment
()
}
Constant
.
WRAPPER_TYPE_FRIENDS
->
{
tv_title
.
text
=
"瓜分百万现金福利"
val
friendsFragment
=
FriendsFragment
()
if
(!
friendsFragment
.
isAdded
)
{
// 提交事务
supportFragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
flWrapper
,
friendsFragment
).
commit
()
}
currentFragment
=
FriendsFragment
()
}
Constant
.
WRAPPER_TYPE_KYL
->
{
tv_title
.
text
=
"来电秀"
currentFragment
=
KuYinYueFragment
()
}
}
if
(!
currentFragment
!!
.
isAdded
)
{
// 提交事务
supportFragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
flWrapper
,
currentFragment
!!
).
commitAllowingStateLoss
()
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
4013873d
...
...
@@ -910,6 +910,11 @@ class MyFragment : BaseFragment(),
}
}
}
Constant
.
HOT_ACTIVITY_CALLSHOW
->
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
WRAPPER_TYPE
,
Constant
.
WRAPPER_TYPE_KYL
)
readyGo
(
WrapperActivity
::
class
.
java
,
bundle
)
}
else
->
{
if
(!
TextUtils
.
isEmpty
(
hotBean
.
url
)
&&
!
TextUtils
.
isEmpty
(
hotBean
.
title
))
{
val
bundle
=
Bundle
()
...
...
GoodMoney/app/src/main/res/layout/fragment_main_kyl.xml
View file @
4013873d
...
...
@@ -7,7 +7,7 @@
<com.androidkun.xtablayout.XTabLayout
android:id=
"@+id/xtFragmentKyl"
android:paddingTop=
"
22
dp"
android:paddingTop=
"
14
dp"
android:visibility=
"invisible"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment