From 2526095b9764a272d2702624beb86a271713d185 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 3 May 2026 14:32:13 +0000 Subject: [PATCH] Align channel menu back navigation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 白一梓 --- .../com/whyun/witv/ui/PlayerActivity.java | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/whyun/witv/ui/PlayerActivity.java b/app/src/main/java/com/whyun/witv/ui/PlayerActivity.java index cbab0e5..07bba70 100644 --- a/app/src/main/java/com/whyun/witv/ui/PlayerActivity.java +++ b/app/src/main/java/com/whyun/witv/ui/PlayerActivity.java @@ -1152,6 +1152,23 @@ private void focusSelectedGroupRow() { }); } + private boolean handleChannelListBack() { + if (!isChannelListPanelVisible()) { + return false; + } + View focused = getCurrentFocus(); + if (focused != null && channelListOverlay != null && isDescendantOf(focused, channelListOverlay)) { + focusSelectedGroupRow(); + return true; + } + cancelChannelListIdleHide(); + channelListPanel.setVisibility(View.GONE); + if (playerView != null) { + playerView.requestFocus(); + } + return true; + } + @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (isSettingsPanelVisible()) { @@ -1234,12 +1251,7 @@ && isDescendantOf(focused, channelListOverlay)) { } break; case KeyEvent.KEYCODE_BACK: - if (isChannelListPanelVisible()) { - cancelChannelListIdleHide(); - channelListPanel.setVisibility(View.GONE); - if (playerView != null) { - playerView.requestFocus(); - } + if (handleChannelListBack()) { return true; } showExitDialog(); @@ -1307,11 +1319,7 @@ public void onBackPressed() { return; } if (isChannelListPanelVisible()) { - cancelChannelListIdleHide(); - channelListPanel.setVisibility(View.GONE); - if (playerView != null) { - playerView.requestFocus(); - } + handleChannelListBack(); return; } showExitDialog();