aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/settings
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-08-19 09:47:05 -0700
committerGitHub <noreply@github.com>2017-08-19 09:47:05 -0700
commit84bf883a47b956865d31b1b618d5495fcd7d4876 (patch)
tree0fb0f83af4862a127bca7d8451ef2c7188a08d83 /app/src/main/kotlin/com/pitchedapps/frost/settings
parent5d9a3fd7fb8f2f9d0f592c89446824980c9841c6 (diff)
downloadfrost-1.4.7.tar.gz
frost-1.4.7.tar.bz2
frost-1.4.7.zip
v1.4.7 (#195)v1.4.7
* Add try catch (#179) * Add checks before injections (#180) * Enhancement/url redirect manager (#182) * Initial blacklist * Move js checks to java * Optimize imports and clean up request interceptor * Misc (#190) * Update play store description * Finalize description * Update kotlin and bg2 for custom themes * Update to Android Studio 3.0 beta 2 * Update test dependencies and add logging to image activity * Rename throwable to errorRef * Update searchview and media picker through kau * Update themes (#183) * Theme content now found view * Update verified bg and bg2 for transparent themes * Fix check in star text * Various fixes * Create base svg sass images * Feature/theme accent (#192) * Add lots of theming components * Optimize and add * Update accents * Misc 2 (#191) * Add further checks for iab and remove generic error dialog * Theme all snackbars * Add dynamic media action tile * Enhancement/media-camera-picker (#194) * Update kau * Update changelog
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/settings')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt13
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt4
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
}
}