fix: return to portrait after video finish in fullscreen#13543
Open
Y2kz wants to merge 2 commits into
Open
Conversation
TobiGr
requested changes
May 25, 2026
Comment on lines
+1480
to
+1481
| activity.getContentResolver(), Settings.System.USER_ROTATION, 0); | ||
| if (userRotation == 1 || userRotation == 3) { |
Contributor
There was a problem hiding this comment.
please use the surface rotation constants here to increase the readability.
Contributor
Author
There was a problem hiding this comment.
userRotation == Surface.ROTATION_90 || userRotation == Surface.ROTATION_270 insted of == 1 || == 3 correct?
Comment on lines
+943
to
+959
| if (globalScreenOrientationLocked(activity)) { | ||
| // Restore correct orientation according to system rotation lock settings | ||
| // when exiting fullscreen mode. | ||
| final int userRotation = Settings.System.getInt( | ||
| activity.getContentResolver(), | ||
| Settings.System.USER_ROTATION, 0); | ||
| if (userRotation == 1 || userRotation == 3) { | ||
| activity.setRequestedOrientation( | ||
| ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); | ||
| } else { | ||
| activity.setRequestedOrientation( | ||
| ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); | ||
| } | ||
| } else { | ||
| activity.setRequestedOrientation( | ||
| ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); | ||
| } |
Contributor
There was a problem hiding this comment.
This code is a complete duplicate. I'd prefer to have this extracted into a method which is called here and in the VideoDetailFragment.
Contributor
Author
There was a problem hiding this comment.
Just to clarify, do you have a specific location in mind for this ? planning to add in PlayerHelper
c41014a to
8f450de
Compare
…urface rotation constants
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.
What is it?
refactorbranchDescription of the changes in your PR
With the changes in PR , video now switches back to portrait mode when playback is completed , closed using the "X" button.
This also fixes the case mentioned in #13482 , where the video is minimised by swiping down and then closed using the "X" button. Additionally, double swiping down the video to close it also returns the app to portrait mode.
Note on config: Tablet mode Off / Auto (with less than 480 dp)
Before/After Screenshots/Screen Record
screen-20260524-141327-1779612153401.mp4
Fixes the following issue(s)
Fixes #
Return to portrait after video finish in fullscreen #5967
fullscreened video does not revert to portrait view on completion #13057
(Already open PR - Fix: Issue where upon video completion in fullscreen landscape, the device does not revert back to portrait mode #13178 )
When I tested the ci build, it did not work for me (possibly due to the AVD configuration, though I’m not sure).
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.
Due diligence