mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Use Black as the themeKey for system dark mode on Android
This commit is contained in:
parent
29da91e760
commit
e9ae10afb7
2 changed files with 5 additions and 4 deletions
|
|
@ -47,7 +47,7 @@ fun WebReader(
|
|||
)
|
||||
|
||||
val styledContent = webReaderContent.styledContent()
|
||||
val isInDarkMode = preferences.themeKey == "Dark"
|
||||
val isInDarkMode = preferences.themeKey == "Dark" || preferences.themeKey == "Black"
|
||||
|
||||
Box {
|
||||
AndroidView(factory = {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,8 @@ class WebReaderViewModel @Inject constructor(
|
|||
val showLabelsSelectionSheetLiveData = MutableLiveData(false)
|
||||
val savedItemLabelsLiveData = dataService.db.savedItemLabelDao().getSavedItemLabelsLiveData()
|
||||
|
||||
val systemThemeKeys = listOf("Light", "Dark", "System")
|
||||
// "Sepia", "Apollo",
|
||||
val systemThemeKeys = listOf("Light", "Black", "System")
|
||||
|
||||
var hasTappedExistingHighlight = false
|
||||
var lastTapCoordinates: TapCoordinates? = null
|
||||
|
|
@ -279,7 +280,7 @@ class WebReaderViewModel @Inject constructor(
|
|||
|
||||
fun themeKey(isDarkMode: Boolean, storedThemePreference: String): String {
|
||||
if (storedThemePreference == "System") {
|
||||
return if (isDarkMode) "Dark" else "Light"
|
||||
return if (isDarkMode) "Black" else "Light"
|
||||
}
|
||||
|
||||
return storedThemePreference
|
||||
|
|
@ -292,7 +293,7 @@ class WebReaderViewModel @Inject constructor(
|
|||
datastoreRepo.putString(DatastoreKeys.preferredTheme, systemThemeKeys[index])
|
||||
}
|
||||
|
||||
val isDark = newThemeKey == "Dark"
|
||||
val isDark = newThemeKey == "Dark" || newThemeKey == "Black"
|
||||
val script = "var event = new Event('updateColorMode');event.isDark = '$isDark';document.dispatchEvent(event);"
|
||||
enqueueScript(script)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue