Commit 4637c22f authored by jyx's avatar jyx

逻辑优化

parent 78ff32eb
...@@ -439,17 +439,18 @@ class DrawNativeVideoActivity : BaseActivity(), ...@@ -439,17 +439,18 @@ class DrawNativeVideoActivity : BaseActivity(),
} }
override fun onRenderSuccess(p0: View?, p1: Float, p2: Float) { override fun onRenderSuccess(p0: View?, p1: Float, p2: Float) {
var index = drawDatas.size / AD_INSERT_INDEX + mAdPage * AD_INSERT_INDEX // 数据源每次刷新添加3个视频加1个广告 则需+1
var index = drawDatas.size / (AD_INSERT_INDEX + 1) + mAdPage * AD_INSERT_INDEX
if (index == 0) { if (index == 0) {
index++ index++
} }
drawDatas.add(index, DrawVideoBean(TYPE_AD_ITEM, ad, "", "", "")) drawDatas.add(index, DrawVideoBean(TYPE_AD_ITEM, ad, "", "", ""))
mAdPage++
// 列表只展示当前数据 // 列表只展示当前数据
mDrawVideoAdapter?.notifyItemInserted(mCurrentPlayIndex + 1) mDrawVideoAdapter?.notifyItemInserted(mCurrentPlayIndex + 1)
mAdPage++
} }
}) })
......
...@@ -652,7 +652,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -652,7 +652,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
mRedBoxTimer?.setOnCountDownTimerListener(object : OnCountDownTimerListener { mRedBoxTimer?.setOnCountDownTimerListener(object : OnCountDownTimerListener {
override fun onTick(millisUntilFinished: Long) { override fun onTick(millisUntilFinished: Long) {
if (isAdded && !requireActivity().isFinishing) { if (isAdded && !requireActivity().isFinishing) {
stopRedbox() // stopRedbox()
tv_fragment_main_redbox.text = TimeRender.ms2MS(millisUntilFinished.toInt()) tv_fragment_main_redbox.text = TimeRender.ms2MS(millisUntilFinished.toInt())
} }
} }
......
...@@ -762,8 +762,7 @@ class MyFragment : BaseFragment(), ...@@ -762,8 +762,7 @@ class MyFragment : BaseFragment(),
} }
R.id.iv_right_icon2 -> { R.id.iv_right_icon2 -> {
// 跳转QQ客服 // 跳转QQ客服
// jumpQQGroup() jumpQQGroup()
readyGo(DrawNativeVideoActivity::class.java)
} }
R.id.item_customer_service -> { R.id.item_customer_service -> {
// 跳转加入QQ群 // 跳转加入QQ群
......
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