diff options
author | Allan Wang <me@allanwang.ca> | 2017-12-11 17:52:24 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-11 17:52:24 -0500 |
commit | db262e95779e0a17275bdb94be2b0ac12819178e (patch) | |
tree | 42b89edf8796e85e362ca86dead1170cb38f6434 /app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt | |
parent | 1d4380cee77fc049a54d280a27dcefa3fa6ff1fd (diff) | |
download | frost-db262e95779e0a17275bdb94be2b0ac12819178e.tar.gz frost-db262e95779e0a17275bdb94be2b0ac12819178e.tar.bz2 frost-db262e95779e0a17275bdb94be2b0ac12819178e.zip |
Feature/tab customization (#522)
* Add initial tab customizing view
* Add rest of content for now
* Delete project file backups
* Stash
* Support full tab customization
* Test activity animations
* Update kau and fix sound uri
* Try catch download, resolves #523
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.kt | 17 |
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) |