Commit b891f0ab authored by mengcuiguang's avatar mengcuiguang

代码优化

parent c4b7dd6a
...@@ -356,8 +356,6 @@ dependencies { ...@@ -356,8 +356,6 @@ dependencies {
implementation(name: 'mduisdk_v3.1.0.18_support_msa_1.0.23', ext: 'aar') implementation(name: 'mduisdk_v3.1.0.18_support_msa_1.0.23', ext: 'aar')
implementation 'com.tencent.tbs.tbssdk:sdk:43903' implementation 'com.tencent.tbs.tbssdk:sdk:43903'
//动态图依赖
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.15'
// //芒果联盟 // //芒果联盟
// implementation 'com.openppeace.mgmob:mgmob:1.3.5-alpha6'//MGMob // implementation 'com.openppeace.mgmob:mgmob:1.3.5-alpha6'//MGMob
......
...@@ -14,22 +14,10 @@ object YyzManager { ...@@ -14,22 +14,10 @@ object YyzManager {
private const val KEY = "37e179d05b23b0a" private const val KEY = "37e179d05b23b0a"
private const val APPID = "550" private const val APPID = "550"
fun initYyz(appActivity: Application) { fun initYyz() {
val context = MintsApplication.getContext()
//当用户登陆了且权限具备了后执行初始化操作 //当用户登陆了且权限具备了后执行初始化操作
AdManager.getInstance(appActivity).init(appActivity, APPID, UserManager.getInstance().userID, KEY, object : CommonCallBack<Any?> { AdManager.getInstance(context).init(context, APPID, UserManager.getInstance().userID, KEY, object : CommonCallBack<Any?> {
override fun onSuccess(response: String) { //初始化成功
Log.e("hyw", "init onSuccess:$response")
}
override fun onFailure(response: String) { //初始化失败
Log.e("hyw", "init onFailure:$response")
}
})
}
fun initYyz(appActivity: FragmentActivity) {
//当用户登陆了且权限具备了后执行初始化操作
AdManager.getInstance(appActivity).init(appActivity, APPID, UserManager.getInstance().userID, KEY, object : CommonCallBack<Any?> {
override fun onSuccess(response: String) { //初始化成功 override fun onSuccess(response: String) { //初始化成功
Log.e("hyw", "init onSuccess:$response") Log.e("hyw", "init onSuccess:$response")
} }
......
...@@ -94,7 +94,7 @@ class MobileLoginActivity : BaseActivity(), LoginView, View.OnClickListener { ...@@ -94,7 +94,7 @@ class MobileLoginActivity : BaseActivity(), LoginView, View.OnClickListener {
try { try {
// 登录成功初始化鱼玩盒子userid // 登录成功初始化鱼玩盒子userid
YwhzManager.init(baseApplication) YwhzManager.init(baseApplication)
YyzManager.initYyz(baseApplication) YyzManager.initYyz()
} catch (e: Exception) { } catch (e: Exception) {
} }
......
...@@ -118,7 +118,7 @@ class WxLoginActivity : BaseActivity() ...@@ -118,7 +118,7 @@ class WxLoginActivity : BaseActivity()
try { try {
// 登录成功初始化鱼玩盒子userid // 登录成功初始化鱼玩盒子userid
YwhzManager.init(baseApplication) YwhzManager.init(baseApplication)
YyzManager.initYyz(baseApplication) YyzManager.initYyz()
} catch (e: Exception) { } catch (e: Exception) {
} }
......
...@@ -1014,7 +1014,6 @@ class MyFragment : BaseFragment(), ...@@ -1014,7 +1014,6 @@ class MyFragment : BaseFragment(),
readyGo(WxLoginActivity::class.java) readyGo(WxLoginActivity::class.java)
return return
} }
YyzManager.initYyz(requireActivity())
YyzManager.openYyzTask(requireActivity()) YyzManager.openYyzTask(requireActivity())
} }
Constant.HOT_ACTIVITY_CAICY -> { Constant.HOT_ACTIVITY_CAICY -> {
...@@ -1237,6 +1236,8 @@ class MyFragment : BaseFragment(), ...@@ -1237,6 +1236,8 @@ class MyFragment : BaseFragment(),
// 登录成功的用户初始化鱼丸盒子 // 登录成功的用户初始化鱼丸盒子
if (userManager.userIsLogin()) { if (userManager.userIsLogin()) {
YwhzManager.init(baseApplication) YwhzManager.init(baseApplication)
YyzManager.initYyz()
} }
} }
......
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