Commit d6d5ed17 authored by jyx's avatar jyx

代码优化

parent 7fb14a0a
......@@ -72,7 +72,7 @@ public class CountDownVideoView extends LinearLayout {
public void reset() {
isOver = false;
cdCountVedioView.reset();
isPlaying = true;
isPlaying = false;
}
public void stop() {
......
......@@ -204,6 +204,10 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
videoPresenter.rdVedioMsg()
}
private fun isLockIndex(): Boolean {
return mCurrentIndex > mInitUnlockIndex
}
private var dramaListener: IDPDramaListener = object : IDPDramaListener() {
override fun onDPSeekTo(position: Int, time: Long) {
......@@ -224,6 +228,8 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
}
if (cdvv.isPlaying) {
cdvv.resume()
} else {
cdvv.start()
}
}
......@@ -242,6 +248,8 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
if (cdvv.isPlaying) {
cdvv.resume()
} else {
cdvv.start()
}
}
......@@ -437,7 +445,9 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
tv_tips.visibility = View.GONE
triangle.visibility = View.GONE
cdvv.setTime(data.surplusSeconds)
if (!isLockIndex()) {
cdvv.start()
}
cdvv.setCountDownVideoListener(this)
cl_red_box.setOnClickListener {
if (!cdvv.isOver) return@setOnClickListener
......
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