-
Notifications
You must be signed in to change notification settings - Fork 706
Add full support for edge-to-edge #2002
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
Conversation
|
I think this is now ready for review. I've done extremely extensive testing on practically every single supported API level and it seems to work fine. But there is always a good chance I missed something. |
|
Could you perhaps split this into two pull requests, one for targetSdk and one for edge-to-edge. That way we can first merge edge-to-edge and then merge targetSdk later. By doing this we can test out edge-to-edge on the pre-release group first, without all the small changes of changing the targetSdk. |
Sure, good point. I did it like this only because bumping to 36 (original intent of this PR) required edge-to-edge support. I'll switch it back to 35 for now. |
|
@fire-light42 now switched back to 35. I'll do another PR later to bump to targetSdk 36. I kept manifestPlaceholders here even though its now unrelated because its useful to just have anyway. |
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.
Code looks good, will test later 👍
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.
Everything looks good. Unfortunately it does not handle the notch correctly on phones with a notch. Please check the behavior with a notch in both versions (eg on landscape mode). If you do not have a notch on your device there is a software notch in developer settings.
Whoops, yes I did forget to handle |
Ive added display cutout support. I had to end up drawing an overlay for it so that it doesn't look horrible by making the cutout background the same as the default fragment background which was a bit tricky. Hopefully I did it okay, if not I apologize. |
|
I also found and fixed another bug where using RTL layout totally messed it up. But thats also now fixed. |
|
I found and fixed one more bug with this when in chromecast or main subtitle settings, and the subtitle dialog in player so that the system bars properly blend, as it was kinda messed up before. But I think that really should be it for this lol. Hopefully anyway. |
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.
Very good pull request. However when testing I found two major bugs.
- Subtitle settings in the player does not look the same as in the settings:
I have no idea how or why given that they use the same xml. I tested building both debug, and a stable app apk, and both had this issue. Might be OS issues?
- When using emulator on a phone, if you go back from an episode the navigation bars will not show up until you rotate your phone, making it unnecessarily hard to navigate. This should be fixed if you do not have a very good reason for this new behavior.
Note that this is not an exhaustive list given that I only did cursory testing. More changes may be requested after you fix these.
BTW, Just to answer this, this was caused by |
|
Everything works when testing, both the issues I found was fixed. The only new minor issue I found was that the notch in the trailer player on phone layout pads the player unevenly when in fullscreen mode. While it is not a big issue, it is changed from pre-release and what the player is like normally. |
Nice catch with that one, it should be fixed now. |
|
Hmm I found a new bug that exists in pre release also.
Now the navigation and status bars are still hidden and its still still in full screen mode even though the trailer is not anymore. I don't plan to fix in this PR though because it's unrelated as it is in pre also. |
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.






This is required for targetSdk 36, so it is also in preparation for that.
A side effect of doing this fixes many layout bugs such as:
This also fixes immersive mode to use the modern method, the commented out was just wrong and unreliable but this uses a more reliable (and modern) method that is more compatible with edge-to-edge.
This also adds compat methods,
setNavigationBarColorCompat, andenableEdgeToEdgeCompatto reduce code duplication and properly maintain compatability on very low APIs that edge-to-edge doesnt support, or is very buggy (technically Android 10 supports it but it is very buggy so we only enable on Android 11+).navigationBarColorno longer does anything at all when using edge-to-edge, so just to future proof it and to maintain consistency and reduce the likelihood of random odd bugs, we don't use it when using edge-to-edge. Technically the same goes forandroid:navigationBarColorandandroid:statusBarColorinstyles.xmlbut it should be okay and can leave those for now.For the cutout, it honors the camera cutout setting in Android settings in some devices, if thats set to auto or hidden it pads it and then draws a black overlay to make design look consistent and appear as if the screen ends at that point. When that setting is set to show, it doesn't draw the black bar nor pad because in that case it makes the system think there is no cutout and thus
WindowInsetsCompat.Type.displayCutoutreturns nothing, which is what all that logic bases on for compatability accross all devices and API levels.This also properly handles RTL support so the layout doesn't get very odd on RTL languages.