Fix Dimensions window values on Android < 15#53254
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 |
|
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
This PR is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label. |
9e4c7de to
6ccb1ef
Compare
|
As |
|
8b4c84a to
84d709e
Compare
9e07deb to
9ffbd21
Compare
e3c04d5 to
569b3e0
Compare
|
@alanleedev has imported this pull request. If you are a Meta employee, you can view this in D80237818. |
569b3e0 to
b247afd
Compare
# Conflicts: # packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java
b247afd to
8c427b6
Compare
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
|
This pull request was successfully merged by @zoontek in 44a4b1b When will my fix make it into a release? | How to file a pick request? |
|
@alanleedev merged this pull request in 44a4b1b. |
Summary: Following #53254 Removes the deprecated `getWindowDisplayMetrics` / `setWindowDisplayMetrics` / `getDisplayMetricsWritableMap` APIs from `DisplayMetricsHolder`. These were marked `TODO(0.87)` for removal once the non-breaking window closed. ## Changelog: [ANDROID] [REMOVED] - Remove `DisplayMetricsHolder.getWindowDisplayMetrics`, `setWindowDisplayMetrics`, and `getDisplayMetricsWritableMap` Pull Request resolved: #56635 Test Plan: - `./gradlew :packages:react-native:ReactAndroid:test` passes (removed `DisplayMetricsHolderTest` window-metrics cases and the `PixelUtilTest` references) - checked prefetching logs with VR - `./arvr/apps/LivingRoom/build_and_run.sh` - `CometPrefetchers com.oculus.tv D Found entrypoints to prefetch for: LivingRoomHomeSurface.entrypoint. Custom variables: react_native_pixel_ratio = 1.25` - `./arvr/apps/Store/build_and_run.sh` - `CometPrefetchers com.oculus.store D Found entrypoints to prefetch for: StoreHome.entrypoint. Custom variables: react_native_pixel_ratio = 1.25` Reviewed By: javache Differential Revision: D103695359 Pulled By: alanleedev fbshipit-source-id: fdcf2f74b56323e9a7474c6aea09d3dcbaa4fd7f
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.