Skip to content

Commit

Permalink
fix: theme switch glitch on new arch android
Browse files Browse the repository at this point in the history
  • Loading branch information
vonovak committed Aug 14, 2024
1 parent 7469d3a commit 6f24384
Show file tree
Hide file tree
Showing 9 changed files with 2,172 additions and 592 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ class ThemeControlModule(reactContext: ReactApplicationContext?) :
persistTheme(mode)
}

UiThreadUtil.runOnUiThread { setMode(mode, restartActivity) }
promise.resolve(null)
UiThreadUtil.runOnUiThread {
setMode(mode, restartActivity)
promise.resolve(null)
}
}

private fun setMode(mode: Int, restartActivity: Boolean) {
Expand Down
4 changes: 2 additions & 2 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
# Note that this is incompatible with web debugging.
newArchEnabled=false
bridgelessEnabled=false
newArchEnabled=true
bridgelessEnabled=true

# Uncomment the line below to build React Native from source.
#react.buildFromSource=true
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ require "#{ws_dir}/node_modules/react-native-test-app/test_app.rb"
workspace 'theme-control-example.xcworkspace'

options = {
:bridgeless_enabled => false,
:fabric_enabled => false,
:bridgeless_enabled => true,
:fabric_enabled => true,
:hermes_enabled => true,
}

Expand Down
Loading

0 comments on commit 6f24384

Please sign in to comment.