Commit a7c3260f authored by jyx's avatar jyx

代码优化

parent 846893bd
...@@ -96,12 +96,17 @@ class DramaTabFragment : BaseFragment(), VideoView { ...@@ -96,12 +96,17 @@ class DramaTabFragment : BaseFragment(), VideoView {
super.onResume() super.onResume()
Log.d(TAG, "onResume") Log.d(TAG, "onResume")
dpWidget?.fragment?.onResume() dpWidget?.fragment?.onResume()
dpWidget?.fragment?.userVisibleHint = true
} }
override fun onPause() { override fun onPause() {
super.onPause() super.onPause()
Log.d(TAG, "onPause") Log.d(TAG, "onPause")
dpWidget?.fragment?.onPause() dpWidget?.fragment?.onPause()
dpWidget?.fragment?.userVisibleHint = false
} }
override fun onHiddenChanged(hidden: Boolean) { override fun onHiddenChanged(hidden: Boolean) {
...@@ -111,7 +116,7 @@ class DramaTabFragment : BaseFragment(), VideoView { ...@@ -111,7 +116,7 @@ class DramaTabFragment : BaseFragment(), VideoView {
override fun setUserVisibleHint(isVisibleToUser: Boolean) { override fun setUserVisibleHint(isVisibleToUser: Boolean) {
super.setUserVisibleHint(isVisibleToUser) super.setUserVisibleHint(isVisibleToUser)
dpWidget?.fragment?.userVisibleHint = isVisibleToUser // dpWidget?.fragment?.userVisibleHint = isVisibleToUser
} }
private var dramaListener: IDPDramaListener = object : IDPDramaListener() { private var dramaListener: IDPDramaListener = object : IDPDramaListener() {
......
...@@ -118,11 +118,6 @@ public class RecommendVideoView extends RelativeLayout { ...@@ -118,11 +118,6 @@ public class RecommendVideoView extends RelativeLayout {
private void onPageSelectedMethod(int position) { private void onPageSelectedMethod(int position) {
if (mOnPageChangeListener != null) mOnPageChangeListener.onPageChange(position); if (mOnPageChangeListener != null) mOnPageChangeListener.onPageChange(position);
if (mBaseItemView != null) {
mBaseItemView.pausePlayer();
}
if (position == mUrlList.size()) return;
if (mLastPositionInIDLE != position) { if (mLastPositionInIDLE != position) {
View view = mSnapHelper.findSnapView(mLayoutManager); View view = mSnapHelper.findSnapView(mLayoutManager);
if (view == null) { if (view == null) {
......
...@@ -143,6 +143,8 @@ public class SuperShortVideoView extends RelativeLayout { ...@@ -143,6 +143,8 @@ public class SuperShortVideoView extends RelativeLayout {
if (mOnPageChangeListener != null) mOnPageChangeListener.onPageChange(position); if (mOnPageChangeListener != null) mOnPageChangeListener.onPageChange(position);
if (position == mUrlList.size()) { if (position == mUrlList.size()) {
mLastPositionInIDLE = position;
mBaseItemView.stopForPlaying();
return; return;
} }
......
...@@ -244,7 +244,6 @@ public class TXVideoBaseView extends RelativeLayout implements View.OnClickListe ...@@ -244,7 +244,6 @@ public class TXVideoBaseView extends RelativeLayout implements View.OnClickListe
@Override @Override
public void onProgress(Bundle bundle) { public void onProgress(Bundle bundle) {
mIvCover.setVisibility(GONE);
handlePlayProgress(bundle); handlePlayProgress(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