From c0ff1e86b93bd47761aae2cf3e5fcd3ef3053822 Mon Sep 17 00:00:00 2001 From: Atemu Date: Fri, 20 Nov 2020 21:43:05 +0100 Subject: [PATCH] VideoDetailFragment: Don't exit fullscreen on rotation in tablet UI Fixes https://github.com/TeamNewPipe/NewPipe/issues/4936 Going from portrait to landscape doesn't toggle fullscreen in tablet mode, so the reverse action shouldn't do it either. --- .../schabi/newpipe/fragments/detail/VideoDetailFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 772a291b1..2f1c3e586 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 @@ -274,7 +274,9 @@ public final class VideoDetailFragment // If the video is playing but orientation changed // let's make the video in fullscreen again checkLandscape(); - } else if (player.isFullscreen() && !player.isVerticalVideo()) { + } else if (player.isFullscreen() && !player.isVerticalVideo() + // Tablet UI has orientation-independent fullscreen + && !DeviceUtils.isTablet(activity)) { // Device is in portrait orientation after rotation but UI is in fullscreen. // Return back to non-fullscreen state player.toggleFullscreen();