update android AppearanceModule to support dark mode in all OS versions

Summary:
We no longer need to gate by OS version since we want to allow in-app theming. This diff ensures that we are passing in the updated system context to retrieve the correct app theme.

Changelog:
[Android] Enable AppearanceModule for all OS versions

Reviewed By: mdvacca

Differential Revision: D18224915

fbshipit-source-id: 42d5db8497d8bead32c49e3e2a25d4ba779e2b33
This commit is contained in:
Elisa Lou
2019-10-31 10:05:38 -07:00
committed by Facebook Github Bot
parent b5080f7d77
commit 27d7d3fed5
2 changed files with 16 additions and 18 deletions
@@ -727,12 +727,14 @@ public class ReactInstanceManager {
/** Call this from {@link Activity#onConfigurationChanged()}. */
@ThreadConfined(UI)
public void onConfigurationChanged(@Nullable Configuration newConfig) {
public void onConfigurationChanged(Context updatedContext, @Nullable Configuration newConfig) {
UiThreadUtil.assertOnUiThread();
ReactContext currentContext = getCurrentReactContext();
if (currentContext != null) {
currentContext.getNativeModule(AppearanceModule.class).onConfigurationChanged();
ReactContext currentReactContext = getCurrentReactContext();
if (currentReactContext != null) {
currentReactContext
.getNativeModule(AppearanceModule.class)
.onConfigurationChanged(updatedContext);
}
}