diff --git a/app/src/leanback/java/com/fongmi/android/tv/ui/activity/DetailActivity.java b/app/src/leanback/java/com/fongmi/android/tv/ui/activity/DetailActivity.java index 11eb12f2c..a8ed0fd18 100644 --- a/app/src/leanback/java/com/fongmi/android/tv/ui/activity/DetailActivity.java +++ b/app/src/leanback/java/com/fongmi/android/tv/ui/activity/DetailActivity.java @@ -337,10 +337,9 @@ public class DetailActivity extends BaseActivity implements CustomKeyDownVod.Lis mViewModel.search.observe(this, result -> setSearch(result.getList())); mViewModel.player.observe(this, result -> { setUseParse(ApiConfig.hasParse() && ((result.getPlayUrl().isEmpty() && ApiConfig.get().getFlags().contains(result.getFlag())) || result.getJx() == 1)); - mBinding.control.parseLayout.setVisibility(isUseParse() ? View.VISIBLE : View.GONE); + mBinding.control.parse.setVisibility(isUseParse() ? View.VISIBLE : View.GONE); int timeout = getSite().isChangeable() ? Constant.TIMEOUT_PLAY : -1; mPlayers.start(result, isUseParse(), timeout); - resetFocus(); }); mViewModel.result.observe(this, result -> { if (result.getList().isEmpty()) setEmpty(); @@ -349,13 +348,6 @@ public class DetailActivity extends BaseActivity implements CustomKeyDownVod.Lis }); } - private void resetFocus() { - findViewById(R.id.timeBar).setNextFocusUpId(isUseParse() ? R.id.parse : R.id.next); - for (int i = 0; i < mBinding.control.actionLayout.getChildCount(); i++) { - mBinding.control.actionLayout.getChildAt(i).setNextFocusDownId(isUseParse() ? R.id.parse : R.id.timeBar); - } - } - private void checkCast() { if (isCast()) onVideo(); else mBinding.progressLayout.showProgress(); diff --git a/app/src/leanback/res/layout/adapter_parse.xml b/app/src/leanback/res/layout/adapter_parse.xml index 7056279b9..c9900081c 100644 --- a/app/src/leanback/res/layout/adapter_parse.xml +++ b/app/src/leanback/res/layout/adapter_parse.xml @@ -8,8 +8,6 @@ android:focusable="true" android:focusableInTouchMode="true" android:gravity="center" - android:nextFocusUp="@id/action" - android:nextFocusDown="@id/timeBar" android:textColor="@color/text" android:textSize="14sp" tools:text="解析" /> \ No newline at end of file diff --git a/app/src/leanback/res/layout/view_control_seek.xml b/app/src/leanback/res/layout/view_control_seek.xml index 5d83878c1..16197fbf1 100644 --- a/app/src/leanback/res/layout/view_control_seek.xml +++ b/app/src/leanback/res/layout/view_control_seek.xml @@ -24,9 +24,10 @@ android:layout_weight="1" android:focusable="true" android:focusableInTouchMode="true" - android:nextFocusLeft="@+id/timeBar" - android:nextFocusRight="@+id/timeBar" - android:nextFocusDown="@+id/timeBar" + android:nextFocusLeft="@id/timeBar" + android:nextFocusRight="@id/timeBar" + android:nextFocusUp="@id/next" + android:nextFocusDown="@id/timeBar" app:buffered_color="@color/blue_200" app:played_color="@color/blue_500" app:scrubber_color="@color/blue_500" diff --git a/app/src/leanback/res/layout/view_control_vod.xml b/app/src/leanback/res/layout/view_control_vod.xml index fadd5f633..2a1d953d7 100644 --- a/app/src/leanback/res/layout/view_control_vod.xml +++ b/app/src/leanback/res/layout/view_control_vod.xml @@ -11,6 +11,15 @@ android:paddingEnd="16dp" android:paddingBottom="8dp"> + + - - @@ -53,6 +55,7 @@ android:background="@drawable/selector_text" android:focusable="true" android:focusableInTouchMode="true" + android:nextFocusDown="@id/timeBar" android:text="@string/play_prev" android:textColor="@color/white" android:textSize="14sp" /> @@ -65,6 +68,7 @@ android:background="@drawable/selector_text" android:focusable="true" android:focusableInTouchMode="true" + android:nextFocusDown="@id/timeBar" android:textColor="@color/white" android:textSize="14sp" tools:text="刷新" /> @@ -77,6 +81,7 @@ android:background="@drawable/selector_text" android:focusable="true" android:focusableInTouchMode="true" + android:nextFocusDown="@id/timeBar" android:text="@string/play_change" android:textColor="@color/white" android:textSize="14sp" @@ -90,6 +95,7 @@ android:background="@drawable/selector_text" android:focusable="true" android:focusableInTouchMode="true" + android:nextFocusDown="@id/timeBar" android:textColor="@color/white" android:textSize="14sp" tools:text="EXO" /> @@ -102,6 +108,7 @@ android:background="@drawable/selector_text" android:focusable="true" android:focusableInTouchMode="true" + android:nextFocusDown="@id/timeBar" android:textColor="@color/white" android:textSize="14sp" tools:text="硬解" /> @@ -114,6 +121,7 @@ android:background="@drawable/selector_text" android:focusable="true" android:focusableInTouchMode="true" + android:nextFocusDown="@id/timeBar" android:textColor="@color/white" android:textSize="14sp" tools:text="1.00" /> @@ -126,22 +134,11 @@ android:background="@drawable/selector_text" android:focusable="true" android:focusableInTouchMode="true" + android:nextFocusDown="@id/timeBar" android:textColor="@color/white" android:textSize="14sp" tools:text="預設" /> - - @@ -203,45 +204,31 @@ android:id="@+id/ending" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginEnd="12dp" android:background="@drawable/selector_text" android:focusable="true" android:focusableInTouchMode="true" - android:nextFocusRight="@id/ending" + android:nextFocusDown="@id/timeBar" android:textColor="@color/white" android:textSize="14sp" tools:text="00:00" /> + + - - - - - - - -