1
0
mirror of https://github.com/AllanWang/Frost-for-Facebook.git synced 2024-11-08 20:12:39 +01:00

Add option to hide feed likes and bottom bar

This commit is contained in:
Allan Wang 2020-09-27 20:09:52 -07:00
parent 983a3dfa74
commit 8a8e7268a5
No known key found for this signature in database
GPG Key ID: C93E3F9C679D7A56
5 changed files with 30 additions and 3 deletions

View File

@ -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\"]"
)
;

View File

@ -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)
}

View File

@ -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, {

View File

@ -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,

View File

@ -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>