mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook Github Bot
parent
b5080f7d77
commit
27d7d3fed5
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user