aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin')
-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
4 files changed, 26 insertions, 3 deletions
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,