Skip to content

Commit

Permalink
Update the cached dimensions when orientation changes (facebook#30324)
Browse files Browse the repository at this point in the history
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:
facebook#29105
facebook#29451
facebook#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: facebook#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
  • Loading branch information
ajpaulingalls authored and alloy committed Nov 19, 2020
1 parent d5a19a4 commit 9c132c4
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@ private void checkForDeviceOrientationChanges() {
return;
}
mDeviceRotation = rotation;
DisplayMetricsHolder.initDisplayMetrics(getContext().getApplicationContext());
emitOrientationChanged(rotation);
}

Expand Down

0 comments on commit 9c132c4

Please sign in to comment.