Skip to content

Commit

Permalink
在详情页退出的时候会显示暂停View,看着难受 ,移除2个 static View 写法.
Browse files Browse the repository at this point in the history
  • Loading branch information
klosw committed Mar 9, 2024
1 parent dec7062 commit 7c446c4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public void onAnimationEnd(Animator animation) {
LinearLayout mSpeedll;

// pause container
public static FrameLayout mProgressTop;
public FrameLayout mProgressTop;
ImageView mPauseIcon;
LinearLayout mTapSeek;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import androidx.lifecycle.ViewModelProvider;

import com.blankj.utilcode.util.ServiceUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.github.tvbox.osc.R;
import com.github.tvbox.osc.api.ApiConfig;
Expand Down Expand Up @@ -98,7 +99,7 @@ public class DetailActivity extends BaseActivity {
private FragmentContainerView llPlayerFragmentContainer;
private View llPlayerFragmentContainerBlock;
private View llPlayerPlace;
private static PlayFragment playFragment = null;
private PlayFragment playFragment = null;
private ImageView ivThumb;
private TextView tvName;
private TextView tvYear;
Expand Down Expand Up @@ -701,7 +702,7 @@ private List<VodSeriesGroup> getSeriesGroupList() {
} catch (Exception e) {
}
return arrayList;
}
}

private void setTextShow(TextView view, String tag, String info) {
if (info == null || info.trim().isEmpty()) {
Expand Down Expand Up @@ -1110,9 +1111,16 @@ public void onUserLeaveHint() {
// takagen99 : Additional check for external player
if (supportsPiPMode() && showPreview && !playFragment.extPlay && Hawk.get(HawkConfig.BACKGROUND_PLAY_TYPE, 0) == 2) {
// 创建一个Intent对象,模拟按下Home键
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
startActivity(intent);
try { //我的电视上不允许 手动启动 Home
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
startActivity(intent);
} catch (SecurityException e) {
e.printStackTrace();
ToastUtils.showShort("画中画 开启失败!");
return;
}

// Calculate Video Resolution
int vWidth = playFragment.mVideoView.getVideoSize()[0];
int vHeight = playFragment.mVideoView.getVideoSize()[1];
Expand Down Expand Up @@ -1226,7 +1234,7 @@ public void onBackPressed() {
if (fullWindows) {
if (playFragment.onBackPressed())
return;
VodController.mProgressTop.setVisibility(View.INVISIBLE);
playFragment.getVodController().mProgressTop.setVisibility(View.INVISIBLE);
toggleFullPreview();
mGridView.requestFocus();
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,8 @@ public boolean dispatchKeyEvent(KeyEvent event) {
public void onPause() {
super.onPause();
if (mVideoView != null) {
//详情页面 退出会显示 哪个进度条 看着难受
getVodController().mProgressTop.setAlpha(0);
mVideoView.pause();
}
}
Expand All @@ -1116,6 +1118,8 @@ public void onPause() {
public void onResume() {
super.onResume();
if (mVideoView != null) {
//详情页面 退出会显示 哪个进度条 看着难受
getVodController().mProgressTop.setAlpha(1);
mVideoView.resume();
}
}
Expand Down

0 comments on commit 7c446c4

Please sign in to comment.