Commit 3198ee14 authored by jyx's avatar jyx

代码优化

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