Commit 4e345302 authored by mengcuiguang's avatar mengcuiguang

代码优化

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