Commit c1b64f4d authored by jyx's avatar jyx

代码优化

parent a57a7a1f
......@@ -199,7 +199,9 @@ class DrawExpressManager {
isLoadSuccess = 0
isClickScreen = true
// callback?.loadSuccess(frameLayout)
callback?.loadSuccess(viewCache.lastElement())
if (viewCache.size > 0) {
callback?.loadSuccess(viewCache.lastElement())
}
} else {
LogUtil.e(TAG, "gromore draw信息流--> 5、展示广告时失败了,广告可能超时45分钟 onError ")
// 状态重置
......
......@@ -560,7 +560,8 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
}
})
dialog?.setOnEpisodeClickListener(this)
dialog?.setCurrentIndex(mCurrentIndex - 1)
val index = if (mCurrentIndex == 0) 0 else mCurrentIndex - 1
dialog?.setCurrentIndex(index)
dialog?.show()
}
......
......@@ -27,6 +27,7 @@ import com.mints.helivideo.ui.widgets.DialogListener
import com.mints.helivideo.ui.widgets.VideoEpisodeDialog
import com.mints.helivideo.ui.widgets.VipCountDialog
import com.mints.helivideo.utils.AppPreferencesManager
import com.mints.helivideo.utils.LogUtil
import com.mints.helivideo.utils.SpanUtils
import com.mints.helivideo.video.tx.VideoModel
import com.mints.helivideo.video.tx.adapter.TxVideoAdapter
......@@ -187,7 +188,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
} else {
playIndex = mVedioBean!!.seeIndex - 1
}
if (playIndex > mVedioBean!!.vedioTotal) playIndex = 0
if (playIndex > mVedioBean!!.vedioTotal || playIndex <= 0) playIndex = 0
tipList = indexList.tip
mVedioBean = indexList.vedioMsg
......@@ -268,10 +269,10 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
val readPosition = getRealPosition(position + 1)
super_short_video_view.onItemClick(readPosition)
Handler(Looper.getMainLooper()).postDelayed({
showVipCountDialog(position + 1)
localShowLucky(position + 1)
}, 300)
// Handler(Looper.getMainLooper()).postDelayed({
// showVipCountDialog(position + 1)
// localShowLucky(position + 1)
// }, 300)
}
private fun getAdapterData(): MutableList<VideoMultiItemEntity> {
......
......@@ -157,7 +157,7 @@ public class SuperShortVideoView extends RelativeLayout {
List<VideoModel> tempUrlList = initUrlList(position, MAX_PLAYER_COUNT_ON_PASS);
mPlayerManager.updateManager(tempUrlList);
TXVodPlayerWrapper txVodPlayerWrapper = mPlayerManager.getPlayer(mList.get(position).getVideoModel());
if (txVodPlayerWrapper != null) {
if (txVodPlayerWrapper != null && mBaseItemView != null) {
Log.i(TAG, "txVodPlayerWrapper " + txVodPlayerWrapper + "url-- " + mList.get(position).getVideoModel().videoURL);
Log.i(TAG, "txVodPlayerWrapper " + txVodPlayerWrapper);
mBaseItemView.setTXVodPlayer(txVodPlayerWrapper);
......@@ -218,6 +218,8 @@ public class SuperShortVideoView extends RelativeLayout {
}
public void onItemClick(final int position) {
if (position >= mList.size()) return;
mRecyclerView.scrollToPosition(position);
mRecyclerView.post(() -> {
Log.i(TAG, "onItemClick");
......
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