Commit 47a250d4 authored by jyx's avatar jyx

代码优化

parent 286dddb1
......@@ -92,49 +92,56 @@ class TxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity, BaseViewH
}
vedioBean?.let {
holder.getView<TextView>(R.id.tv_title).text = String.format(
"解锁%s·第%d-%d集",
it.title,
it.unlockIndex + 1,
it.unlockIndex + it.adGiveVedioNum
)
holder.getView<TextView>(R.id.tv_info).text = String.format(
"看激励视频解锁%d集剧情\n请按照顺序解锁",
it.adGiveVedioNum
)
if (it.isRecommendVedio) {
holder.getView<TextView>(R.id.tv_title).text =
String.format("解锁%s·全集", it.title)
holder.getView<TextView>(R.id.tv_info).text = String.format("0.01元解锁全部短剧")
} else {
holder.getView<TextView>(R.id.tv_title).text = String.format(
"解锁%s·第%d-%d集",
it.title,
it.unlockIndex + 1,
it.unlockIndex + it.adGiveVedioNum
)
holder.getView<TextView>(R.id.tv_info).text = String.format(
"看激励视频解锁%d集剧情\n请按照顺序解锁",
it.adGiveVedioNum
)
}
holder.getView<TextView>(R.id.unlock).text = String.format("查看激励视频")
holder.getView<View>(R.id.unlock).setOnClickListener { it2 ->
mOnCustomChildClickListener?.onCustomChildClick(it2, holder.adapterPosition)
}
}
ExpressManager.instance.getAdView(object : ExpressAdCallback {
override fun loadSuccess(adView: FrameLayout?) {
adView?.let {
UIUtils.removeFromParent(it)
val fmAd = holder.getView<FrameLayout>(R.id.fl_ad)
fmAd.removeAllViews()
fmAd.addView(it)
ExpressManager.instance.getAdView(
object : ExpressAdCallback {
override fun loadSuccess(adView: FrameLayout?) {
adView?.let {
UIUtils.removeFromParent(it)
val fmAd = holder.getView<FrameLayout>(R.id.fl_ad)
fmAd.removeAllViews()
fmAd.addView(it)
}
ExpressManager.instance.preLoadAd()
}
ExpressManager.instance.preLoadAd()
}
override fun renderSuccess(adView: FrameLayout?): Boolean {
adView?.let {
UIUtils.removeFromParent(it)
val fmAd = holder.getView<FrameLayout>(R.id.fl_ad)
fmAd.removeAllViews()
fmAd.addView(it)
}
override fun renderSuccess(adView: FrameLayout?): Boolean {
adView?.let {
UIUtils.removeFromParent(it)
val fmAd = holder.getView<FrameLayout>(R.id.fl_ad)
fmAd.removeAllViews()
fmAd.addView(it)
ExpressManager.instance.preLoadAd()
return false
}
ExpressManager.instance.preLoadAd()
return false
}
override fun loadFail() {
}
})
override fun loadFail() {
}
})
}
private fun initVideoHolder(holder: BaseViewHolder, item: IndexList.VedioEpisodeBean?) {
......
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