Commit 7f9289e1 authored by jyx's avatar jyx

代码优化

parent 2674a7aa
......@@ -98,7 +98,6 @@ object LocalVedioManager {
if (isSplash) {
bundle.putBoolean(Constant.VEDIO_SPLASH, true)
}
// readyGo(activity, VideoActivity::class.java, bundle)
readyGo(activity, TxVideoActivity::class.java, bundle)
} else {
requestDrama(activity, data, isSplash)
......
......@@ -30,7 +30,6 @@ import com.xinfu.helivideo.ui.widgets.VipCountDialog
import com.xinfu.helivideo.video.tx.adapter.TxVideoAdapter
import com.xinfu.library.utils.nodoubleclick.AntiShake
import kotlinx.android.synthetic.main.activity_tx_video.*
import kotlinx.android.synthetic.main.activity_vip.*
class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
VideoEpisodeAdapter.OnEpisodeClickListener, TxVideoAdapter.OnCustomChildClickListener {
......@@ -64,6 +63,11 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
isSplashEnter = extras?.getBoolean(Constant.VEDIO_SPLASH, false) == true
mVedioBean = Gson().fromJson(json, VedioBean::class.java)
orderTagsList = mVedioBean?.orderTags
if (isPlayNext) {
mVedioBean?.let {
it.recommendIndex = it.recommendIndex + 1
}
}
super.getBundleExtras(extras)
}
......@@ -155,10 +159,13 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
override fun getIndexListSuc(indexList: IndexList) {
// 处理推荐页跳转自动播放下一集逻辑
playIndex = if (isPlayNext) {
mVedioBean!!.recommendIndex - 1
if (isPlayNext) {
playIndex = mVedioBean!!.recommendIndex - 1
if (playIndex >= mVedioBean!!.unlockIndex - 1) {
playIndex = mVedioBean!!.unlockIndex - 1
}
} else {
mVedioBean!!.seeIndex - 1
playIndex = mVedioBean!!.seeIndex - 1
}
if (playIndex > mVedioBean!!.vedioTotal) playIndex = 0
......
......@@ -46,7 +46,6 @@ class TxVideoFragment : BaseFragment(), RecommendView {
recommendPresenter.autoList()
}
recommend_view.setOnVideoEndListener {
videos[recommend_view.currentPosition].recommendIndex++
LocalVedioManager.startVedioDetailActivityForType(
requireActivity(),
videos[recommend_view.currentPosition],
......@@ -58,7 +57,6 @@ class TxVideoFragment : BaseFragment(), RecommendView {
override fun onCustomChildClick(view: View, position: Int) {
when (view.id) {
R.id.ll_bottom -> {
videos[position].recommendIndex++
LocalVedioManager.startVedioDetailActivityForType(
requireActivity(),
videos[position],
......
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