From 2e98f5b32c565dbb8e29f40af4b5b7f2ab978ef0 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Tue, 12 Sep 2017 00:19:46 -0400 Subject: Enhancement/link to autoplay (#271) * Add link to autoplay * Update changelog * Update network strings --- app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt | 12 ++++++++---- .../main/kotlin/com/pitchedapps/frost/settings/Network.kt | 2 +- app/src/main/res/values/strings_pref_feed.xml | 2 ++ app/src/main/res/values/strings_pref_networks.xml | 2 +- app/src/main/res/xml/frost_changelog.xml | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) (limited to 'app') 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 1487c969..cfc2bb6f 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt @@ -7,6 +7,7 @@ import com.pitchedapps.frost.activities.MainActivity import com.pitchedapps.frost.activities.SettingsActivity import com.pitchedapps.frost.enums.FeedSort import com.pitchedapps.frost.utils.Prefs +import com.pitchedapps.frost.utils.launchWebOverlay import com.pitchedapps.frost.utils.materialDialogThemed /** @@ -16,13 +17,11 @@ fun SettingsActivity.getFeedPrefs(): KPrefAdapterBuilder.() -> Unit = { text(R.string.newsfeed_sort, { Prefs.feedSort }, { Prefs.feedSort = it }) { descRes = R.string.newsfeed_sort_desc - onClick = { - _, _, item -> + onClick = { _, _, item -> 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() @@ -35,6 +34,11 @@ fun SettingsActivity.getFeedPrefs(): KPrefAdapterBuilder.() -> Unit = { textGetter = { string(FeedSort(it).textRes) } } + plainText(R.string.autoplay_settings) { + descRes = R.string.autoplay_settings_desc + onClick = { _, _, _ -> launchWebOverlay("https://touch.facebook.com/settings/videos"); true } + } + header(R.string.pro_features) checkbox(R.string.suggested_friends, { Prefs.showSuggestedFriends }, { diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Network.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Network.kt index 30ab2579..b5515a52 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Network.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Network.kt @@ -10,7 +10,7 @@ import com.pitchedapps.frost.utils.Prefs */ fun SettingsActivity.getNetworkPrefs(): KPrefAdapterBuilder.() -> Unit = { - checkbox(R.string.network_media_on_metered, { Prefs.loadMediaOnMeteredNetwork }, { Prefs.loadMediaOnMeteredNetwork = it }) { + checkbox(R.string.network_media_on_metered, { !Prefs.loadMediaOnMeteredNetwork }, { Prefs.loadMediaOnMeteredNetwork = !it }) { descRes = R.string.network_media_on_metered_desc } diff --git a/app/src/main/res/values/strings_pref_feed.xml b/app/src/main/res/values/strings_pref_feed.xml index 8d872add..0bd0792b 100644 --- a/app/src/main/res/values/strings_pref_feed.xml +++ b/app/src/main/res/values/strings_pref_feed.xml @@ -3,6 +3,8 @@ Newsfeed Order Defines the order in which the posts are shown + Video Autoplay Settings + Enable/disable video autoplays on data or at all times.\nThese settings are independent of your settings for desktop. Pro Features Suggested Friends Show "People You May Know" in the feed diff --git a/app/src/main/res/values/strings_pref_networks.xml b/app/src/main/res/values/strings_pref_networks.xml index 29eca24a..f06e86e2 100644 --- a/app/src/main/res/values/strings_pref_networks.xml +++ b/app/src/main/res/values/strings_pref_networks.xml @@ -1,4 +1,4 @@ - Load images on metered network. + Disable images on metered network. If a metered network is detected, Frost will automatically stop all images and videos from loading. \ No newline at end of file diff --git a/app/src/main/res/xml/frost_changelog.xml b/app/src/main/res/xml/frost_changelog.xml index 716c2bbf..21f9f5ec 100644 --- a/app/src/main/res/xml/frost_changelog.xml +++ b/app/src/main/res/xml/frost_changelog.xml @@ -13,7 +13,7 @@ - + -- cgit v1.2.3