diff options
author | Allan Wang <me@allanwang.ca> | 2020-02-23 16:06:45 -0800 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2020-02-23 16:06:45 -0800 |
commit | c8b54fd10a08ed53eb7d21578a4fe990fe14e3bc (patch) | |
tree | 0841d112c8c00504ce10ca72ef39e403b69c595c /app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt | |
parent | 4d5aaf541dbfa7d521ebbc5f011a642c83c4b9c5 (diff) | |
download | frost-c8b54fd10a08ed53eb7d21578a4fe990fe14e3bc.tar.gz frost-c8b54fd10a08ed53eb7d21578a4fe990fe14e3bc.tar.bz2 frost-c8b54fd10a08ed53eb7d21578a4fe990fe14e3bc.zip |
Move prefs to service locator
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt | 30 |
1 files changed, 15 insertions, 15 deletions
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 d1350df5..87fce560 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt @@ -31,7 +31,7 @@ import com.pitchedapps.frost.utils.REQUEST_FAB */ fun SettingsActivity.getFeedPrefs(): KPrefAdapterBuilder.() -> Unit = { - text(R.string.newsfeed_sort, Prefs::feedSort, { Prefs.feedSort = it }) { + text(R.string.newsfeed_sort, prefs::feedSort, { prefs.feedSort = it }) { descRes = R.string.newsfeed_sort_desc onClick = { materialDialog { @@ -50,50 +50,50 @@ fun SettingsActivity.getFeedPrefs(): KPrefAdapterBuilder.() -> Unit = { textGetter = { string(FeedSort(it).textRes) } } - checkbox(R.string.aggressive_recents, Prefs::aggressiveRecents, { - Prefs.aggressiveRecents = it + checkbox(R.string.aggressive_recents, prefs::aggressiveRecents, { + prefs.aggressiveRecents = it shouldRefreshMain() }) { descRes = R.string.aggressive_recents_desc } - checkbox(R.string.composer, Prefs::showComposer, { - Prefs.showComposer = it + checkbox(R.string.composer, prefs::showComposer, { + prefs.showComposer = it 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 + checkbox(R.string.suggested_friends, prefs::showSuggestedFriends, { + prefs.showSuggestedFriends = it shouldRefreshMain() }) { descRes = R.string.suggested_friends_desc } - checkbox(R.string.suggested_groups, Prefs::showSuggestedGroups, { - Prefs.showSuggestedGroups = it + checkbox(R.string.suggested_groups, prefs::showSuggestedGroups, { + prefs.showSuggestedGroups = it shouldRefreshMain() }) { descRes = R.string.suggested_groups_desc } - checkbox(R.string.show_stories, Prefs::showStories, { - Prefs.showStories = it + checkbox(R.string.show_stories, prefs::showStories, { + prefs.showStories = it shouldRefreshMain() }) { descRes = R.string.show_stories_desc } - checkbox(R.string.facebook_ads, Prefs::showFacebookAds, { - Prefs.showFacebookAds = it + checkbox(R.string.facebook_ads, prefs::showFacebookAds, { + prefs.showFacebookAds = it shouldRefreshMain() }) { descRes = R.string.facebook_ads_desc |