Commit d4883bee authored by mengcuiguang's avatar mengcuiguang

优化好兔生命周期stop监听

parent df7344c2
......@@ -130,7 +130,7 @@ class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListe
}
override fun onStop(p0: String?, p1: String?, p2: String?) {
pauseDownloadTime()
// pauseDownloadTime()
}
})
}
......
......@@ -31,8 +31,6 @@ import kotlinx.android.synthetic.main.fragment_main_first.*
import net.grandcentrix.tray.AppPreferences
import kotlin.collections.ArrayList
private val TAG = MainFragment::class.java.simpleName
/**
* 描述:首页
* 作者:孟崔广
......@@ -40,6 +38,8 @@ private val TAG = MainFragment::class.java.simpleName
*/
class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
private val TAG = MainFragment::class.java.simpleName
private val homePresenter by lazy { HomePresenter() }
private val userManager by lazy { UserManager.getInstance() }
private val ps by lazy { AppPreferences(context) }
......@@ -85,6 +85,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
// 广告回调
YLUIConfig.getInstance().registerAdListener(object : YLAdListener {
override fun onSuccess(p0: String?, p1: Int, p2: String?, p3: String?) {
LogUtil.d(TAG,"onSuccess")
}
override fun onError(p0: String?, p1: Int, p2: String?, p3: Int, p4: String?, p5: String?) {
......@@ -94,6 +95,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
override fun onShow(p0: String?, p1: Int, p2: String?, p3: String) {
LogUtil.d(TAG,"onShow")
resumeAdTime()
}
......@@ -107,17 +109,22 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
override fun onAdEmpty(p0: String?, p1: Int, p2: String?, p3: String?) {}
override fun onVideoStart(p0: String?, p1: Int, p2: String?, p3: String) {}
override fun onVideoStart(p0: String?, p1: Int, p2: String?, p3: String) {
LogUtil.d(TAG,"onVideoStart")
}
override fun onVideoPause(p0: String?, p1: Int, p2: String?, p3: String?) {
LogUtil.d(TAG,"onVideoPause")
pauseDownloadTime()
}
override fun onVideoResume(p0: String?, p1: Int, p2: String?, p3: String?) {
LogUtil.d(TAG,"onVideoResume")
resumeAdTime()
}
override fun onVideoComplete(p0: String?, p1: Int, p2: String?, p3: String?) {
LogUtil.d(TAG,"onVideoComplete")
pauseDownloadTime()
}
......@@ -296,15 +303,18 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
isFirstLoadVedio = false
initTimeview()
} else {
LogUtil.d(TAG,"registerPlayerCallBack onStart")
resumeDownloadTime(videoid)
}
}
override fun onPause(pager: String, p1: String?, p2: String?) {
LogUtil.d(TAG,"registerPlayerCallBack onPause")
pauseDownloadTime()
}
override fun onResume(pager: String, videoid: String, p2: String?) {
LogUtil.d(TAG,"registerPlayerCallBack onResume")
resumeDownloadTime(videoid)
}
......@@ -313,6 +323,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
override fun onLoopComplete(pager: String?, videoID: String, taskID: String?, num: Int) {
LogUtil.d(TAG,"registerPlayerCallBack onLoopComplete")
addVedioIdList(videoID)
pauseDownloadTime()
}
......@@ -324,11 +335,13 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
override fun onError(pager: String, p1: String?, p2: String?) {
pauseDownloadTime()
}
override fun onStop(pager: String, p1: String?, p2: String?) {
pauseDownloadTime()
LogUtil.d(TAG,"registerPlayerCallBack onStop")
// pauseDownloadTime()
}
})
}
......
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