diff options
author | Allan Wang <me@allanwang.ca> | 2021-01-12 20:46:02 -0800 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2021-01-12 20:46:02 -0800 |
commit | 0e5c1ab2dd2b574970883576e18f9a119b058788 (patch) | |
tree | ba715d7a5e0537b9598722e203956fb56d3d5c53 /app/src/main/kotlin/com/pitchedapps/frost/injectors | |
parent | 82fa4c5d6c75e245e74d903328b3e5d96b01b5ca (diff) | |
download | frost-0e5c1ab2dd2b574970883576e18f9a119b058788.tar.gz frost-0e5c1ab2dd2b574970883576e18f9a119b058788.tar.bz2 frost-0e5c1ab2dd2b574970883576e18f9a119b058788.zip |
Create themeprovider
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/injectors')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/injectors/ThemeProvider.kt | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/injectors/ThemeProvider.kt b/app/src/main/kotlin/com/pitchedapps/frost/injectors/ThemeProvider.kt index 5a9576d2..23f4b297 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/injectors/ThemeProvider.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/injectors/ThemeProvider.kt @@ -49,33 +49,33 @@ class ThemeProvider(private val context: Context, private val prefs: Prefs) { val textColor: Int get() = theme.textColorGetter(prefs) - val accentColor: Int + val accentColor: Int get() = theme.accentColorGetter(prefs) - val accentColorForWhite: Int + val accentColorForWhite: Int get() = when { accentColor.isColorVisibleOn(Color.WHITE) -> accentColor textColor.isColorVisibleOn(Color.WHITE) -> textColor else -> FACEBOOK_BLUE } - val nativeBgColor: Int + val nativeBgColor: Int get() = bgColor.withAlpha(30) - fun nativeBgColor(unread: Boolean) = bgColor + fun nativeBgColor(unread: Boolean) = bgColor .colorToForeground(if (unread) 0.7f else 0.0f) .withAlpha(30) - val bgColor: Int + val bgColor: Int get() = theme.backgroundColorGetter(prefs) - val headerColor: Int + val headerColor: Int get() = theme.headerColorGetter(prefs) - val iconColor: Int + val iconColor: Int get() = theme.iconColorGetter(prefs) - val isCustomTheme: Boolean + val isCustomTheme: Boolean get() = theme == Theme.CUSTOM /** @@ -91,7 +91,7 @@ class ThemeProvider(private val context: Context, private val prefs: Prefs) { val file = theme.file ?: return JsActions.EMPTY try { var content = - context.assets.open("css/${category.folder}/theme/${file}").bufferedReader() + context.assets.open("css/${category.folder}/themes/$file").bufferedReader() .use(BufferedReader::readText) if (theme == Theme.CUSTOM) { val bt = if (Color.alpha(prefs.bgColor) == 255) @@ -143,4 +143,4 @@ class ThemeProvider(private val context: Context, private val prefs: Prefs) { single { ThemeProvider(get(), get()) } } } -}
\ No newline at end of file +} |