Merge pull request #2156 from omnivore-app/fix/android-0.6-updates

Android 0.60 updates
This commit is contained in:
Jackson Harper 2023-05-03 10:52:48 +08:00 committed by GitHub
commit 381293e0b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 16 additions and 10 deletions

View file

@ -17,8 +17,8 @@ android {
applicationId "app.omnivore.omnivore"
minSdk 26
targetSdk 33
versionCode 52
versionName "0.0.52"
versionCode 60
versionName "0.0.60"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {

File diff suppressed because one or more lines are too long

View file

@ -189,7 +189,7 @@ fun LabelsSelectionSheetContent(
Text(titleText, fontWeight = FontWeight.ExtraBold)
TextButton(onClick = { onSave(selectedLabels.value) }) {
Text(text = "Save")
Text(text = if (isLibraryMode) "Search" else "Save")
}
}
LazyColumn(

View file

@ -15,6 +15,9 @@ enum class WebFont(val displayText: String, val rawValue: String) {
ROBOTO("Roboto", "Roboto"),
CRIMSON_TEXT("Crimson Text", "Crimson Text"),
SOURCE_SERIF_PRO("Source Serif Pro", "Source Serif Pro"),
NEWSREADER("Newsreader", "Newsreader"),
LXGWWENKAI("LXGW WenKai", "LXGWWenKai"),
ATKINSON_HYPERLEGIBLE("Atkinson Hyperlegible", "AtkinsonHyperlegible"),
}
enum class ArticleContentStatus(val rawValue: String) {

View file

@ -263,7 +263,7 @@ class WebReaderViewModel @Inject constructor(
val storedFontFamily = datastoreRepo.getString(DatastoreKeys.preferredWebFontFamily) ?: WebFont.SYSTEM.rawValue
val storedThemePreference = datastoreRepo.getString(DatastoreKeys.preferredTheme) ?: "System"
val storedWebFont = WebFont.values().first { it.rawValue == storedFontFamily }
val storedWebFont = WebFont.values().firstOrNull { it.rawValue == storedFontFamily } ?: WebFont.values().first()
val prefersHighContrastFont = datastoreRepo.getString(DatastoreKeys.prefersWebHighContrastText) == "true"
val prefersJustifyText = datastoreRepo.getString(DatastoreKeys.prefersJustifyText) == "true"
@ -290,13 +290,13 @@ class WebReaderViewModel @Inject constructor(
fun updateStoredThemePreference(index: Int, isDarkMode: Boolean) {
val newThemeKey = themeKey(isDarkMode, systemThemeKeys[index])
Log.d("theme", "Setting theme key: ${newThemeKey}")
runBlocking {
datastoreRepo.putString(DatastoreKeys.preferredTheme, systemThemeKeys[index])
}
val isDark = newThemeKey == "Dark" || newThemeKey == "Black"
val script = "var event = new Event('updateColorMode');event.isDark = '$isDark';document.dispatchEvent(event);"
val script = "var event = new Event('updateTheme');event.themeName = '$newThemeKey';document.dispatchEvent(event);"
enqueueScript(script)
}

File diff suppressed because one or more lines are too long

View file

@ -288,6 +288,9 @@ const blackThemeSpec = {
}
const sepiaThemeSpec = {
colorScheme: {
colorScheme: 'light',
},
colors: {
readerBg: '#FBF0D9',
readerFont: '#5F4B32',

View file

@ -44,7 +44,7 @@ export function updateThemeLocally(themeId: string): void {
window.localStorage.setItem(themeKey, themeId)
}
document.body.classList.remove(
document.documentElement.classList.remove(
...Object.keys(LEGACY_THEMES),
sepiaTheme,
darkTheme,
@ -52,7 +52,7 @@ export function updateThemeLocally(themeId: string): void {
blackTheme,
...Object.keys(ThemeId)
)
document.body.classList.add(getTheme(themeId))
document.documentElement.classList.add(getTheme(themeId))
}
export function currentThemeName(): string {