diff options
author | Allan Wang <me@allanwang.ca> | 2017-10-07 14:46:03 -0400 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-10-07 14:46:03 -0400 |
commit | 5a83083c2053438d55a0aa5b3d36691000843bb3 (patch) | |
tree | 4a4fd659be1541f513df611a369cfffa0f2e5aaa /app/src/main | |
parent | 1d9dd79d427bd260af564a3f4d3bf97da29e311e (diff) | |
download | frost-5a83083c2053438d55a0aa5b3d36691000843bb3.tar.gz frost-5a83083c2053438d55a0aa5b3d36691000843bb3.tar.bz2 frost-5a83083c2053438d55a0aa5b3d36691000843bb3.zip |
Add toggles and injectors
Diffstat (limited to 'app/src/main')
4 files changed, 26 insertions, 0 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 3676d39c..3c7b385d 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt @@ -46,6 +46,13 @@ fun SettingsActivity.getFeedPrefs(): KPrefAdapterBuilder.() -> Unit = { onClick = { _, _, _ -> launchWebOverlay("https://touch.facebook.com/settings/videos"); true } } + checkbox(R.string.composer, { Prefs.showComposer }, { + Prefs.showComposer = it + setFrostResult(MainActivity.REQUEST_REFRESH) + }) { + descRes = R.string.composer_desc + } + header(R.string.pro_features) checkbox(R.string.suggested_friends, { Prefs.showSuggestedFriends }, { @@ -56,6 +63,14 @@ fun SettingsActivity.getFeedPrefs(): KPrefAdapterBuilder.() -> Unit = { dependsOnPro() } + checkbox(R.string.suggested_groups, { Prefs.showSuggestedGroups }, { + Prefs.showSuggestedGroups = it + setFrostResult(MainActivity.REQUEST_REFRESH) + }) { + descRes = R.string.suggested_groups_desc + dependsOnPro() + } + checkbox(R.string.facebook_ads, { Prefs.showFacebookAds }, { Prefs.showFacebookAds = it setFrostResult(MainActivity.REQUEST_REFRESH) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt index 68b4b80d..70144f9e 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt @@ -90,8 +90,12 @@ object Prefs : KPref() { var showRoundedIcons: Boolean by kpref("rounded_icons", true) + var showComposer: Boolean by kpref("status_composer_feed", true) + var showSuggestedFriends: Boolean by kpref("suggested_friends_feed", true) + var showSuggestedGroups: Boolean by kpref("suggested_groups_feed", true) + var showFacebookAds: Boolean by kpref("facebook_ads", true) var animate: Boolean by kpref("fancy_animations", true) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt index 31aaaa6f..3275b2a6 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt @@ -76,7 +76,9 @@ open class FrostWebViewClient(val webCore: FrostWebViewCore) : BaseWebViewClient CssAssets.ROUND_ICONS.maybe(Prefs.showRoundedIcons), CssHider.HEADER, CssHider.CORE, + CssHider.COMPOSER.maybe(!Prefs.showComposer), CssHider.PEOPLE_YOU_MAY_KNOW.maybe(!Prefs.showSuggestedFriends && IS_FROST_PRO), + CssHider.SUGGESTED_GROUPS.maybe(!Prefs.showSuggestedGroups && IS_FROST_PRO), Prefs.themeInjector, CssHider.NON_RECENT.maybe((webCore.url?.contains("?sk=h_chr") ?: false) && Prefs.aggressiveRecents)) diff --git a/app/src/main/res/values/strings_pref_feed.xml b/app/src/main/res/values/strings_pref_feed.xml index 42aefbbc..cc11f850 100644 --- a/app/src/main/res/values/strings_pref_feed.xml +++ b/app/src/main/res/values/strings_pref_feed.xml @@ -7,9 +7,14 @@ <string name="aggressive_recents_desc">Filter out additional old posts from Facebook\'s original most recents feed. Disable this if your feed is empty.</string> <string name="autoplay_settings">Video Autoplay Settings</string> <string name="autoplay_settings_desc">Enable/disable video autoplays on data or at all times.\nThese settings are independent of your settings for desktop.</string> + <string name="composer">Status Composer</string> + <string name="composer_desc">Show status composer in the feed</string> + <string name="pro_features">Pro Features</string> <string name="suggested_friends">Suggested Friends</string> <string name="suggested_friends_desc">Show "People You May Know" in the feed</string> + <string name="suggested_groups">Suggested Groups</string> + <string name="suggested_groups_desc">Show "Suggested Groups" in the feed</string> <string name="facebook_ads">Facebook Ads</string> <string name="facebook_ads_desc">Show native Facebook ads</string> |