From 7c446c4ea39b9418bca1c2778bbaf9dcccd98799 Mon Sep 17 00:00:00 2001 From: klosw <> Date: Sun, 10 Mar 2024 00:34:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E8=AF=A6=E6=83=85=E9=A1=B5=E9=80=80?= =?UTF-8?q?=E5=87=BA=E7=9A=84=E6=97=B6=E5=80=99=E4=BC=9A=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=9A=82=E5=81=9CView,=E7=9C=8B=E7=9D=80=E9=9A=BE=E5=8F=97=20,?= =?UTF-8?q?=E7=A7=BB=E9=99=A42=E4=B8=AA=20static=20View=20=E5=86=99?= =?UTF-8?q?=E6=B3=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../osc/player/controller/VodController.java | 2 +- .../tvbox/osc/ui/activity/DetailActivity.java | 20 +++++++++++++------ .../tvbox/osc/ui/fragment/PlayFragment.java | 4 ++++ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/github/tvbox/osc/player/controller/VodController.java b/app/src/main/java/com/github/tvbox/osc/player/controller/VodController.java index 0f416fe3ce..8cc96f94c4 100644 --- a/app/src/main/java/com/github/tvbox/osc/player/controller/VodController.java +++ b/app/src/main/java/com/github/tvbox/osc/player/controller/VodController.java @@ -238,7 +238,7 @@ public void onAnimationEnd(Animator animation) { LinearLayout mSpeedll; // pause container - public static FrameLayout mProgressTop; + public FrameLayout mProgressTop; ImageView mPauseIcon; LinearLayout mTapSeek; diff --git a/app/src/main/java/com/github/tvbox/osc/ui/activity/DetailActivity.java b/app/src/main/java/com/github/tvbox/osc/ui/activity/DetailActivity.java index 27d9fce989..dbbc2de312 100644 --- a/app/src/main/java/com/github/tvbox/osc/ui/activity/DetailActivity.java +++ b/app/src/main/java/com/github/tvbox/osc/ui/activity/DetailActivity.java @@ -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; @@ -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; @@ -701,7 +702,7 @@ private List getSeriesGroupList() { } catch (Exception e) { } return arrayList; - } + } private void setTextShow(TextView view, String tag, String info) { if (info == null || info.trim().isEmpty()) { @@ -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]; @@ -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; diff --git a/app/src/main/java/com/github/tvbox/osc/ui/fragment/PlayFragment.java b/app/src/main/java/com/github/tvbox/osc/ui/fragment/PlayFragment.java index 0ce1bfb7eb..af19eb7486 100644 --- a/app/src/main/java/com/github/tvbox/osc/ui/fragment/PlayFragment.java +++ b/app/src/main/java/com/github/tvbox/osc/ui/fragment/PlayFragment.java @@ -1108,6 +1108,8 @@ public boolean dispatchKeyEvent(KeyEvent event) { public void onPause() { super.onPause(); if (mVideoView != null) { + //详情页面 退出会显示 哪个进度条 看着难受 + getVodController().mProgressTop.setAlpha(0); mVideoView.pause(); } } @@ -1116,6 +1118,8 @@ public void onPause() { public void onResume() { super.onResume(); if (mVideoView != null) { + //详情页面 退出会显示 哪个进度条 看着难受 + getVodController().mProgressTop.setAlpha(1); mVideoView.resume(); } }