diff options
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/settings')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt | 13 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt | 4 |
2 files changed, 14 insertions, 3 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 e37afc33..7dff5b16 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt @@ -55,7 +55,7 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = { fun KPrefColorPicker.KPrefColorContract.dependsOnCustom() { enabler = { Prefs.isCustomTheme } - onDisabledClick = { itemView, _, _ -> itemView.frostSnackbar(R.string.requires_custom_theme); true } + onDisabledClick = { itemView, _, _ -> frostSnackbar(R.string.requires_custom_theme); true } allowCustom = true } @@ -73,6 +73,17 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = { allowCustomAlpha = false } + colorPicker(R.string.accent_color, { Prefs.customAccentColor }, { + Prefs.customAccentColor = it + reload() + invalidateCustomTheme() + shouldRestartMain() + }) { + dependsOnCustom() + allowCustomAlpha = false + } + + colorPicker(R.string.background_color, { Prefs.customBackgroundColor }, { Prefs.customBackgroundColor = it bgCanvas.ripple(it, duration = 500L) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt index b1e5015f..8fcb3594 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt @@ -2,12 +2,12 @@ package com.pitchedapps.frost.settings import ca.allanwang.kau.kpref.activity.KPrefAdapterBuilder import ca.allanwang.kau.utils.minuteToText -import ca.allanwang.kau.utils.snackbar import com.pitchedapps.frost.R import com.pitchedapps.frost.activities.SettingsActivity import com.pitchedapps.frost.services.fetchNotifications import com.pitchedapps.frost.services.scheduleNotifications import com.pitchedapps.frost.utils.Prefs +import com.pitchedapps.frost.utils.frostSnackbar import com.pitchedapps.frost.utils.materialDialogThemed import com.pitchedapps.frost.views.Keywords @@ -70,7 +70,7 @@ fun SettingsActivity.getNotificationPrefs(): KPrefAdapterBuilder.() -> Unit = { onClick = { _, _, _ -> val text = if (fetchNotifications()) R.string.notification_fetch_success else R.string.notification_fetch_fail - snackbar(text) + frostSnackbar(text) true } } |