fix: fullscreen button did nothing in portrait on large screens#77
Open
4in4in wants to merge 1 commit into
Open
fix: fullscreen button did nothing in portrait on large screens#774in4in wants to merge 1 commit into
4in4in wants to merge 1 commit into
Conversation
Android 12L+ devices with sw >= 600dp (tablets, unfolded foldables like Galaxy Fold) ignore setRequestedOrientation(), so the screen rotation button silently failed when it tried to rotate to landscape instead of toggling fullscreen. Detect this case and toggle fullscreen directly, and skip the auto exit-fullscreen paths that rely on forced rotation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On large screens (unfolded foldables, tablets) the player's fullscreen button did nothing in portrait orientation — it only started working after physically rotating the device to landscape. Reproduced on a Galaxy Fold 6 (inner screen), both with tablet mode enabled and disabled.
Problem
The fullscreen button handler (
VideoDetailFragment.onScreenRotationButtonClicked()) only toggles fullscreen directly on tablets when auto-rotate is enabled or the device is already in landscape. In every other case it callsactivity.setRequestedOrientation(SENSOR_LANDSCAPE)and relies on the resulting rotation to enter fullscreen.Since Android 12L, device manufacturers can configure devices to ignore
setRequestedOrientation()on large screens (see Device compatibility mode); Samsung enables this on the Fold's inner display. And since Android 16, for apps targeting SDK 36 this is guaranteed platform behavior on displays with smallest width >= 600dp: orientation restrictions, includingsetRequestedOrientation(), are ignored (also announced in the Android Developers blog). PipePipe targets SDK 36, so on the unfolded Fold the call is silently ignored, without any error, and the button appears dead:Changes
DeviceUtils.isOrientationRequestIgnored(): Android 12L+ and current display at least sw600dp — the same threshold the system uses when ignoring orientation requests.onScreenRotationButtonClicked(): on such screens toggle fullscreen directly instead of trying to rotate (portrait fullscreen is already supported — vertical videos use it).VideoDetailFragment.onServiceConnected()andPlayer.onVideoSizeChanged().Phones and pre-12L tablets keep the existing behavior (the new check returns false there); the folded cover screen (below sw600dp) also behaves as before.
Validation
./gradlew assembleDebugin PipePipeClient.