Commit 7d36ccc6 authored by jyx's avatar jyx

代码优化

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