Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_youyou
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_youyou
Commits
6c51f049
Commit
6c51f049
authored
Mar 24, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
59fb3492
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
4 deletions
+61
-4
MainActivity.kt
.../main/java/com/wenshu/youyou/ui/activitys/MainActivity.kt
+57
-0
MyFragment.kt
...src/main/java/com/wenshu/youyou/ui/fragment/MyFragment.kt
+4
-4
No files found.
app/src/main/java/com/wenshu/youyou/ui/activitys/MainActivity.kt
View file @
6c51f049
...
...
@@ -3,20 +3,28 @@ package com.wenshu.youyou.ui.activitys
import
android.content.Context
import
android.media.AudioManager
import
android.os.Bundle
import
android.text.TextUtils
import
android.view.KeyEvent
import
android.view.View
import
androidx.fragment.app.Fragment
import
androidx.fragment.app.FragmentManager
import
androidx.fragment.app.FragmentTransaction
import
com.wenshu.library.utils.CommonUtils
import
com.wenshu.youyou.MintsApplication
import
com.wenshu.youyou.R
import
com.wenshu.youyou.ad.video.VideoAdingManager
import
com.wenshu.youyou.common.AppConfig
import
com.wenshu.youyou.common.Constant
import
com.wenshu.youyou.ad.express.TTPreLoadCarrierExpressManager
import
com.wenshu.youyou.manager.ShumeiManager
import
com.wenshu.youyou.manager.WnManager
import
com.wenshu.youyou.mvp.views.MainView
import
com.wenshu.youyou.ui.activitys.base.BaseActivity
import
com.wenshu.youyou.ui.fragment.*
import
com.wenshu.youyou.ui.widgets.DialogListener
import
com.wenshu.youyou.ui.widgets.PowerDialog
import
kotlinx.android.synthetic.main.activity_main.*
import
net.grandcentrix.tray.AppPreferences
/**
* 描述:main
...
...
@@ -26,6 +34,9 @@ import kotlinx.android.synthetic.main.activity_main.*
*/
class
MainActivity
:
BaseActivity
(),
MainView
,
View
.
OnClickListener
{
private
var
powerDialog
:
PowerDialog
?
=
null
private
val
ps
by
lazy
{
AppPreferences
(
context
)
}
private
val
audioManager
by
lazy
{
getSystemService
(
Context
.
AUDIO_SERVICE
)
as
AudioManager
}
// 底部标签切换的Fragment
...
...
@@ -81,6 +92,52 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
tab_rl_two
.
setOnClickListener
(
this
)
tab_rl_four
.
setOnClickListener
(
this
)
tab_rl_five
.
setOnClickListener
(
this
)
// 首次显示权限弹窗
showPowerDialog
()
}
private
fun
showPowerDialog
()
{
if
(
ps
.
getBoolean
(
Constant
.
LOAN_PERMISSION_FLAG
,
true
))
{
powerDialog
()
}
}
private
fun
powerDialog
()
{
powerDialog
=
PowerDialog
(
this
,
object
:
DialogListener
()
{
override
fun
onClick
(
v
:
View
)
{
when
(
v
.
id
)
{
R
.
id
.
tv_dialogper_agreement
->
{
val
bundle
=
Bundle
()
bundle
.
putString
(
WebActivity
.
WEB_TITLE
,
getString
(
R
.
string
.
register_name
))
bundle
.
putString
(
WebActivity
.
WEB_URL
,
Constant
.
REGISTER_URL
)
readyGo
(
WebActivity
::
class
.
java
,
bundle
)
}
R
.
id
.
tv_dialogper_policy
->
{
val
bundle
=
Bundle
()
bundle
.
putString
(
WebActivity
.
WEB_TITLE
,
getString
(
R
.
string
.
privacy_name
))
bundle
.
putString
(
WebActivity
.
WEB_URL
,
Constant
.
PRIVACY_URL
)
readyGo
(
WebActivity
::
class
.
java
,
bundle
)
}
R
.
id
.
btn_dialogper_back
->
{
if
(!
isFinishing
&&
powerDialog
!=
null
&&
powerDialog
!!
.
isShowing
)
{
showToast
(
"请您同意授权,否则将无法使用APP功能"
)
}
}
R
.
id
.
btn_dialogper_next
->
{
if
(!
isFinishing
&&
powerDialog
!=
null
&&
powerDialog
!!
.
isShowing
)
{
powerDialog
!!
.
dismiss
()
ps
.
put
(
Constant
.
LOAN_PERMISSION_FLAG
,
false
)
}
}
}
}
})
powerDialog
!!
.
show
()
}
override
fun
isApplyKitKatTranslucency
()
=
false
...
...
app/src/main/java/com/wenshu/youyou/ui/fragment/MyFragment.kt
View file @
6c51f049
...
...
@@ -287,10 +287,10 @@ class MyFragment : BaseFragment(),
}
override
fun
signInHomePageSuc
()
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
curSignCoin
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_SIGNIN_HOMEPAGE_AWARD
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
//
val bundle = Bundle()
//
bundle.putInt(Constant.MAIN_CUR_COIN, curSignCoin)
//
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_SIGNIN_HOMEPAGE_AWARD)
//
readyGo(AwardActivity::class.java, bundle)
}
override
fun
userLoginSuc
()
{
...
...
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