Commit 392fad80 authored by jyx's avatar jyx

代码优化

parent 05317956
......@@ -9,6 +9,7 @@ import android.view.ViewGroup
import android.widget.*
import com.bumptech.glide.Glide
import com.bytedance.sdk.openadsdk.*
import com.bytedance.sdk.openadsdk.mediation.ad.MediationAdSlot
import com.bytedance.sdk.openadsdk.mediation.ad.MediationExpressRenderListener
import com.bytedance.sdk.openadsdk.mediation.ad.MediationViewBinder
import com.mints.helivideo.BuildConfig
......@@ -111,12 +112,17 @@ class DrawExpressManager {
UIUtils.getScreenWidth(activity),
UIUtils.getScreenHeight(activity)
)
.setMediationAdSlot(
MediationAdSlot.Builder()
.setMuted(true)
.build()
)
.setAdCount(3)//请求广告数量为1到3条 (优先采用平台配置的数量)
.build()
adNativeLoader.loadDrawFeedAd(adslot, object : TTAdNative.DrawFeedAdListener {
override fun onError(p0: Int, p1: String?) {
LogUtil.e(TAG, "greenroom draw信息流--> 3、load feed ad error : $p0, $p1")
LogUtil.e(TAG, "gromore draw信息流--> 3、load feed ad error : $p0, $p1")
isLoadSuccess = 0
}
......
......@@ -105,7 +105,7 @@ class ExpressManager {
adNativeLoader.loadFeedAd(adslot, object : TTAdNative.FeedAdListener {
override fun onError(p0: Int, p1: String?) {
LogUtil.e(TAG, "greenroom信息流--> 3、load feed ad error : $p0, $p1")
LogUtil.e(TAG, "gromore信息流--> 3、load feed ad error : $p0, $p1")
isLoadSuccess = 0
}
......
......@@ -362,13 +362,16 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
// 继续观看逻辑
private fun showContinueDialog() {
nineShowBean?.let {
NineContinueDialog(requireActivity(), it.need - it.complete, object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v)
dialog?.dismiss()
clickTurn()
}
}).show()
NineContinueDialog(
requireActivity(),
it.need - it.complete - 1,
object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v)
dialog?.dismiss()
clickTurn()
}
}).show()
}
}
//----9宫格逻辑--结束--//
......
......@@ -8,6 +8,7 @@ import android.view.WindowManager
import android.widget.ImageView
import android.widget.TextView
import com.mints.helivideo.R
import com.mints.helivideo.utils.SpanUtils
class NineContinueDialog(
activity: Activity,
......@@ -38,8 +39,12 @@ class NineContinueDialog(
val tv_nine_next = findViewById<TextView>(R.id.tv_nine_next)
val tv_nine_close = findViewById<ImageView>(R.id.tv_nine_close)
tv_nine_text.text = String.format("再看%d次即可抽奖", watchCount)
tv_nine_text.text = SpanUtils()
.append("再看")
.append("$watchCount")
.setForegroundColor(context.resources.getColor(R.color.red))
.append("次即可抽奖")
.create()
listener.setDialog(this)
tv_nine_next.setOnClickListener(listener)
tv_nine_close.setOnClickListener { dismiss() }
......
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