Skip to content

Commit a6a4d33

Browse files
ajpaulingallskelset
authored andcommitted
Update the cached dimensions when orientation changes (#30324)
Summary: Currently the dimensions are created once, and then cached. This change will reload the dimensions when the device orientation changes to insure that dimension update events follow orientation changed events. this should help address the following issues, that I know of: #29105 #29451 #29323 ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [Android] [Fixed] - Dimension update events are now properly sent following orientation change Pull Request resolved: #30324 Test Plan: Open up RNTester app. Select the Dimensions API list item. Rotate the device and verify that the dimensions are correct based on orientation. Reviewed By: fkgozali Differential Revision: D24874733 Pulled By: ejanzer fbshipit-source-id: 867681ecb009d368a2ae7b67d94d6355e67dea7b
1 parent cda77c7 commit a6a4d33

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java

+1
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,7 @@ private void checkForDeviceOrientationChanges() {
756756
return;
757757
}
758758
mDeviceRotation = rotation;
759+
DisplayMetricsHolder.initDisplayMetrics(getContext().getApplicationContext());
759760
emitOrientationChanged(rotation);
760761
}
761762

0 commit comments

Comments
 (0)