diff options
author | Allan Wang <me@allanwang.ca> | 2018-09-27 20:15:11 -0400 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2018-09-27 20:15:11 -0400 |
commit | 2e22f2ae6a963a2e00dc4b50b4a308c80ebe68e2 (patch) | |
tree | b0bfb3d1bede59bc6f54030c3b2ea51b3482ee28 /app/src/main/kotlin/com/pitchedapps/frost/settings | |
parent | 3aa44ba16e52ceaf37dd28a8075b302c42785526 (diff) | |
download | frost-2e22f2ae6a963a2e00dc4b50b4a308c80ebe68e2.tar.gz frost-2e22f2ae6a963a2e00dc4b50b4a308c80ebe68e2.tar.bz2 frost-2e22f2ae6a963a2e00dc4b50b4a308c80ebe68e2.zip |
Fix more lints
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/settings')
3 files changed, 10 insertions, 6 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 314590e2..9253d926 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt @@ -149,7 +149,10 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = { list.add(KPrefTextSeekbar( KPrefSeekbar.KPrefSeekbarBuilder( globalOptions, - R.string.web_text_scaling, Prefs::webTextScaling, { Prefs.webTextScaling = it; setFrostResult(REQUEST_TEXT_ZOOM) }))) + R.string.web_text_scaling, Prefs::webTextScaling) { + Prefs.webTextScaling = it + setFrostResult(REQUEST_TEXT_ZOOM) + })) checkbox(R.string.enforce_black_media_bg, Prefs::blackMediaBg, { Prefs.blackMediaBg = it diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt index 5de68e21..402322ad 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt @@ -20,13 +20,13 @@ fun SettingsActivity.getFeedPrefs(): KPrefAdapterBuilder.() -> Unit = { materialDialogThemed { title(R.string.newsfeed_sort) items(FeedSort.values().map { string(it.textRes) }) - itemsCallbackSingleChoice(item.pref, { _, _, which, _ -> + itemsCallbackSingleChoice(item.pref) { _, _, which, _ -> if (item.pref != which) { item.pref = which shouldRestartMain() } true - }) + } } } textGetter = { string(FeedSort(it).textRes) } 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 962e60ae..83f1f827 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt @@ -36,11 +36,11 @@ fun SettingsActivity.getNotificationPrefs(): KPrefAdapterBuilder.() -> Unit = { materialDialogThemed { title(R.string.notification_frequency) items(texts) - itemsCallbackSingleChoice(options.indexOf(item.pref), { _, _, which, _ -> + itemsCallbackSingleChoice(options.indexOf(item.pref)) { _, _, which, _ -> item.pref = options[which] scheduleNotifications(item.pref) true - }) + } } } enabler = { @@ -155,7 +155,8 @@ fun SettingsActivity.getNotificationPrefs(): KPrefAdapterBuilder.() -> Unit = { plainText(R.string.reset_notif_epoch) { onClick = { loadFbCookiesAsync { - it.map { NotificationModel(it.id) }.forEach { it.save() } + cookies -> + cookies.map { NotificationModel(it.id) }.forEach { it.save() } } } } |