Skip to content

Commit aea912f

Browse files
author
Mikhail Barashkov
committed
Implement "pause/play" toggle on hardware keyboard space button.
1 parent 522d6d8 commit aea912f

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,6 +1850,7 @@ public void onFullscreenStateChanged(final boolean fullscreen) {
18501850

18511851
if (fullscreen) {
18521852
hideSystemUiIfNeeded();
1853+
binding.overlayPlayPauseButton.requestFocus();
18531854
} else {
18541855
showSystemUi();
18551856
}

app/src/main/res/layout/fragment_video_detail.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,8 @@
675675
android:background="?attr/selectableItemBackground"
676676
android:padding="10dp"
677677
android:scaleType="center"
678+
android:focusable="true"
679+
android:focusedByDefault="true"
678680
app:srcCompat="?attr/ic_play_arrow"
679681
tools:ignore="ContentDescription,RtlHardcoded" />
680682

0 commit comments

Comments
 (0)