From aea912f4995ccf890a921afcbab5435503cbbbba Mon Sep 17 00:00:00 2001 From: Mikhail Barashkov Date: Fri, 12 Feb 2021 11:58:15 +0300 Subject: [PATCH] Implement "pause/play" toggle on hardware keyboard space button. --- .../schabi/newpipe/fragments/detail/VideoDetailFragment.java | 1 + app/src/main/res/layout/fragment_video_detail.xml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java index cb4cfb8b6..7f800a304 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java @@ -1850,6 +1850,7 @@ public final class VideoDetailFragment if (fullscreen) { hideSystemUiIfNeeded(); + binding.overlayPlayPauseButton.requestFocus(); } else { showSystemUi(); } diff --git a/app/src/main/res/layout/fragment_video_detail.xml b/app/src/main/res/layout/fragment_video_detail.xml index 246e9b4d9..498b16b9c 100644 --- a/app/src/main/res/layout/fragment_video_detail.xml +++ b/app/src/main/res/layout/fragment_video_detail.xml @@ -675,6 +675,8 @@ android:background="?attr/selectableItemBackground" android:padding="10dp" android:scaleType="center" + android:focusable="true" + android:focusedByDefault="true" app:srcCompat="?attr/ic_play_arrow" tools:ignore="ContentDescription,RtlHardcoded" />