aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/settings
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2021-01-12 21:15:08 -0800
committerAllan Wang <me@allanwang.ca>2021-01-12 21:15:08 -0800
commite01e51574613459a036c1d60383bfb229799a407 (patch)
tree4214c9803638fcc1b9d9e19159651f7115c846c4 /app/src/main/kotlin/com/pitchedapps/frost/settings
parent0e5c1ab2dd2b574970883576e18f9a119b058788 (diff)
downloadfrost-e01e51574613459a036c1d60383bfb229799a407.tar.gz
frost-e01e51574613459a036c1d60383bfb229799a407.tar.bz2
frost-e01e51574613459a036c1d60383bfb229799a407.zip
Convert all theme access to themeprovider
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/settings')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt
index 4de93a36..64d9dba2 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt
@@ -43,7 +43,7 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = {
header(R.string.theme_customization)
- text(R.string.theme, prefs::theme, { prefs.theme = it; themeProvider.setTheme(it) }) {
+ text(R.string.theme, prefs::theme, { prefs.theme = it }) {
onClick = {
materialDialog {
title(R.string.theme)
@@ -55,7 +55,7 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = {
item.pref = index
shouldRestartMain()
reload()
- setFrostTheme(prefs, true)
+ setFrostTheme(themeProvider, true)
themeExterior()
invalidateOptionsMenu()
frostEvent("Theme", "Count" to Theme(index).name)
@@ -69,7 +69,7 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = {
}
fun KPrefColorPicker.KPrefColorContract.dependsOnCustom() {
- enabler = prefs::isCustomTheme
+ enabler = themeProvider::isCustomTheme
onDisabledClick = { frostSnackbar(R.string.requires_custom_theme) }
allowCustom = true
}
@@ -102,7 +102,7 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = {
prefs.customBackgroundColor = it
bgCanvas.ripple(it, duration = 500L)
invalidateCustomTheme()
- setFrostTheme(prefs, true)
+ setFrostTheme(themeProvider, true)
shouldRestartMain()
}) {
dependsOnCustom()
@@ -111,7 +111,7 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = {
colorPicker(R.string.header_color, prefs::customHeaderColor, {
prefs.customHeaderColor = it
- frostNavigationBar(prefs)
+ frostNavigationBar(prefs, themeProvider)
toolbarCanvas.ripple(it, RippleCanvas.MIDDLE, RippleCanvas.END, duration = 500L)
reload()
shouldRestartMain()
@@ -160,7 +160,7 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = {
checkbox(R.string.tint_nav, prefs::tintNavBar, {
prefs.tintNavBar = it
- frostNavigationBar(prefs)
+ frostNavigationBar(prefs, themeProvider)
setFrostResult(REQUEST_NAV)
}) {
descRes = R.string.tint_nav_desc