aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt17
1 files changed, 10 insertions, 7 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 382b2dad..2c229830 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt
@@ -23,7 +23,7 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = {
header(R.string.theme_customization)
text(R.string.theme, { Prefs.theme }, { Prefs.theme = it }) {
- onClick = { _, _, item ->
+ onClick = {
materialDialogThemed {
title(R.string.theme)
items(Theme.values()
@@ -46,7 +46,6 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = {
true
}
}
- true
}
textGetter = {
string(Theme(it).textRes)
@@ -55,12 +54,12 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = {
fun KPrefColorPicker.KPrefColorContract.dependsOnCustom() {
enabler = { Prefs.isCustomTheme }
- onDisabledClick = { _, _, _ -> frostSnackbar(R.string.requires_custom_theme); true }
+ onDisabledClick = { frostSnackbar(R.string.requires_custom_theme) }
allowCustom = true
}
fun invalidateCustomTheme() {
- CssAssets.CUSTOM.injector = null
+ CssAssets.CUSTOM.injector.invalidate()
}
colorPicker(R.string.text_color, { Prefs.customTextColor }, {
@@ -119,9 +118,9 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = {
text(R.string.main_activity_layout, { Prefs.mainActivityLayoutType }, { Prefs.mainActivityLayoutType = it }) {
textGetter = { string(Prefs.mainActivityLayout.titleRes) }
- onClick = { _, _, item ->
+ onClick = {
materialDialogThemed {
- title(R.string.set_main_activity_layout)
+ title(R.string.main_activity_layout_desc)
items(MainActivityLayout.values.map { string(it.titleRes) })
itemsCallbackSingleChoice(item.pref) { _, _, which, _ ->
if (item.pref != which) {
@@ -132,10 +131,14 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = {
true
}
}
- true
}
}
+ plainText(R.string.main_tabs) {
+ descRes = R.string.main_tabs_desc
+ onClick = { launchTabCustomizerActivity() }
+ }
+
checkbox(R.string.rounded_icons, { Prefs.showRoundedIcons }, {
Prefs.showRoundedIcons = it
setFrostResult(MainActivity.REQUEST_REFRESH)