2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-02 03:40:16 +00:00

For #1658 Update preferredColorScheme in onResume for auto-theming

This commit is contained in:
Emily Kager 2019-04-25 14:50:52 -07:00 committed by Emily Kager
parent 47c04de886
commit 9eaaedf4bd

View File

@ -299,6 +299,13 @@ class BrowserFragment : Fragment(), BackHandler, CoroutineScope {
override fun onResume() {
super.onResume()
context?.components?.core?.let {
val preferredColorScheme = it.getPreferredColorScheme()
if (it.engine.settings.preferredColorScheme != preferredColorScheme) {
it.engine.settings.preferredColorScheme = preferredColorScheme
context?.components?.useCases?.sessionUseCases?.reload?.invoke()
}
}
(activity as AppCompatActivity).supportActionBar?.hide()
}