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
Hide 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
package
com.mints.goodmoney.ui.fragment
import
android.Manifest
import
android.os.Bundle
import
android.os.Bundle
import
android.text.TextUtils
import
android.text.TextUtils
import
android.webkit.WebChromeClient
import
android.webkit.WebChromeClient
...
@@ -7,9 +8,11 @@ import com.component.dly.xzzq_ywsdk.YwSDK_WebActivity
...
@@ -7,9 +8,11 @@ import com.component.dly.xzzq_ywsdk.YwSDK_WebActivity
import
com.github.lzyzsd.jsbridge.CallBackFunction
import
com.github.lzyzsd.jsbridge.CallBackFunction
import
com.github.lzyzsd.jsbridge.DefaultHandler
import
com.github.lzyzsd.jsbridge.DefaultHandler
import
com.mints.goodmoney.BuildConfig
import
com.mints.goodmoney.BuildConfig
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.R
import
com.mints.goodmoney.R
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.MokuManager
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.manager.YwhzManager
import
com.mints.goodmoney.manager.YwhzManager
import
com.mints.goodmoney.mvp.model.PanActionInfo
import
com.mints.goodmoney.mvp.model.PanActionInfo
...
@@ -19,7 +22,9 @@ import com.mints.goodmoney.mvp.views.PanView
...
@@ -19,7 +22,9 @@ import com.mints.goodmoney.mvp.views.PanView
import
com.mints.goodmoney.ui.activitys.*
import
com.mints.goodmoney.ui.activitys.*
import
com.mints.goodmoney.ui.fragment.base.BaseFragment
import
com.mints.goodmoney.ui.fragment.base.BaseFragment
import
com.mints.library.utils.json.JsonUtil
import
com.mints.library.utils.json.JsonUtil
import
com.tbruyelle.rxpermissions.RxPermissions
import
kotlinx.android.synthetic.main.fragment_main_pan.*
import
kotlinx.android.synthetic.main.fragment_main_pan.*
import
net.grandcentrix.tray.AppPreferences
/**
/**
* 描述:大转盘
* 描述:大转盘
...
@@ -31,6 +36,7 @@ class PanFragment : BaseFragment(), PanView {
...
@@ -31,6 +36,7 @@ class PanFragment : BaseFragment(), PanView {
private
val
panPresenter
by
lazy
{
PanPresenter
()
}
private
val
panPresenter
by
lazy
{
PanPresenter
()
}
private
val
userManager
by
lazy
{
UserManager
.
getInstance
()
}
private
val
userManager
by
lazy
{
UserManager
.
getInstance
()
}
private
val
carrierType
=
Constant
.
CARRIER_CHALLENGE_TURN
private
val
carrierType
=
Constant
.
CARRIER_CHALLENGE_TURN
private
val
ps
by
lazy
{
AppPreferences
(
context
)
}
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_main_pan
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_main_pan
...
@@ -39,8 +45,11 @@ class PanFragment : BaseFragment(), PanView {
...
@@ -39,8 +45,11 @@ class PanFragment : BaseFragment(), PanView {
if
(!
TextUtils
.
isEmpty
(
userManager
.
userID
))
{
if
(!
TextUtils
.
isEmpty
(
userManager
.
userID
))
{
// 登录成功的用户初始化鱼丸盒子
// 登录成功的用户初始化鱼丸盒子
if
(
userManager
.
userIsLogin
())
{
// if (userManager.userIsLogin()) {
YwhzManager
.
init
(
baseApplication
)
// YwhzManager.init(baseApplication)
// }
if
(!
TextUtils
.
isEmpty
(
MintsApplication
.
OAID
))
{
MokuManager
.
initOaid
(
MintsApplication
.
OAID
)
}
}
}
}
}
}
...
@@ -145,17 +154,18 @@ class PanFragment : BaseFragment(), PanView {
...
@@ -145,17 +154,18 @@ class PanFragment : BaseFragment(), PanView {
readyGo
(
WrapperActivity
::
class
.
java
,
bundle
)
readyGo
(
WrapperActivity
::
class
.
java
,
bundle
)
}
}
3
->
{
3
->
{
if
(!
userManager
.
userIsLogin
())
{
// if (!userManager.userIsLogin()) {
readyGo
(
WxLoginActivity
::
class
.
java
)
// readyGo(WxLoginActivity::class.java)
return
// return
}
// }
//
try
{
// try {
activity
?.
let
{
YwSDK_WebActivity
.
open
(
it
)
}
// activity?.let { YwSDK_WebActivity.open(it) }
}
catch
(
e
:
Exception
)
{
// } catch (e: Exception) {
e
.
printStackTrace
()
// e.printStackTrace()
showToast
(
"请重新退出账号登录"
)
// showToast("请重新退出账号登录")
}
// }
gotoMoku
()
}
}
4
->
{
4
->
{
val
activity
:
MainActivity
?
=
activity
as
MainActivity
?
val
activity
:
MainActivity
?
=
activity
as
MainActivity
?
...
@@ -193,4 +203,23 @@ class PanFragment : BaseFragment(), PanView {
...
@@ -193,4 +203,23 @@ class PanFragment : BaseFragment(), PanView {
bundle
.
putInt
(
Constant
.
WRAPPER_TYPE
,
Constant
.
WRAPPER_TYPE_WZ
)
bundle
.
putInt
(
Constant
.
WRAPPER_TYPE
,
Constant
.
WRAPPER_TYPE_WZ
)
readyGo
(
WrapperActivity
::
class
.
java
,
bundle
)
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