bug修改 - 每刷3个视频不是会弹出激励广告嘛,激励广告弹出来如果点击关闭按钮,也需要加上插屏
This commit is contained in:
parent
eb581c16ae
commit
c7f430d58c
|
|
@ -12,6 +12,8 @@ class WatchAdDialog(context: Activity, private val mWatchAdType: Int, private va
|
||||||
private val mTaskDataJson: String? = "")
|
private val mTaskDataJson: String? = "")
|
||||||
: BindingDialog<DialogWatchVideoBinding>(context, DialogWatchVideoBinding::inflate) {
|
: BindingDialog<DialogWatchVideoBinding>(context, DialogWatchVideoBinding::inflate) {
|
||||||
|
|
||||||
|
private var mOnClosed: (() -> Unit)? = null
|
||||||
|
|
||||||
init {
|
init {
|
||||||
build()
|
build()
|
||||||
}
|
}
|
||||||
|
|
@ -27,6 +29,7 @@ class WatchAdDialog(context: Activity, private val mWatchAdType: Int, private va
|
||||||
setOnClickBatch(flAction, ivClose) {
|
setOnClickBatch(flAction, ivClose) {
|
||||||
when (this) {
|
when (this) {
|
||||||
ivClose -> {
|
ivClose -> {
|
||||||
|
mOnClosed?.invoke()
|
||||||
dismiss()
|
dismiss()
|
||||||
}
|
}
|
||||||
flAction -> {
|
flAction -> {
|
||||||
|
|
@ -51,6 +54,9 @@ class WatchAdDialog(context: Activity, private val mWatchAdType: Int, private va
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun setOnCloseListener(onClose: ()->Unit) {
|
||||||
|
mOnClosed = onClose
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ import com.ama.core.common.util.asSafe
|
||||||
import com.ama.core.common.widget.PopMenuIconView
|
import com.ama.core.common.widget.PopMenuIconView
|
||||||
import com.gamedog.vididin.VidiConst
|
import com.gamedog.vididin.VidiConst
|
||||||
import com.gamedog.vididin.VididinEvents
|
import com.gamedog.vididin.VididinEvents
|
||||||
import com.gamedog.vididin.beans.RECORD_GOLD_PLUS_NEWBIE_GIFT
|
|
||||||
import com.gamedog.vididin.beans.RECORD_GOLD_PLUS_WATCH_VIDEO_BY_TIME_DURATION
|
import com.gamedog.vididin.beans.RECORD_GOLD_PLUS_WATCH_VIDEO_BY_TIME_DURATION
|
||||||
import com.gamedog.vididin.beans.RecordGold
|
import com.gamedog.vididin.beans.RecordGold
|
||||||
import com.gamedog.vididin.core.login.login.AccountManager
|
import com.gamedog.vididin.core.login.login.AccountManager
|
||||||
|
|
@ -175,7 +174,7 @@ class HomeFragment : AppViewsFragment<ViewBinding, UiState, ViewModel>(), OnSwit
|
||||||
val positionInCycle = mWatchedVideoTotal % loopCount
|
val positionInCycle = mWatchedVideoTotal % loopCount
|
||||||
|
|
||||||
if (positionInCycle == 0) {
|
if (positionInCycle == 0) {
|
||||||
showRewardAd()
|
handleShouldShowAdDialog()
|
||||||
} else if (positionInCycle == VIDEO_NUM_GAP_FOR_AD_NORMAL) {
|
} else if (positionInCycle == VIDEO_NUM_GAP_FOR_AD_NORMAL) {
|
||||||
showInterstitialAd {}
|
showInterstitialAd {}
|
||||||
}
|
}
|
||||||
|
|
@ -286,8 +285,12 @@ class HomeFragment : AppViewsFragment<ViewBinding, UiState, ViewModel>(), OnSwit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showRewardAd() {
|
private fun handleShouldShowAdDialog() {
|
||||||
WatchAdDialog(requireActivity(), VidiConst.WATCH_AD_FOR_DAILY_WATCH_AD, null).show()
|
val adDialog = WatchAdDialog(requireActivity(), VidiConst.WATCH_AD_FOR_DAILY_WATCH_AD, null)
|
||||||
|
adDialog.setOnCloseListener {
|
||||||
|
showInterstitialAd {}
|
||||||
|
}
|
||||||
|
adDialog.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setHomeTabStyle(f: Fragment?) {
|
private fun setHomeTabStyle(f: Fragment?) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue