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
7d36ccc6
Commit
7d36ccc6
authored
Mar 29, 2021
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
a134d7e4
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
274 additions
and
249 deletions
+274
-249
build.gradle
app/build.gradle
+4
-4
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+9
-9
MhManager.kt
app/src/main/java/com/wenshu/youyou/manager/MhManager.kt
+21
-21
YwhzManager.kt
app/src/main/java/com/wenshu/youyou/manager/YwhzManager.kt
+48
-49
MobileLoginActivity.kt
...ava/com/wenshu/youyou/ui/activitys/MobileLoginActivity.kt
+5
-5
WxLoginActivity.kt
...in/java/com/wenshu/youyou/ui/activitys/WxLoginActivity.kt
+5
-8
MyFragment.kt
...src/main/java/com/wenshu/youyou/ui/fragment/MyFragment.kt
+172
-142
PanFragment.kt
...rc/main/java/com/wenshu/youyou/ui/fragment/PanFragment.kt
+7
-9
wenshuApplication.java
app/src/main/java/com/wenshu/youyou/wenshuApplication.java
+3
-2
No files found.
app/build.gradle
View file @
7d36ccc6
...
...
@@ -224,10 +224,10 @@ dependencies {
// 数美
implementation
files
(
'libs/smantifraud.aar'
)
// 鱼丸盒子
implementation
(
name:
'xzzq_ywsdk_1.1.0'
,
ext:
'aar'
)
implementation
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.0"
implementation
'com.liulishuo.filedownloader:library:1.7.7'
implementation
"org.greenrobot:eventbus:3.1.0-RC"
//
implementation(name: 'xzzq_ywsdk_1.1.0', ext: 'aar')
//
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.0"
//
implementation 'com.liulishuo.filedownloader:library:1.7.7'
//
implementation "org.greenrobot:eventbus:3.1.0-RC"
// 变现猫
// implementation(name: 'bxmsdk-release-3.3.1', ext: 'aar')
// 闪电盒子
...
...
app/src/main/AndroidManifest.xml
View file @
7d36ccc6
...
...
@@ -299,15 +299,15 @@
</provider>
<!-- 鱼丸盒子广告 -->
<provider
android:name=
"com.component.dly.xzzq_ywsdk.YwFileProvider"
android:authorities=
"${applicationId}.YwFileProvider"
android:exported=
"false"
android:grantUriPermissions=
"true"
>
<meta-data
android:name=
"android.support.FILE_PROVIDER_PATHS"
android:resource=
"@xml/ywsdk_file_paths"
/
>
</provider
>
<!-- <provider-->
<!-- android:name="com.component.dly.xzzq_ywsdk.YwFileProvider"-->
<!-- android:authorities="${applicationId}.YwFileProvider"-->
<!-- android:exported="false"-->
<!-- android:grantUriPermissions="true">--
>
<!-- <meta-data-->
<!-- android:name="android.support.FILE_PROVIDER_PATHS"-->
<!-- android:resource="@xml/ywsdk_file_paths" />--
>
<!-- </provider>--
>
<!-- 穿山甲广告 -->
<provider
...
...
app/src/main/java/com/wenshu/youyou/manager/MhManager.kt
View file @
7d36ccc6
//package com.wenshu.youyou.manager
//
//import android.app.Application
//import com.maplehaze.adsdk.MaplehazeSDK
//
///**
// * 描述:枫岚激励视频
// * 作者:孟崔广
// */
//object MhManager {
//
// const val APP_ID = ""
// const val POS_ID = ""
//
// /**
// * 初始化
// */
// fun initWn(application: Application) {
// MaplehazeSDK.init(application)
// }
//}
\ No newline at end of file
package
com.wenshu.youyou.manager
import
android.app.Application
import
com.maplehaze.adsdk.MaplehazeSDK
/**
* 描述:枫岚激励视频
* 作者:孟崔广
*/
object
MhManager
{
const
val
APP_ID
=
""
const
val
POS_ID
=
""
/**
* 初始化
*/
fun
initWn
(
application
:
Application
)
{
MaplehazeSDK
.
init
(
application
)
}
}
\ No newline at end of file
app/src/main/java/com/wenshu/youyou/manager/YwhzManager.kt
View file @
7d36ccc6
package
com.wenshu.youyou.manager
import
android.app.Application
import
android.os.Build
import
android.text.TextUtils
import
com.component.dly.xzzq_ywsdk.YwSDK.Companion.init
import
com.component.dly.xzzq_ywsdk.YwSDK.Companion.setDebugMode
import
com.wenshu.youyou.BuildConfig
import
com.wenshu.youyou.wenshuApplication
/**
* 描述:鱼丸盒子游戏
* 作者:孟崔广
*/
object
YwhzManager
{
private
const
val
APPID_DEBUG
=
""
private
const
val
APPSECRET_DEBUG
=
""
private
const
val
APPID_RELEASE
=
""
private
const
val
APPSECRET_RELEASE
=
""
fun
init
(
application
:
Application
)
{
val
userManager
=
UserManager
.
getInstance
()
var
userID
=
userManager
.
userID
if
(!
userManager
.
userIsLogin
()
||
TextUtils
.
isEmpty
(
userID
))
{
// 用户id为空 或 未登录 = 游客
userID
=
"0"
}
val
appid
:
String
val
appSecret
:
String
if
(
BuildConfig
.
DEBUG
)
{
appid
=
APPID_DEBUG
appSecret
=
APPSECRET_DEBUG
}
else
{
appid
=
APPID_RELEASE
appSecret
=
APPSECRET_RELEASE
}
var
oaid
:
String
=
""
if
(
Build
.
VERSION
.
SDK_INT
>
28
)
{
if
(!
TextUtils
.
isEmpty
(
wenshuApplication
.
OAID
))
{
oaid
=
wenshuApplication
.
OAID
}
}
setDebugMode
()
init
(
application
,
appSecret
,
appid
,
userID
,
"1"
,
oaid
)
}
}
\ No newline at end of file
//package com.wenshu.youyou.manager
//
//import android.app.Application
//import android.os.Build
//import android.text.TextUtils
//import com.component.dly.xzzq_ywsdk.YwSDK.Companion.setDebugMode
//import com.wenshu.youyou.BuildConfig
//import com.wenshu.youyou.wenshuApplication
//
///**
// * 描述:鱼丸盒子游戏
// * 作者:孟崔广
// */
//object YwhzManager {
//
// private const val APPID_DEBUG = ""
// private const val APPSECRET_DEBUG = ""
//
// private const val APPID_RELEASE = ""
// private const val APPSECRET_RELEASE = ""
//
// fun init(application: Application) {
// val userManager = UserManager.getInstance()
// var userID = userManager.userID
// if (!userManager.userIsLogin() || TextUtils.isEmpty(userID)) {
// // 用户id为空 或 未登录 = 游客
// userID = "0"
// }
//
// val appid: String
// val appSecret: String
// if (BuildConfig.DEBUG) {
// appid = APPID_DEBUG
// appSecret = APPSECRET_DEBUG
// } else {
// appid = APPID_RELEASE
// appSecret = APPSECRET_RELEASE
// }
// var oaid: String = ""
// if (Build.VERSION.SDK_INT > 28) {
// if (!TextUtils.isEmpty(wenshuApplication.OAID)) {
// oaid = wenshuApplication.OAID
// }
// }
// setDebugMode()
// init(application, appSecret, appid, userID, "1", oaid)
// }
//}
\ No newline at end of file
app/src/main/java/com/wenshu/youyou/ui/activitys/MobileLoginActivity.kt
View file @
7d36ccc6
...
...
@@ -90,11 +90,11 @@ class MobileLoginActivity : BaseActivity(), LoginView, View.OnClickListener {
}
override
fun
loginSuc
()
{
try
{
// 登录成功初始化鱼玩盒子userid
YwhzManager
.
init
(
baseApplication
)
}
catch
(
e
:
Exception
)
{
}
//
try {
//
// 登录成功初始化鱼玩盒子userid
//
YwhzManager.init(baseApplication)
//
} catch (e: Exception) {
//
}
// 每日任务是否刷新任务数
TrackManager
.
getInstance
().
innerApp
()
...
...
app/src/main/java/com/wenshu/youyou/ui/activitys/WxLoginActivity.kt
View file @
7d36ccc6
...
...
@@ -15,9 +15,7 @@ import com.wenshu.youyou.common.Constant
import
com.wenshu.youyou.login.LoginApi
import
com.wenshu.youyou.login.OnLoginListener
import
com.wenshu.youyou.manager.RsNewsManager
//import com.wenshu.youyou.manager.SceneManager
import
com.wenshu.youyou.manager.TrackManager
import
com.wenshu.youyou.manager.YwhzManager
import
com.wenshu.youyou.mvp.model.WXInfo
import
com.wenshu.youyou.mvp.presenters.LoginPresenter
import
com.wenshu.youyou.mvp.views.LoginView
...
...
@@ -116,16 +114,15 @@ class WxLoginActivity : BaseActivity()
}
override
fun
loginSuc
()
{
try
{
// 登录成功初始化鱼玩盒子userid
YwhzManager
.
init
(
baseApplication
)
}
catch
(
e
:
Exception
)
{
}
//
try {
//
// 登录成功初始化鱼玩盒子userid
//
YwhzManager.init(baseApplication)
//
} catch (e: Exception) {
//
}
// 每日任务是否刷新任务数
TrackManager
.
getInstance
().
innerApp
()
// SceneManager.signIn(this)
RsNewsManager
.
init
(
baseApplication
)
showToast
(
"登录成功"
)
...
...
app/src/main/java/com/wenshu/youyou/ui/fragment/MyFragment.kt
View file @
7d36ccc6
package
com.wenshu.youyou.ui.fragment
import
android.Manifest
import
android.annotation.SuppressLint
import
android.content.*
import
android.os.Bundle
...
...
@@ -13,7 +12,6 @@ import android.widget.GridView
import
androidx.core.content.ContextCompat
import
androidx.recyclerview.widget.DividerItemDecoration
import
androidx.viewpager.widget.ViewPager
import
com.component.dly.xzzq_ywsdk.YwSDK_WebActivity.Companion.open
import
com.wenshu.youyou.BuildConfig
import
com.wenshu.youyou.R
import
com.wenshu.youyou.ad.banner.BannerManager
...
...
@@ -48,7 +46,6 @@ import com.wenshu.library.utils.nodoubleclick.AntiShake
import
com.rd.animation.type.AnimationType
import
com.scwang.smartrefresh.layout.api.RefreshLayout
import
com.scwang.smartrefresh.layout.listener.OnRefreshListener
import
com.tbruyelle.rxpermissions.RxPermissions
import
kotlinx.android.synthetic.main.fragment_main_my.*
import
kotlinx.android.synthetic.main.header_layout.*
import
kotlinx.android.synthetic.main.item_fragment_main_my_clock.*
...
...
@@ -70,11 +67,11 @@ private val TAG = MyFragment::class.java.simpleName
*/
@SuppressLint
(
"SetTextI18n"
)
class
MyFragment
:
BaseFragment
(),
MyView
,
OnItemChildClickListener
,
OnRefreshListener
,
View
.
OnClickListener
,
AdapterView
.
OnItemClickListener
{
MyView
,
OnItemChildClickListener
,
OnRefreshListener
,
View
.
OnClickListener
,
AdapterView
.
OnItemClickListener
{
private
val
ps
by
lazy
{
AppPreferences
(
context
)
}
private
val
myPresenter
by
lazy
{
MyPresenter
()
}
...
...
@@ -238,8 +235,10 @@ class MyFragment : BaseFragment(),
val
pagerList
=
arrayListOf
<
View
>()
for
(
i
in
0
until
pageCount
)
{
val
gridView
=
inflater
.
inflate
(
R
.
layout
.
item_fragment_main_my_promotions_gv
,
vp_grid
,
false
)
as
GridView
val
gridView
=
inflater
.
inflate
(
R
.
layout
.
item_fragment_main_my_promotions_gv
,
vp_grid
,
false
)
as
GridView
gridView
.
adapter
=
GvMyAdapter
(
requireActivity
(),
data
,
i
,
HOT_PAGE_SIZE
)
pagerList
.
add
(
gridView
)
...
...
@@ -424,10 +423,12 @@ class MyFragment : BaseFragment(),
nowDate
}
item_clock_signday
.
text
=
SpanUtils
()
.
append
(
" 已连续签到"
).
setForegroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
color_172B54
))
.
append
(
" $alwaysSignDay "
).
setForegroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
color_F18542
))
.
append
(
"天"
).
setForegroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
color_172B54
))
.
create
()
.
append
(
" 已连续签到"
)
.
setForegroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
color_172B54
))
.
append
(
" $alwaysSignDay "
)
.
setForegroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
color_F18542
))
.
append
(
"天"
).
setForegroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
color_172B54
))
.
create
()
val
finalSignStatus
=
signStatus
item_clock_signview
.
setSignViewListener
{
day
->
if
(
nowDate
==
day
)
{
...
...
@@ -443,11 +444,20 @@ class MyFragment : BaseFragment(),
if
(
userManager
.
userIsLogin
())
{
// 已登录
if
(
userManager
.
wxOpenid
.
isNotEmpty
())
{
GlideUtils
.
loadImageViewLoding
(
context
,
userManager
.
wxHeader
,
item_title_avatar
,
R
.
mipmap
.
ic_my
,
R
.
mipmap
.
ic_my
)
GlideUtils
.
loadImageViewLoding
(
context
,
userManager
.
wxHeader
,
item_title_avatar
,
R
.
mipmap
.
ic_my
,
R
.
mipmap
.
ic_my
)
if
(
userManager
.
wxName
.
isEmpty
())
{
var
mobile
=
userManager
.
mobile
if
(
mobile
.
isNotEmpty
())
{
mobile
=
mobile
.
substring
(
0
,
3
)
+
"****"
+
mobile
.
substring
(
mobile
.
length
-
4
,
mobile
.
length
)
mobile
=
mobile
.
substring
(
0
,
3
)
+
"****"
+
mobile
.
substring
(
mobile
.
length
-
4
,
mobile
.
length
)
}
item_title_id
.
text
=
"手机:$mobile"
}
else
{
...
...
@@ -456,7 +466,10 @@ class MyFragment : BaseFragment(),
}
else
{
var
mobile
=
userManager
.
mobile
if
(
mobile
.
isNotEmpty
())
{
mobile
=
mobile
.
substring
(
0
,
3
)
+
"****"
+
mobile
.
substring
(
mobile
.
length
-
4
,
mobile
.
length
)
mobile
=
mobile
.
substring
(
0
,
3
)
+
"****"
+
mobile
.
substring
(
mobile
.
length
-
4
,
mobile
.
length
)
}
item_title_id
.
text
=
"手机:$mobile"
item_title_avatar
.
setImageResource
(
R
.
mipmap
.
ic_my
)
...
...
@@ -482,7 +495,8 @@ class MyFragment : BaseFragment(),
val
allcoinBig
=
BigDecimal
(
userConfig
!!
.
userMsg
.
coin
.
toString
())
val
rateBig
=
BigDecimal
(
"10000"
)
val
cashStr
:
String
=
allcoinBig
.
divide
(
rateBig
).
setScale
(
2
,
BigDecimal
.
ROUND_DOWN
).
toString
()
val
cashStr
:
String
=
allcoinBig
.
divide
(
rateBig
).
setScale
(
2
,
BigDecimal
.
ROUND_DOWN
).
toString
()
item_title_gold_about
.
text
=
"约"
+
cashStr
+
"元"
userGold
=
CommonUtils
.
formatString
(
userConfig
!!
.
userMsg
.
coin
.
toString
())
...
...
@@ -553,7 +567,10 @@ class MyFragment : BaseFragment(),
1
->
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
taskBean
.
otherConfig
.
coin
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_HIGH_ACTIVITY
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_HIGH_ACTIVITY
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
AppConfig
.
isHighTask
=
false
...
...
@@ -568,7 +585,10 @@ class MyFragment : BaseFragment(),
// if (TextUtils.isEmpty(mCurrentPkg)) {
if
(
mCurrentPkg
==
null
)
{
showToast
(
"任务异常,请重试~"
)
myPresenter
.
setHighTaskType
(
Constant
.
CARRIER_HIGH_ACTIVITY
,
"0"
)
myPresenter
.
setHighTaskType
(
Constant
.
CARRIER_HIGH_ACTIVITY
,
"0"
)
AppConfig
.
isHighTask
=
false
}
else
{
...
...
@@ -578,7 +598,10 @@ class MyFragment : BaseFragment(),
AppConfig
.
isHighTask
=
true
}
else
{
showToast
(
"未找到当前APP、可能被卸载,请重试~"
)
myPresenter
.
setHighTaskType
(
Constant
.
CARRIER_HIGH_ACTIVITY
,
"0"
)
myPresenter
.
setHighTaskType
(
Constant
.
CARRIER_HIGH_ACTIVITY
,
"0"
)
AppConfig
.
isHighTask
=
false
}
...
...
@@ -602,7 +625,10 @@ class MyFragment : BaseFragment(),
1
->
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
taskBean
.
otherConfig
.
coin
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_SHARE_NEWS
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_SHARE_NEWS
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
}
}
...
...
@@ -621,7 +647,10 @@ class MyFragment : BaseFragment(),
1
->
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
taskBean
.
otherConfig
.
coin
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_HOMEVEDIO_CHALLENGE
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_HOMEVEDIO_CHALLENGE
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
}
}
...
...
@@ -638,7 +667,10 @@ class MyFragment : BaseFragment(),
1
->
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
taskBean
.
otherConfig
.
coin
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_MINIVEDIO_CHALLENGE
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_MINIVEDIO_CHALLENGE
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
}
}
...
...
@@ -665,8 +697,14 @@ class MyFragment : BaseFragment(),
1
->
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
taskBean
.
otherConfig
.
coin
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CHALLENGE_SHAREFRIEND
)
bundle
.
putString
(
Constant
.
MAIN_EXTRA_ID
,
taskBean
.
otherConfig
.
doubleCoin
.
toString
())
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CHALLENGE_SHAREFRIEND
)
bundle
.
putString
(
Constant
.
MAIN_EXTRA_ID
,
taskBean
.
otherConfig
.
doubleCoin
.
toString
()
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
}
}
...
...
@@ -697,7 +735,10 @@ class MyFragment : BaseFragment(),
1
->
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
taskBean
.
otherConfig
.
coin
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_RUISHINEWS_CHALLANGE
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_RUISHINEWS_CHALLANGE
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
}
}
...
...
@@ -712,19 +753,19 @@ class MyFragment : BaseFragment(),
}
}
// 试玩平台
MainMyAdapter
.
TO_YWHZ
->
{
if
(!
userManager
.
userIsLogin
())
{
readyGo
(
WxLoginActivity
::
class
.
java
)
return
}
try
{
activity
?.
let
{
open
(
it
)
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
showToast
(
"请重新退出账号登录"
)
}
}
//
MainMyAdapter.TO_YWHZ -> {
//
if (!userManager.userIsLogin()) {
//
readyGo(WxLoginActivity::class.java)
//
return
//
}
//
//
try {
//
activity?.let { open(it) }
//
} catch (e: Exception) {
//
e.printStackTrace()
//
showToast("请重新退出账号登录")
//
}
//
}
MainMyAdapter
.
TO_DHGAME
->
{
if
(!
UserManager
.
getInstance
().
userIsLogin
())
{
readyGo
(
WxLoginActivity
::
class
.
java
)
...
...
@@ -746,7 +787,10 @@ class MyFragment : BaseFragment(),
1
->
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
taskBean
.
otherConfig
.
coin
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_XMLY_CHALLENGE
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_XMLY_CHALLENGE
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
}
}
...
...
@@ -760,15 +804,25 @@ class MyFragment : BaseFragment(),
pkgMCRSCarrier
=
Constant
.
CARRIER_FIRSTDOWNLOADS
pkgMCRSKey
=
taskBean
.
otherConfig
.
key
pkgMCRSName
=
taskBean
.
otherConfig
.
pkg
DownloadApkManager
.
downloadApk
(
requireActivity
(),
taskBean
.
otherConfig
.
downloadUrl
,
pkgMCRSName
)
DownloadApkManager
.
downloadApk
(
requireActivity
(),
taskBean
.
otherConfig
.
downloadUrl
,
pkgMCRSName
)
// 开启广播监听安装事件
registerBroad
()
}
1
->
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
taskBean
.
otherConfig
.
coin
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_FIRSTDOWNLOADS
)
bundle
.
putString
(
Constant
.
MAIN_EXTRA_ID
,
taskBean
.
otherConfig
.
key
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_FIRSTDOWNLOADS
)
bundle
.
putString
(
Constant
.
MAIN_EXTRA_ID
,
taskBean
.
otherConfig
.
key
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
onDestroyBroadcastReceiver
()
...
...
@@ -786,7 +840,11 @@ class MyFragment : BaseFragment(),
pkgMCRSName
=
taskBean
.
otherConfig
.
pkg
// 下载牧场人生
DownloadApkManager
.
downloadApk
(
requireActivity
(),
taskBean
.
otherConfig
.
downloadUrl
,
pkgMCRSName
)
DownloadApkManager
.
downloadApk
(
requireActivity
(),
taskBean
.
otherConfig
.
downloadUrl
,
pkgMCRSName
)
// 开启广播监听安装事件
registerBroad
()
...
...
@@ -795,7 +853,10 @@ class MyFragment : BaseFragment(),
// 牧场人生APP,直接弹奖励框
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
taskBean
.
otherConfig
.
coin
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_MC_FIRSTDOWNLOAD
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_MC_FIRSTDOWNLOAD
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
onDestroyBroadcastReceiver
()
...
...
@@ -876,18 +937,21 @@ class MyFragment : BaseFragment(),
// 自有界面
when
(
hotBean
.
toUrl
)
{
Constant
.
HOT_ACTIVITY_WATER
->
{
TTPreLoadCarrierExpressManager
.
getInstance
().
loadTtFrameLayout
(
TtCsjAdManager
.
TT_AD_NATIVEEXPRESS_WATER
)
TTPreLoadCarrierExpressManager
.
getInstance
()
.
loadTtFrameLayout
(
TtCsjAdManager
.
TT_AD_NATIVEEXPRESS_WATER
)
readyGo
(
WaterActivity
::
class
.
java
)
}
Constant
.
HOT_ACTIVITY_WALK
->
{
TTPreLoadCarrierExpressManager
.
getInstance
().
loadTtFrameLayout
(
TtCsjAdManager
.
TT_AD_NATIVEEXPRESS_WALK
)
TTPreLoadCarrierExpressManager
.
getInstance
()
.
loadTtFrameLayout
(
TtCsjAdManager
.
TT_AD_NATIVEEXPRESS_WALK
)
readyGo
(
WalkActivity
::
class
.
java
)
}
Constant
.
HOT_ACTIVITY_CARD
->
{
readyGo
(
EraseActivity
::
class
.
java
)
}
Constant
.
HOT_ACTIVITY_MORNINGCLOCK
->
{
TTPreLoadCarrierExpressManager
.
getInstance
().
loadTtFrameLayout
(
TtCsjAdManager
.
TT_AD_NATIVEEXPRESS_MORNINGCLOCK
)
TTPreLoadCarrierExpressManager
.
getInstance
()
.
loadTtFrameLayout
(
TtCsjAdManager
.
TT_AD_NATIVEEXPRESS_MORNINGCLOCK
)
readyGo
(
MorningClockActivity
::
class
.
java
)
}
Constant
.
HOT_ACTIVITY_BXM
->
{
...
...
@@ -897,60 +961,6 @@ class MyFragment : BaseFragment(),
return
}
}
Constant
.
HOT_ACTIVITY_CAICY
->
{
RxPermissions
(
requireActivity
())
.
request
(
Manifest
.
permission
.
READ_PHONE_STATE
)
.
subscribe
{
granted
:
Boolean
->
if
(
granted
)
{
// if (AppConfig.scene_flag) {
// 猜成语
// SceneUtil.cCy(requireActivity())
// } else {
// SceneManager.signIn(requireActivity())
// }
}
else
{
showMissingPermissionDialog
(
"设备"
)
}
}
}
Constant
.
HOT_ACTIVITY_DATI
->
{
RxPermissions
(
requireActivity
())
.
request
(
Manifest
.
permission
.
READ_PHONE_STATE
)
.
subscribe
{
granted
:
Boolean
->
if
(
granted
)
{
// if (AppConfig.scene_flag) {
// // 答题
// SceneUtil.daTi(requireActivity())
// } else {
// SceneManager.signIn(requireActivity())
// }
}
else
{
showMissingPermissionDialog
(
"设备"
)
}
}
}
Constant
.
HOT_ACTIVITY_SCRAPPAGE
->
{
RxPermissions
(
requireActivity
())
.
request
(
Manifest
.
permission
.
READ_PHONE_STATE
)
.
subscribe
{
granted
:
Boolean
->
if
(
granted
)
{
// if (AppConfig.scene_flag) {
// 刮刮乐
// SceneUtil.scrapPage(requireActivity())
// } else {
// SceneManager.signIn(requireActivity())
// }
}
else
{
showMissingPermissionDialog
(
"设备"
)
}
}
}
Constant
.
HOT_ACTIVITY_BOOK
->
{
// 小说
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
WRAPPER_TYPE
,
Constant
.
WRAPPER_TYPE_BOOK
)
readyGo
(
WrapperActivity
::
class
.
java
,
bundle
)
}
Constant
.
HOT_ACTIVITY_NEWS
->
{
// 新闻
val
bundle
=
Bundle
()
...
...
@@ -958,7 +968,8 @@ class MyFragment : BaseFragment(),
readyGo
(
WrapperActivity
::
class
.
java
,
bundle
)
}
Constant
.
HOT_ACTIVITY_EAT
->
{
TTPreLoadCarrierExpressManager
.
getInstance
().
loadTtFrameLayout
(
TtCsjAdManager
.
TT_AD_NATIVEEXPRESS_EAT
)
TTPreLoadCarrierExpressManager
.
getInstance
()
.
loadTtFrameLayout
(
TtCsjAdManager
.
TT_AD_NATIVEEXPRESS_EAT
)
readyGo
(
FoodSubsidyActivity
::
class
.
java
)
}
Constant
.
HOT_ACTIVITY_SHARE_NEWS
->
{
...
...
@@ -1034,7 +1045,11 @@ class MyFragment : BaseFragment(),
/**
* 加载激励视频
*/
private
fun
loadVideo
(
videoAdingManager
:
VideoAdingManager
,
bean
:
VideoAdingBean
,
isFirstLoad
:
Boolean
)
{
private
fun
loadVideo
(
videoAdingManager
:
VideoAdingManager
,
bean
:
VideoAdingBean
,
isFirstLoad
:
Boolean
)
{
videoAdingManager
.
setVideoAdingListener
(
object
:
VideoAdingManager
.
VideoAdingListener
{
override
fun
videoAdingListenerError
(
adType
:
String
)
{
showToast
(
"加载超时,请休息一下"
)
...
...
@@ -1090,7 +1105,10 @@ class MyFragment : BaseFragment(),
if
(
autoListBean
.
baseConfig
.
taskId
==
MainMyAdapter
.
APP_VEDIO
)
{
if
(
autoListBean
.
otherConfig
!=
null
)
{
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
autoListBean
.
otherConfig
.
coin
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_VERSUS_VIDEO
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_VERSUS_VIDEO
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
return
}
...
...
@@ -1104,16 +1122,13 @@ class MyFragment : BaseFragment(),
BannerManager
.
init
()
vedioAdingManager
=
VideoAdingManager
.
getInstance
(
activity
)
if
(!
TextUtils
.
isEmpty
(
userManager
.
userID
))
{
// 登录成功的用户初始化鱼丸盒子
if
(
userManager
.
userIsLogin
())
{
YwhzManager
.
init
(
baseApplication
)
}
}
//
if (!TextUtils.isEmpty(userManager.userID)) {
//
// 登录成功的用户初始化鱼丸盒子
//
if (userManager.userIsLogin()) {
//
YwhzManager.init(baseApplication)
//
}
//
}
// 聚乐云初始化
// SceneManager.initScene()
// SceneManager.signIn(requireActivity())
}
private
fun
initView
()
{
...
...
@@ -1137,7 +1152,11 @@ class MyFragment : BaseFragment(),
override
fun
onPageScrollStateChanged
(
state
:
Int
)
{
}
override
fun
onPageScrolled
(
position
:
Int
,
positionOffset
:
Float
,
positionOffsetPixels
:
Int
)
{
override
fun
onPageScrolled
(
position
:
Int
,
positionOffset
:
Float
,
positionOffsetPixels
:
Int
)
{
}
override
fun
onPageSelected
(
position
:
Int
)
{
...
...
@@ -1164,20 +1183,24 @@ class MyFragment : BaseFragment(),
* 设置视频权重
*/
private
fun
initAdWeight
(
data
:
UserTaskMsgBean
)
{
vedioAdingManager
.
initAdWeight
(
data
.
vedioRules
.
csJ_VEDIO
.
rate
,
data
.
vedioRules
.
ylH_VEDIO
.
rate
,
data
.
vedioRules
.
sdhZ_VEDIO
.
rate
,
data
.
vedioRules
.
fL_VEDIO
.
rate
,
data
.
vedioRules
.
corAl_VIDEO
.
rate
,
data
.
vedioRules
.
csjfulL_VEDIO
.
rate
,
data
.
vedioRules
.
kS_VEDIO
.
rate
)
LogUtil
.
d
(
TAG
,
"首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} "
+
"ylhWeight:${data.vedioRules.ylH_VEDIO.rate} "
+
"sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} "
+
"csjFullWeight:${data.vedioRules.csjfulL_VEDIO.rate} "
+
"shWeight:${data.vedioRules.corAl_VIDEO.rate} "
+
"ksWeight:${data.vedioRules.kS_VEDIO.rate} "
+
"flWeight:${data.vedioRules.fL_VEDIO.rate}"
)
vedioAdingManager
.
initAdWeight
(
data
.
vedioRules
.
csJ_VEDIO
.
rate
,
data
.
vedioRules
.
ylH_VEDIO
.
rate
,
data
.
vedioRules
.
sdhZ_VEDIO
.
rate
,
data
.
vedioRules
.
fL_VEDIO
.
rate
,
data
.
vedioRules
.
corAl_VIDEO
.
rate
,
data
.
vedioRules
.
csjfulL_VEDIO
.
rate
,
data
.
vedioRules
.
kS_VEDIO
.
rate
)
LogUtil
.
d
(
TAG
,
"首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} "
+
"ylhWeight:${data.vedioRules.ylH_VEDIO.rate} "
+
"sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} "
+
"csjFullWeight:${data.vedioRules.csjfulL_VEDIO.rate} "
+
"shWeight:${data.vedioRules.corAl_VIDEO.rate} "
+
"ksWeight:${data.vedioRules.kS_VEDIO.rate} "
+
"flWeight:${data.vedioRules.fL_VEDIO.rate}"
)
// 广告视频数
AppConfig
.
csjVideoAdCount
=
data
.
vedioRules
.
csJ_VEDIO
.
surplus
AppConfig
.
ylhAdCount
=
data
.
vedioRules
.
ylH_VEDIO
.
surplus
...
...
@@ -1185,13 +1208,15 @@ class MyFragment : BaseFragment(),
AppConfig
.
flVideoAdCount
=
data
.
vedioRules
.
fL_VEDIO
.
surplus
AppConfig
.
shVideoAdCount
=
data
.
vedioRules
.
corAl_VIDEO
.
surplus
AppConfig
.
csjFullVedioAdCount
=
data
.
vedioRules
.
csjfulL_VEDIO
.
surplus
LogUtil
.
d
(
TAG
,
"首页视频数:csjCount:${AppConfig.csjVideoAdCount} "
+
"ylhCount:${AppConfig.ylhAdCount} "
+
"sdhzCount:${AppConfig.wnVideoAdCount} "
+
"csjFullCount:${AppConfig.csjFullVedioAdCount} "
+
"shCount:${AppConfig.shVideoAdCount} "
+
"ksCount:${AppConfig.ksVideoAdCount} "
+
"flCount:${AppConfig.flVideoAdCount}"
)
LogUtil
.
d
(
TAG
,
"首页视频数:csjCount:${AppConfig.csjVideoAdCount} "
+
"ylhCount:${AppConfig.ylhAdCount} "
+
"sdhzCount:${AppConfig.wnVideoAdCount} "
+
"csjFullCount:${AppConfig.csjFullVedioAdCount} "
+
"shCount:${AppConfig.shVideoAdCount} "
+
"ksCount:${AppConfig.ksVideoAdCount} "
+
"flCount:${AppConfig.flVideoAdCount}"
)
}
private
fun
initExpress
(
flowAdRules
:
FlowAdRulesBean
)
{
...
...
@@ -1270,7 +1295,10 @@ class MyFragment : BaseFragment(),
if
(
userManager
.
wxName
.
isEmpty
())
{
var
mobile
=
userManager
.
mobile
if
(
mobile
.
isNotEmpty
())
{
mobile
=
mobile
.
substring
(
0
,
3
)
+
"****"
+
mobile
.
substring
(
mobile
.
length
-
4
,
mobile
.
length
)
mobile
=
mobile
.
substring
(
0
,
3
)
+
"****"
+
mobile
.
substring
(
mobile
.
length
-
4
,
mobile
.
length
)
}
title
=
"Hi,我是$mobile"
}
else
{
...
...
@@ -1337,12 +1365,14 @@ class MyFragment : BaseFragment(),
}
})
val
ssb
=
SpanUtils
()
.
append
(
"1.点击开始任务,观看广告时,点击广告中的下载APP区域\r\n"
+
.
append
(
"1.点击开始任务,观看广告时,点击广告中的下载APP区域\r\n"
+
"2.等待APP下载完成后,安装该APP\r\n"
+
"3.通过尤友APP打开该APP并试玩至少30秒"
+
"\n\n"
)
.
append
(
"说明:有些可能不是下载APP类型的广告,请关闭广告后重试"
).
setFontSize
(
BubbleUtils
.
dp2px
(
12
))
.
create
()
"\n\n"
)
.
append
(
"说明:有些可能不是下载APP类型的广告,请关闭广告后重试"
).
setFontSize
(
BubbleUtils
.
dp2px
(
12
))
.
create
()
cdaa
?.
let
{
it
.
setTitle
(
"任务步骤"
)
it
.
setContent
(
ssb
)
...
...
app/src/main/java/com/wenshu/youyou/ui/fragment/PanFragment.kt
View file @
7d36ccc6
...
...
@@ -3,7 +3,6 @@ package com.wenshu.youyou.ui.fragment
import
android.os.Bundle
import
android.text.TextUtils
import
android.webkit.WebChromeClient
import
com.component.dly.xzzq_ywsdk.YwSDK_WebActivity
import
com.github.lzyzsd.jsbridge.CallBackFunction
import
com.github.lzyzsd.jsbridge.DefaultHandler
import
com.wenshu.youyou.BuildConfig
...
...
@@ -11,7 +10,6 @@ import com.wenshu.youyou.R
import
com.wenshu.youyou.common.AppConfig
import
com.wenshu.youyou.common.Constant
import
com.wenshu.youyou.manager.UserManager
import
com.wenshu.youyou.manager.YwhzManager
import
com.wenshu.youyou.mvp.model.PanActionInfo
import
com.wenshu.youyou.mvp.model.TurntableBean
import
com.wenshu.youyou.mvp.presenters.PanPresenter
...
...
@@ -37,12 +35,12 @@ class PanFragment : BaseFragment(), PanView {
override
fun
initViewsAndEvents
()
{
panPresenter
.
attachView
(
this
)
if
(!
TextUtils
.
isEmpty
(
userManager
.
userID
))
{
// 登录成功的用户初始化鱼丸盒子
if
(
userManager
.
userIsLogin
())
{
YwhzManager
.
init
(
baseApplication
)
}
}
//
if (!TextUtils.isEmpty(userManager.userID)) {
//
// 登录成功的用户初始化鱼丸盒子
//
if (userManager.userIsLogin()) {
//
YwhzManager.init(baseApplication)
//
}
//
}
}
override
fun
onHiddenChanged
(
hidden
:
Boolean
)
{
...
...
@@ -151,7 +149,7 @@ class PanFragment : BaseFragment(), PanView {
}
try
{
activity
?.
let
{
YwSDK_WebActivity
.
open
(
it
)
}
//
activity?.let { YwSDK_WebActivity.open(it) }
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
showToast
(
"请重新退出账号登录"
)
...
...
app/src/main/java/com/wenshu/youyou/wenshuApplication.java
View file @
7d36ccc6
...
...
@@ -13,6 +13,7 @@ import androidx.multidex.MultiDexApplication;
import
com.hjq.toast.ToastUtils
;
import
com.wenshu.youyou.common.Constant
;
import
com.wenshu.youyou.manager.KsManager
;
import
com.wenshu.youyou.manager.MhManager
;
import
com.wenshu.youyou.manager.MiitHelper
;
import
com.wenshu.youyou.manager.TtCsjAdManager
;
import
com.wenshu.youyou.manager.TzManager
;
...
...
@@ -125,10 +126,10 @@ public class wenshuApplication extends MultiDexApplication {
// MhManager.INSTANCE.initWn(this);
// 天卓珊瑚
TzManager
.
INSTANCE
.
initTz
(
this
);
//
TzManager.INSTANCE.initTz(this);
// 一览视频
YlVideoManager
.
INSTANCE
.
init
(
this
);
//
YlVideoManager.INSTANCE.init(this);
// 瑞狮新闻
// RsNewsManager.INSTANCE.initX5Environment(this);
...
...
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