aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2020-02-23 17:50:22 -0800
committerGitHub <noreply@github.com>2020-02-23 17:50:22 -0800
commit654cc6b943177120dc1a0a22a0d68d5cbfde2b5e (patch)
tree3bba2feb0cf99ae222693a4d564d9acf624322e2 /app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt
parent4d5aaf541dbfa7d521ebbc5f011a642c83c4b9c5 (diff)
parent1686de0d71d687990ca6f0d4b621bc4d52dee146 (diff)
downloadfrost-654cc6b943177120dc1a0a22a0d68d5cbfde2b5e.tar.gz
frost-654cc6b943177120dc1a0a22a0d68d5cbfde2b5e.tar.bz2
frost-654cc6b943177120dc1a0a22a0d68d5cbfde2b5e.zip
Merge pull request #1647 from AllanWang/kpref
Remove stateful singletons
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt29
1 files changed, 14 insertions, 15 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt
index 8f57b539..f6110756 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt
@@ -19,54 +19,53 @@ package com.pitchedapps.frost.settings
import ca.allanwang.kau.kpref.activity.KPrefAdapterBuilder
import com.pitchedapps.frost.R
import com.pitchedapps.frost.activities.SettingsActivity
-import com.pitchedapps.frost.utils.Prefs
/**
* Created by Allan Wang on 2017-06-30.
*/
fun SettingsActivity.getBehaviourPrefs(): KPrefAdapterBuilder.() -> Unit = {
- checkbox(R.string.auto_refresh_feed, Prefs::autoRefreshFeed, { Prefs.autoRefreshFeed = it }) {
+ checkbox(R.string.auto_refresh_feed, prefs::autoRefreshFeed, { prefs.autoRefreshFeed = it }) {
descRes = R.string.auto_refresh_feed_desc
}
- checkbox(R.string.fancy_animations, Prefs::animate, { Prefs.animate = it; animate = it }) {
+ checkbox(R.string.fancy_animations, prefs::animate, { prefs.animate = it; animate = it }) {
descRes = R.string.fancy_animations_desc
}
checkbox(
R.string.overlay_swipe,
- Prefs::overlayEnabled,
- { Prefs.overlayEnabled = it; shouldRefreshMain() }) {
+ prefs::overlayEnabled,
+ { prefs.overlayEnabled = it; shouldRefreshMain() }) {
descRes = R.string.overlay_swipe_desc
}
checkbox(
R.string.overlay_full_screen_swipe,
- Prefs::overlayFullScreenSwipe,
- { Prefs.overlayFullScreenSwipe = it }) {
+ prefs::overlayFullScreenSwipe,
+ { prefs.overlayFullScreenSwipe = it }) {
descRes = R.string.overlay_full_screen_swipe_desc
}
checkbox(
R.string.open_links_in_default,
- Prefs::linksInDefaultApp,
- { Prefs.linksInDefaultApp = it }) {
+ prefs::linksInDefaultApp,
+ { prefs.linksInDefaultApp = it }) {
descRes = R.string.open_links_in_default_desc
}
- checkbox(R.string.viewpager_swipe, Prefs::viewpagerSwipe, { Prefs.viewpagerSwipe = it }) {
+ checkbox(R.string.viewpager_swipe, prefs::viewpagerSwipe, { prefs.viewpagerSwipe = it }) {
descRes = R.string.viewpager_swipe_desc
}
checkbox(
R.string.force_message_bottom,
- Prefs::messageScrollToBottom,
- { Prefs.messageScrollToBottom = it }) {
+ prefs::messageScrollToBottom,
+ { prefs.messageScrollToBottom = it }) {
descRes = R.string.force_message_bottom_desc
}
- checkbox(R.string.enable_pip, Prefs::enablePip, { Prefs.enablePip = it }) {
+ checkbox(R.string.enable_pip, prefs::enablePip, { prefs.enablePip = it }) {
descRes = R.string.enable_pip_desc
}
@@ -78,11 +77,11 @@ fun SettingsActivity.getBehaviourPrefs(): KPrefAdapterBuilder.() -> Unit = {
// }
// }
- checkbox(R.string.exit_confirmation, Prefs::exitConfirmation, { Prefs.exitConfirmation = it }) {
+ checkbox(R.string.exit_confirmation, prefs::exitConfirmation, { prefs.exitConfirmation = it }) {
descRes = R.string.exit_confirmation_desc
}
- checkbox(R.string.analytics, Prefs::analytics, { Prefs.analytics = it }) {
+ checkbox(R.string.analytics, prefs::analytics, { prefs.analytics = it }) {
descRes = R.string.analytics_desc
}
}