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

Merge pull request #1716 from AllanWang/feed-options

This commit is contained in:
Allan Wang 2020-10-03 20:47:36 -07:00 committed by GitHub
commit 019067430f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 46 additions and 13 deletions

View File

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

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

@ -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
* Add option to hide likes and action bar in newsfeed

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>

View File

@ -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)" />

View File

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