Commit 4e345302 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent b7e6a1fc
......@@ -114,6 +114,8 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
pauseDownloadTime()
channelFragment?.onPause()
destoryTimerRedbox()
if (isToCreateReward) {
// 防止界面切换 重置红包动画
// 好兔视频已加载 且 红包已转满
......@@ -306,6 +308,9 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
}
stopRedbox()
destoryTimerRedbox()
mRedBoxTimer = CountDownTimerSupport(time * 1000, 1000)
rl_fragment_main_redbox.isClickable = false
......@@ -378,4 +383,8 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
})
}
private fun destoryTimerRedbox(){
mRedBoxTimer?.stop()
mRedBoxTimer = null
}
}
\ No newline at end of file
......@@ -152,6 +152,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
stopRedbox()
// 倒计时红包暂停
pauseDownloadTime()
destoryTimerRedbox()
littleVideoFragment?.onPause()
if (isToCreateReward) {
......@@ -600,6 +602,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
stopRedbox()
destoryTimerRedbox()
mRedBoxTimer = CountDownTimerSupport(time * 1000, 1000)
rl_fragment_main_redbox.isClickable = false
......@@ -625,4 +628,9 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
showRedbox(rl_fragment_main_redbox)
}
}
private fun destoryTimerRedbox(){
mRedBoxTimer?.stop()
mRedBoxTimer = null
}
}
\ No newline at end of file
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