Skip to content

Commit 96c4201

Browse files
committed
Fix controls shown below queue/segments list when using DPAD
Also invert if
1 parent a0bbcd2 commit 96c4201

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

app/src/main/java/org/schabi/newpipe/player/Player.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3815,24 +3815,23 @@ public boolean onKeyDown(final int keyCode) {
38153815
case KeyEvent.KEYCODE_DPAD_DOWN:
38163816
case KeyEvent.KEYCODE_DPAD_RIGHT:
38173817
case KeyEvent.KEYCODE_DPAD_CENTER:
3818-
if (binding.getRoot().hasFocus() && !binding.playbackControlRoot.hasFocus()) {
3819-
// do not interfere with focus in playlist etc.
3818+
if ((binding.getRoot().hasFocus() && !binding.playbackControlRoot.hasFocus())
3819+
|| isQueueVisible) {
3820+
// do not interfere with focus in playlist and play queue etc.
38203821
return false;
38213822
}
38223823

38233824
if (currentState == Player.STATE_BLOCKED) {
38243825
return true;
38253826
}
38263827

3827-
if (!isControlsVisible()) {
3828-
if (!isQueueVisible) {
3829-
binding.playPauseButton.requestFocus();
3830-
}
3828+
if (isControlsVisible()) {
3829+
hideControls(DEFAULT_CONTROLS_DURATION, DPAD_CONTROLS_HIDE_TIME);
3830+
} else {
3831+
binding.playPauseButton.requestFocus();
38313832
showControlsThenHide();
38323833
showSystemUIPartially();
38333834
return true;
3834-
} else {
3835-
hideControls(DEFAULT_CONTROLS_DURATION, DPAD_CONTROLS_HIDE_TIME);
38363835
}
38373836
break;
38383837
}

0 commit comments

Comments
 (0)