diff options
author | Allan Wang <me@allanwang.ca> | 2017-06-23 11:25:45 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-06-23 11:25:45 -0700 |
commit | 9cfccbe6cb3ddbf3fde55184fa484c82ebb4294b (patch) | |
tree | 4cc4fd467cc14ec46f9a38539d413a8a61b35f80 /app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt | |
parent | 7bb1de11f0208ac6b6a9e7d8fd3db81490e18daf (diff) | |
download | frost-9cfccbe6cb3ddbf3fde55184fa484c82ebb4294b.tar.gz frost-9cfccbe6cb3ddbf3fde55184fa484c82ebb4294b.tar.bz2 frost-9cfccbe6cb3ddbf3fde55184fa484c82ebb4294b.zip |
Added custom theming
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt index f6e5f2bf..92e29cb2 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt @@ -11,6 +11,7 @@ import ca.allanwang.kau.kpref.items.KPrefColorPicker import ca.allanwang.kau.utils.* import ca.allanwang.kau.views.RippleCanvas import com.mikepenz.google_material_typeface_library.GoogleMaterial +import com.pitchedapps.frost.injectors.CssAssets import com.pitchedapps.frost.utils.* import com.pitchedapps.frost.views.Keywords @@ -76,13 +77,17 @@ class SettingsActivity : KPrefActivity() { allowCustom = true } - colorPicker(R.string.text_color, { Prefs.customTextColor }, { Prefs.customTextColor = it; reload() }) { + fun invalidateCustomTheme() { + CssAssets.CUSTOM.injector = null + } + + colorPicker(R.string.text_color, { Prefs.customTextColor }, { Prefs.customTextColor = it; reload(); invalidateCustomTheme() }) { dependsOnCustom() allowCustomAlpha = false } colorPicker(R.string.background_color, { Prefs.customBackgroundColor }, - { Prefs.customBackgroundColor = it; bgCanvas.ripple(it, duration = 500L) }) { + { Prefs.customBackgroundColor = it; bgCanvas.ripple(it, duration = 500L); invalidateCustomTheme() }) { dependsOnCustom() allowCustomAlpha = true } |