Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix DeviceInfoModule LifecycleEventListener
Summary: Fixes one of the two parts of [issue posted here](#17209). Motivation is that we wanted our app to be able to handle user changing font size while the app is running. Yes, we know that changing font size doesn't inherently trigger a re-render, but at the minimum it should cause `PixelRatio.getFontScale()` to return an updated value. 1. Render an interface and invoke `PixelRatio.getFontScale()` 2. Change the font scale in Settings > Accessibility > Font Size 3. Return to the React Native app (without reloading Javascript) and invoke `PixelRatio.getFontScale()` again. 4. Verify that the result of `PixelRatio.getFontScale()` has changed to reflect the new font size. For a video of the problem, see the linked issue under the Motivation heading. In this fixed version, the number actually does update as expected. None. This should require no documentation change, as it is behavior that the docs seem to indicate should be happening already. In fact, [the documentation at the bottom of this page](https://facebook.github.io/react-native/docs/native-modules-android.html) appears to already indicate that this should be done for anything implementing LifecycleEventListener. [ANDROID] [BUGFIX] [DeviceInfo] - Fix the DeviceInfoModule to properly respond to LifecycleEvents Closes #17227 Differential Revision: D6692358 Pulled By: hramos fbshipit-source-id: 3db212fe8103c7aa29a29ead6c772abb7ae4cd85
- Loading branch information