From 1e582a31a92ac299db06f32e34be9f0ae6a5120b Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 4 Aug 2019 23:58:07 -0700 Subject: Add fab auto refresh --- .../com/pitchedapps/frost/settings/Behaviour.kt | 2 +- .../kotlin/com/pitchedapps/frost/settings/Feed.kt | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'app/src/main/kotlin/com/pitchedapps/frost/settings') 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 c774892e..31a31238 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt @@ -40,7 +40,7 @@ fun SettingsActivity.getBehaviourPrefs(): KPrefAdapterBuilder.() -> Unit = { checkbox( R.string.overlay_swipe, Prefs::overlayEnabled, - { Prefs.overlayEnabled = it; setFrostResult(REQUEST_REFRESH) }) { + { Prefs.overlayEnabled = it; shouldRefreshMain() }) { descRes = R.string.overlay_swipe_desc } 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 cf7b3d09..d1350df5 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt @@ -24,7 +24,7 @@ import com.pitchedapps.frost.R import com.pitchedapps.frost.activities.SettingsActivity import com.pitchedapps.frost.enums.FeedSort import com.pitchedapps.frost.utils.Prefs -import com.pitchedapps.frost.utils.REQUEST_REFRESH +import com.pitchedapps.frost.utils.REQUEST_FAB /** * Created by Allan Wang on 2017-06-29. @@ -52,46 +52,49 @@ fun SettingsActivity.getFeedPrefs(): KPrefAdapterBuilder.() -> Unit = { checkbox(R.string.aggressive_recents, Prefs::aggressiveRecents, { Prefs.aggressiveRecents = it - setFrostResult(REQUEST_REFRESH) + shouldRefreshMain() }) { descRes = R.string.aggressive_recents_desc } checkbox(R.string.composer, Prefs::showComposer, { Prefs.showComposer = it - setFrostResult(REQUEST_REFRESH) + shouldRefreshMain() }) { descRes = R.string.composer_desc } - checkbox(R.string.create_fab, Prefs::showCreateFab, { Prefs.showCreateFab = it }) { + checkbox(R.string.create_fab, Prefs::showCreateFab, { + Prefs.showCreateFab = it + setFrostResult(REQUEST_FAB) + }) { descRes = R.string.create_fab_desc } checkbox(R.string.suggested_friends, Prefs::showSuggestedFriends, { Prefs.showSuggestedFriends = it - setFrostResult(REQUEST_REFRESH) + shouldRefreshMain() }) { descRes = R.string.suggested_friends_desc } checkbox(R.string.suggested_groups, Prefs::showSuggestedGroups, { Prefs.showSuggestedGroups = it - setFrostResult(REQUEST_REFRESH) + shouldRefreshMain() }) { descRes = R.string.suggested_groups_desc } checkbox(R.string.show_stories, Prefs::showStories, { Prefs.showStories = it - setFrostResult(REQUEST_REFRESH) + shouldRefreshMain() }) { descRes = R.string.show_stories_desc } checkbox(R.string.facebook_ads, Prefs::showFacebookAds, { Prefs.showFacebookAds = it - setFrostResult(REQUEST_REFRESH) + shouldRefreshMain() }) { descRes = R.string.facebook_ads_desc } -- cgit v1.2.3