-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Respect cutouts when playing in MultiWindow #7451
Respect cutouts when playing in MultiWindow #7451
Conversation
a64ca74
to
8fee409
Compare
Thank you for the PR! I checked if the problem exists on my device (Android 9; Huawei EMUI 9.1.0) and I'm unable to reproduce it in the first place. |
I have seen this problem on hardware on a Nokia 7.2 with Android 10 (API 29) and can reproduce this in the emulator for the virtual device definition "Pixel 3 XL" with API lvl 30 (which is in the screenshots) and also when I create a custom device with API lvl 30 resolution 1920x1080 plus enabling the cutout setting in the developer tools. Maybe the author of the original issue #5787, @desmonk can tell us their device. |
@Cheechaii the code seems to be duplicated between two difference places; can you de-duplicate it? |
I'm also pretty sure that the code can be shrunk with the "?:" aka ternary operator |
93f4e07
to
c92a907
Compare
I extracted the code and replaced 3 code duplications and used the ternary expression. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me. Thank you!
I think we should revert this PR as it causes multiple problems:
|
What is it?
Description of the changes in your PR
This fixes the half overlaying cutout on devices with API version 28 and higher. Currently, there are undesirable black bars.
This also respects the cutout when rotating the phone and resizes the video accordingly when in fullscreen. At the moment this leaves undesirable black bars at the top and bottom on devices that have a cutout and a screen that is nearly or exactly the resolution of the video. Maybe a setting can help here or a check for video/device resolution. Let me know what behavior you prefer.
This is my first encounter with Android in about 7 years, so please go easy on me. Let me know if there are bad behaviors or APIs that I missed.
Before/After Screenshots/Screen Record
Before:
After:
Fixes the following issue(s)
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.
Due diligence