Skip to content

Commit

Permalink
For mozilla-mobile#10036 - Workaround for System Theme changes with c…
Browse files Browse the repository at this point in the history
…onfig change
  • Loading branch information
ekager committed Apr 22, 2020
1 parent 1f8b7ff commit 70755ad
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/src/main/java/org/mozilla/fenix/FenixApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -378,4 +378,12 @@ open class FenixApplication : LocaleAwareApplication() {
// This method is not covered by our internal crash reporting: be very careful when modifying it.
StartupTimeline.onApplicationInit() // DO NOT MOVE ANYTHING ABOVE HERE: the timing is critical.
}

override fun onConfigurationChanged(config: android.content.res.Configuration) {
// Workaround for androidx appcompat issue where follow system day/night mode config changes
// are not triggered when also using createConfigurationContext like we do in LocaleManager
// https://issuetracker.google.com/issues/143570309#comment3
applicationContext.resources.configuration.uiMode = config.uiMode
super.onConfigurationChanged(config)
}
}

0 comments on commit 70755ad

Please sign in to comment.