Commit d6d5ed17 authored by jyx's avatar jyx

代码优化

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