-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Fix Dimensions window values on Android < 15 #53254
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
base: main
Are you sure you want to change the base?
Conversation
22726c1 to
c95b5aa
Compare
|
@alanleedev has imported this pull request. If you are a Meta employee, you can view this in D80237818. |
c95b5aa to
47d8ed5
Compare
|
|
@alanleedev has imported this pull request. If you are a Meta employee, you can view this in D80237818. |
|
@zoontek There was a question if we could to" keep initDisplayMetrics as a backwards-compat API and have it call both". I haven't quite figured out the internal crash yet. And it does seem like new API does make things bit more fragile. Do you have any thoughts here? |
|
@alanleedev One alternative could be to extract the is UI thread method from AndroidX, set both screen and window dimensions when |
Summary:
This PR (initially created for edge-to-edge opt-in support, rebased multiple times) fixes the
DimensionsAPIwindowvalues on Android < 15, when edge-to-edge is enabled.Currently the window height doesn't include the status and navigation bar heights (but it does on Android >= 15):
Using
WindowMetricsCalculatorfrom AndroidX:Fixes #47080
Changelog:
[Android] [Fixed] Fix
Dimensionswindowvalues on Android < 15 when edge-to-edge is enabledTest Plan:
Run the example app on an Android < 15 device.