Commit 2440a43c authored by mengcuiguang2's avatar mengcuiguang2

代码优化

parent 5c301db8
......@@ -90,10 +90,13 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
// 首次进来不是vip,且后续开通vip
if (mVipFlag != UserManager.getInstance().vipFlag && UserManager.getInstance().vipFlag) {
// 重置状态
isPlayNext = false
playIndex = afterOpenVipVedioPosition - 1
super_short_video_view.onItemClick(playIndex)
mVedioBean?.let { videoPresenter.getIndexList("" + it.vedioId) }
Handler(Looper.getMainLooper()).postDelayed({
isPlayNext = false
playIndex = afterOpenVipVedioPosition - 1
super_short_video_view.onItemClick(playIndex)
mVedioBean?.let { videoPresenter.getIndexList("" + it.vedioId) }
}, 100)
}
// vip界面返回弹出广告弹窗
......@@ -136,10 +139,11 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
super_short_video_view.setOnCustomChildClickListener(this)
super_short_video_view.setOnPageChangeListener {
afterOpenVipVedioPosition = it
if (super_short_video_view.isAdPosition(it) || super_short_video_view.isLuckPosition(it)) {
if (!UserManager.getInstance().vipFlag) {
Handler(Looper.getMainLooper()).postDelayed({
afterOpenVipVedioPosition = it
val bundle = Bundle()
bundle.putString(
VipForDialogActivity.VEDIO_ID,
......@@ -300,13 +304,14 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
override fun onEpisodeClick(position: Int) {
afterOpenVipVedioPosition = position
dialog?.dismiss()
val data = super_short_video_view.data
if (position >= mVedioBean!!.unlockIndex) {
if (!UserManager.getInstance().vipFlag) {
Handler(Looper.getMainLooper()).postDelayed({
afterOpenVipVedioPosition = position
val bundle = Bundle()
bundle.putString(
VipForDialogActivity.VEDIO_ID,
......
......@@ -132,11 +132,12 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
new_super_short_video_view.setOnCustomChildClickListener(this)
new_super_short_video_view.setOnPageChangeListener {
afterOpenVipVedioPosition = it
if (new_super_short_video_view.isAdPosition(it) || new_super_short_video_view.isLuckPosition(
it
)
) {
afterOpenVipVedioPosition = it
if (!UserManager.getInstance().vipFlag) {
Handler(Looper.getMainLooper()).postDelayed({
val bundle = Bundle()
......
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