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
797a007a
Commit
797a007a
authored
Mar 19, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
31bda680
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
13 deletions
+42
-13
PanFragment.kt
.../main/java/com/mints/goodmoney/ui/fragment/PanFragment.kt
+42
-13
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/PanFragment.kt
View file @
797a007a
package
com.mints.goodmoney.ui.fragment
import
android.Manifest
import
android.os.Bundle
import
android.text.TextUtils
import
android.webkit.WebChromeClient
...
...
@@ -7,9 +8,11 @@ import com.component.dly.xzzq_ywsdk.YwSDK_WebActivity
import
com.github.lzyzsd.jsbridge.CallBackFunction
import
com.github.lzyzsd.jsbridge.DefaultHandler
import
com.mints.goodmoney.BuildConfig
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.R
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.MokuManager
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.manager.YwhzManager
import
com.mints.goodmoney.mvp.model.PanActionInfo
...
...
@@ -19,7 +22,9 @@ import com.mints.goodmoney.mvp.views.PanView
import
com.mints.goodmoney.ui.activitys.*
import
com.mints.goodmoney.ui.fragment.base.BaseFragment
import
com.mints.library.utils.json.JsonUtil
import
com.tbruyelle.rxpermissions.RxPermissions
import
kotlinx.android.synthetic.main.fragment_main_pan.*
import
net.grandcentrix.tray.AppPreferences
/**
* 描述:大转盘
...
...
@@ -31,6 +36,7 @@ class PanFragment : BaseFragment(), PanView {
private
val
panPresenter
by
lazy
{
PanPresenter
()
}
private
val
userManager
by
lazy
{
UserManager
.
getInstance
()
}
private
val
carrierType
=
Constant
.
CARRIER_CHALLENGE_TURN
private
val
ps
by
lazy
{
AppPreferences
(
context
)
}
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_main_pan
...
...
@@ -39,8 +45,11 @@ class PanFragment : BaseFragment(), PanView {
if
(!
TextUtils
.
isEmpty
(
userManager
.
userID
))
{
// 登录成功的用户初始化鱼丸盒子
if
(
userManager
.
userIsLogin
())
{
YwhzManager
.
init
(
baseApplication
)
// if (userManager.userIsLogin()) {
// YwhzManager.init(baseApplication)
// }
if
(!
TextUtils
.
isEmpty
(
MintsApplication
.
OAID
))
{
MokuManager
.
initOaid
(
MintsApplication
.
OAID
)
}
}
}
...
...
@@ -145,17 +154,18 @@ class PanFragment : BaseFragment(), PanView {
readyGo
(
WrapperActivity
::
class
.
java
,
bundle
)
}
3
->
{
if
(!
userManager
.
userIsLogin
())
{
readyGo
(
WxLoginActivity
::
class
.
java
)
return
}
try
{
activity
?.
let
{
YwSDK_WebActivity
.
open
(
it
)
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
showToast
(
"请重新退出账号登录"
)
}
// if (!userManager.userIsLogin()) {
// readyGo(WxLoginActivity::class.java)
// return
// }
//
// try {
// activity?.let { YwSDK_WebActivity.open(it) }
// } catch (e: Exception) {
// e.printStackTrace()
// showToast("请重新退出账号登录")
// }
gotoMoku
()
}
4
->
{
val
activity
:
MainActivity
?
=
activity
as
MainActivity
?
...
...
@@ -193,4 +203,23 @@ class PanFragment : BaseFragment(), PanView {
bundle
.
putInt
(
Constant
.
WRAPPER_TYPE
,
Constant
.
WRAPPER_TYPE_WZ
)
readyGo
(
WrapperActivity
::
class
.
java
,
bundle
)
}
private
fun
gotoMoku
()
{
RxPermissions
(
requireActivity
())
.
request
(
Manifest
.
permission
.
READ_PHONE_STATE
,
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
.
subscribe
{
granted
:
Boolean
->
if
(
granted
)
{
MokuManager
.
gotoMoku
(
requireContext
())
if
(
ps
.
getBoolean
(
Constant
.
MOKU_FLAG_GUIDE
,
true
))
{
readyGo
(
MokuGuideActivity
::
class
.
java
)
ps
.
put
(
Constant
.
MOKU_FLAG_GUIDE
,
false
)
}
}
else
{
showMissingPermissionDialog
(
"设备,存储"
)
}
}
}
}
\ No newline at end of file
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