Commit 3198ee14 authored by jyx's avatar jyx

代码优化

parent 56c62360
...@@ -175,7 +175,6 @@ class AppOutScreenGroMoreCarrierExpressManager : TTSettingConfigCallback { ...@@ -175,7 +175,6 @@ class AppOutScreenGroMoreCarrierExpressManager : TTSettingConfigCallback {
TrackManager.getInstance().cmtGroMoreInfo(vo) TrackManager.getInstance().cmtGroMoreInfo(vo)
} }
} }
}) })
} }
...@@ -194,16 +193,15 @@ class AppOutScreenGroMoreCarrierExpressManager : TTSettingConfigCallback { ...@@ -194,16 +193,15 @@ class AppOutScreenGroMoreCarrierExpressManager : TTSettingConfigCallback {
} else { } else {
// 状态重置 // 状态重置
isLoadSuccess = 0 isLoadSuccess = 0
loadAd() callback.loadingFail()
Handler(Looper.getMainLooper()).postDelayed({ loadADFrameLayout()
getAdView(callback)
}, 1000)
} }
} }
fun resetLoadStatus() { fun resetLoadStatus() {
// 状态重置 // 状态重置
isLoadSuccess = 0 isLoadSuccess = 0
loadADFrameLayout()
} }
/** /**
......
...@@ -193,16 +193,15 @@ class AppOutSimpleGroMoreCarrierExpressManager : TTSettingConfigCallback { ...@@ -193,16 +193,15 @@ class AppOutSimpleGroMoreCarrierExpressManager : TTSettingConfigCallback {
} else { } else {
// 状态重置 // 状态重置
isLoadSuccess = 0 isLoadSuccess = 0
loadAd() callback.loadingFail()
Handler(Looper.getMainLooper()).postDelayed({ loadADFrameLayout()
getAdView(callback)
}, 1000)
} }
} }
fun resetLoadStatus() { fun resetLoadStatus() {
// 状态重置 // 状态重置
isLoadSuccess = 0 isLoadSuccess = 0
loadADFrameLayout()
} }
/** /**
......
...@@ -10,5 +10,5 @@ import android.widget.FrameLayout ...@@ -10,5 +10,5 @@ import android.widget.FrameLayout
*/ */
interface ExpressAdCallback { interface ExpressAdCallback {
fun loadSuccess(adView: FrameLayout?) fun loadSuccess(adView: FrameLayout?)
// fun loadingFail() fun loadingFail()
} }
\ No newline at end of file
...@@ -14,6 +14,8 @@ import androidx.fragment.app.FragmentManager ...@@ -14,6 +14,8 @@ import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentTransaction import androidx.fragment.app.FragmentTransaction
import com.mints.flowbox.MintsApplication import com.mints.flowbox.MintsApplication
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.ad.AppOutScreenGroMoreCarrierExpressManager
import com.mints.flowbox.ad.AppOutSimpleGroMoreCarrierExpressManager
import com.mints.flowbox.ad.express.ExpressManager import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.ad.express.PreLoadExpressManager import com.mints.flowbox.ad.express.PreLoadExpressManager
import com.mints.flowbox.ad.express.TTPreLoadCarrierExpressManager import com.mints.flowbox.ad.express.TTPreLoadCarrierExpressManager
...@@ -122,6 +124,9 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -122,6 +124,9 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
} else { } else {
tab_rl_two.visibility = View.VISIBLE tab_rl_two.visibility = View.VISIBLE
tab_rl_four.visibility = View.VISIBLE tab_rl_four.visibility = View.VISIBLE
AppOutScreenGroMoreCarrierExpressManager.instance.loadADFrameLayout()
AppOutSimpleGroMoreCarrierExpressManager.instance.loadADFrameLayout()
} }
} }
......
...@@ -8,7 +8,6 @@ import androidx.core.content.ContextCompat ...@@ -8,7 +8,6 @@ import androidx.core.content.ContextCompat
import com.daimajia.androidanimations.library.Techniques import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo import com.daimajia.androidanimations.library.YoYo
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.ad.AppOutScreenGroMoreCarrierExpressManager
import com.mints.flowbox.ad.AppOutSimpleGroMoreCarrierExpressManager import com.mints.flowbox.ad.AppOutSimpleGroMoreCarrierExpressManager
import com.mints.flowbox.ad.ExpressAdCallback import com.mints.flowbox.ad.ExpressAdCallback
import com.mints.flowbox.ad.express.ExpressManager import com.mints.flowbox.ad.express.ExpressManager
...@@ -23,7 +22,6 @@ import kotlinx.android.synthetic.main.activity_apk.btnClean ...@@ -23,7 +22,6 @@ import kotlinx.android.synthetic.main.activity_apk.btnClean
import kotlinx.android.synthetic.main.activity_apk.fl_ad import kotlinx.android.synthetic.main.activity_apk.fl_ad
import kotlinx.android.synthetic.main.activity_apk.iv_close import kotlinx.android.synthetic.main.activity_apk.iv_close
import kotlinx.android.synthetic.main.activity_apk.tvInfo import kotlinx.android.synthetic.main.activity_apk.tvInfo
import kotlinx.android.synthetic.main.activity_screen.*
import kotlin.random.Random import kotlin.random.Random
/** /**
...@@ -121,7 +119,7 @@ class ApkActivity : BaseActivity() { ...@@ -121,7 +119,7 @@ class ApkActivity : BaseActivity() {
*/ */
private fun initExpress() { private fun initExpress() {
try { try {
AppOutScreenGroMoreCarrierExpressManager.instance.getAdView(object : ExpressAdCallback { AppOutSimpleGroMoreCarrierExpressManager.instance.getAdView(object : ExpressAdCallback {
override fun loadSuccess(adView: FrameLayout?) { override fun loadSuccess(adView: FrameLayout?) {
fl_ad.removeAllViews() fl_ad.removeAllViews()
fl_ad.addView(adView, ExpressManager.lp) fl_ad.addView(adView, ExpressManager.lp)
......
...@@ -104,7 +104,9 @@ class ScreenActivity : OutAppActivity(), View.OnClickListener { ...@@ -104,7 +104,9 @@ class ScreenActivity : OutAppActivity(), View.OnClickListener {
fl_ad.addView(adView, ExpressManager.lp) fl_ad.addView(adView, ExpressManager.lp)
} }
override fun loadingFail() {} override fun loadingFail() {
AppOutScreenGroMoreCarrierExpressManager.instance.loadADFrameLayout()
}
}) })
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
......
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