aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2020-10-03 20:47:36 -0700
committerGitHub <noreply@github.com>2020-10-03 20:47:36 -0700
commit019067430fce1fdd6cc4ff0a4e63937927de2c17 (patch)
tree7e829176cb262d21e286449cb0df4c7145a23f90
parent96812d2b83b81c0f9c48c7812d2600788a21eeec (diff)
parent23b619c5398312f370441acbcb57a7f0627b148d (diff)
downloadfrost-019067430fce1fdd6cc4ff0a4e63937927de2c17.tar.gz
frost-019067430fce1fdd6cc4ff0a4e63937927de2c17.tar.bz2
frost-019067430fce1fdd6cc4ff0a4e63937927de2c17.zip
Merge pull request #1716 from AllanWang/feed-options
-rw-r--r--app/build.gradle12
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt6
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/prefs/sections/FeedPrefs.kt8
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt13
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt2
-rw-r--r--app/src/main/play/en-US/whatsnew6
-rw-r--r--app/src/main/res/values/strings_pref_feed.xml4
-rw-r--r--app/src/main/res/xml/frost_changelog.xml5
-rw-r--r--docs/Changelog.md3
9 files changed, 46 insertions, 13 deletions
diff --git a/app/build.gradle b/app/build.gradle
index c8d46967..daf98d19 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -48,12 +48,12 @@ android {
if (versionName != androidGitVersion.name()) {
throw new GradleException("Version name mismatch, expected ${androidGitVersion.name()}, got $versionName")
}
- multiDexEnabled true
- testInstrumentationRunner "com.pitchedapps.frost.FrostTestRunner"
- javaCompileOptions {
- annotationProcessorOptions {
- arguments = ["room.schemaLocation": "$projectDir/src/schemas".toString()]
- }
+ }
+ multiDexEnabled true
+ testInstrumentationRunner "com.pitchedapps.frost.FrostTestRunner"
+ javaCompileOptions {
+ annotationProcessorOptions {
+ arguments = ["room.schemaLocation": "$projectDir/src/schemas".toString()]
}
}
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt b/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt
index 558017fd..7b400a43 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt
@@ -46,6 +46,12 @@ enum class CssHider(private vararg val items: String) : InjectorContract {
"#MStoriesTray",
// Sub element with just the tray; title is not a part of this
"[data-testid=story_tray]"
+ ),
+ POST_ACTIONS(
+ "footer [data-sigil=\"ufi-inline-actions\"]"
+ ),
+ POST_REACTIONS(
+ "footer [data-sigil=\"reactions-bling-bar\"]"
)
;
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/prefs/sections/FeedPrefs.kt b/app/src/main/kotlin/com/pitchedapps/frost/prefs/sections/FeedPrefs.kt
index 0060f9ad..232a5ca3 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/prefs/sections/FeedPrefs.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/prefs/sections/FeedPrefs.kt
@@ -45,6 +45,10 @@ interface FeedPrefs : PrefsBase {
var mainActivityLayoutType: Int
val mainActivityLayout: MainActivityLayout
+
+ var showPostActions: Boolean
+
+ var showPostReactions: Boolean
}
class FeedPrefsImpl(
@@ -95,4 +99,8 @@ class FeedPrefsImpl(
override val mainActivityLayout: MainActivityLayout
get() = MainActivityLayout(mainActivityLayoutType)
+
+ override var showPostActions: Boolean by kpref("show_post_actions", true)
+
+ override var showPostReactions: Boolean by kpref("show_post_reactions", true)
}
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 22917106..f8d10437 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt
@@ -91,11 +91,18 @@ fun SettingsActivity.getFeedPrefs(): KPrefAdapterBuilder.() -> Unit = {
descRes = R.string.show_stories_desc
}
- checkbox(R.string.facebook_ads, prefs::showFacebookAds, {
- prefs.showFacebookAds = it
+ checkbox(R.string.show_post_actions, prefs::showPostActions, {
+ prefs.showPostActions = it
shouldRefreshMain()
}) {
- descRes = R.string.facebook_ads_desc
+ descRes = R.string.show_post_actions_desc
+ }
+
+ checkbox(R.string.show_post_reactions, prefs::showPostReactions, {
+ prefs.showPostReactions = it
+ shouldRefreshMain()
+ }) {
+ descRes = R.string.show_post_reactions_desc
}
checkbox(R.string.full_size_image, prefs::fullSizeImage, {
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 e2171896..5826f383 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt
@@ -130,6 +130,8 @@ open class FrostWebViewClient(val web: FrostWebView) : BaseWebViewClient() {
prefs.aggressiveRecents
),
CssHider.ADS.maybe(!prefs.showFacebookAds),
+ CssHider.POST_ACTIONS.maybe(!prefs.showPostActions),
+ CssHider.POST_REACTIONS.maybe(!prefs.showPostReactions),
CssSmallAssets.FullSizeImage.maybe(prefs.fullSizeImage),
JsAssets.DOCUMENT_WATCHER,
JsAssets.HORIZONTAL_SCROLLING,
diff --git a/app/src/main/play/en-US/whatsnew b/app/src/main/play/en-US/whatsnew
index 844d7f61..9c5d8706 100644
--- a/app/src/main/play/en-US/whatsnew
+++ b/app/src/main/play/en-US/whatsnew
@@ -1,5 +1,3 @@
-v2.4.5
+v2.4.6
-* Fix url query encoding
-* Add option to make images full screen (settings > news feed)
-* Auto expand text area when typing \ No newline at end of file
+* Add option to hide likes and action bar in newsfeed \ No newline at end of file
diff --git a/app/src/main/res/values/strings_pref_feed.xml b/app/src/main/res/values/strings_pref_feed.xml
index 330c900c..58d832cc 100644
--- a/app/src/main/res/values/strings_pref_feed.xml
+++ b/app/src/main/res/values/strings_pref_feed.xml
@@ -16,6 +16,10 @@
<string name="suggested_groups_desc">Show \"Suggested Groups\" in the feed</string>
<string name="show_stories">Show Stories</string>
<string name="show_stories_desc">Show stories in the feed</string>
+ <string name="show_post_actions">Show Post Actions</string>
+ <string name="show_post_actions_desc">Show Like, Comment, and Share options</string>
+ <string name="show_post_reactions">Show Post Reactions</string>
+ <string name="show_post_reactions_desc">Show reaction counts to post</string>
<string name="facebook_ads">Facebook Ads</string>
<string name="facebook_ads_desc">Show native Facebook ads</string>
<string name="full_size_image">Full Size Images</string>
diff --git a/app/src/main/res/xml/frost_changelog.xml b/app/src/main/res/xml/frost_changelog.xml
index d66a41dd..c380b27a 100644
--- a/app/src/main/res/xml/frost_changelog.xml
+++ b/app/src/main/res/xml/frost_changelog.xml
@@ -6,6 +6,11 @@
<item text="" />
-->
+ <version title="v2.4.6" />
+ <item text="Add option to hide likes and action bar in newsfeed" />
+ <item text="" />
+ <item text="" />
+
<version title="v2.4.5" />
<item text="Fix url query encoding" />
<item text="Add option to make images full screen (settings > news feed)" />
diff --git a/docs/Changelog.md b/docs/Changelog.md
index 6af4b6ac..ac484d96 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -1,5 +1,8 @@
# Changelog
+## v2.4.6
+* Add option to hide likes and action bar in newsfeed
+
## v2.4.5
* Fix url query encoding
* Add option to make images full screen (settings > news feed)