Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Merge branch dev to main #11

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/src/main/java/app/revanced/integrations/twitter/Pref.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public static boolean hideCTJ() {
public static boolean hideRBMK() {
return Utils.getBooleanPerf(Settings.ADS_HIDE_REVISIT_BMK);
}
public static boolean hideRPinnedPosts() {
return Utils.getBooleanPerf(Settings.ADS_HIDE_REVISIT_PINNED_POSTS);
}
public static boolean hideDetailedPosts() {
return Utils.getBooleanPerf(Settings.ADS_HIDE_DETAILED_POSTS);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


public class TimelineEntry {
private static boolean hideAds,hideGAds,hideWTF,hideCTS,hideCTJ,hideDetailedPosts,hideRBMK;
private static boolean hideAds,hideGAds,hideWTF,hideCTS,hideCTJ,hideDetailedPosts,hideRBMK,hidePinnedPosts;
static {
SettingsStatus.load();
hideAds = (Pref.hideAds() && SettingsStatus.hideAds);
Expand All @@ -18,6 +18,7 @@ public class TimelineEntry {
hideCTJ = (Pref.hideCTJ() && SettingsStatus.hideCTJ);
hideDetailedPosts = (Pref.hideDetailedPosts() && SettingsStatus.hideDetailedPosts);
hideRBMK = (Pref.hideRBMK() && SettingsStatus.hideRBMK);
hidePinnedPosts = (Pref.hideRPinnedPosts() && SettingsStatus.hideRPinnedPosts);
}


Expand Down Expand Up @@ -48,6 +49,9 @@ private static boolean isEntryIdRemove(String entryId) {
if (entryId.startsWith("who-to-subscribe") && hideCTS) {
return true;
}
if (entryId.startsWith("pinned-tweets") && hidePinnedPosts) {
return true;
}
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class Settings extends BaseSettings {
public static final BooleanSetting ADS_HIDE_CREATORS_TO_SUB = new BooleanSetting("ads_hide_creators_to_sub", true);
public static final BooleanSetting ADS_HIDE_COMM_TO_JOIN = new BooleanSetting("ads_hide_comm_to_join", true);
public static final BooleanSetting ADS_HIDE_REVISIT_BMK = new BooleanSetting("ads_hide_revisit_bookmark", true);
public static final BooleanSetting ADS_HIDE_REVISIT_PINNED_POSTS = new BooleanSetting("ads_hide_revisit_pinned_posts", true);
public static final BooleanSetting ADS_HIDE_DETAILED_POSTS = new BooleanSetting("ads_hide_detailed_posts", true);

public static final BooleanSetting TIMELINE_HIDE_LIVETHREADS = new BooleanSetting("timeline_hide_livethreads", true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
);
}

if (SettingsStatus.hideRPinnedPosts) {
adsPrefs.addPreference(
switchPreference(
"Hide \"Pinned posts by followers\" section",
"",
Settings.ADS_HIDE_REVISIT_PINNED_POSTS
)
);
}

if (SettingsStatus.hideDetailedPosts) {
adsPrefs.addPreference(
switchPreference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class SettingsStatus {
public static boolean hideCTJ = false;
public static boolean hideDetailedPosts = false;
public static boolean hideRBMK = false;
public static boolean hideRPinnedPosts = false;


public static void enableDownloadFolder() { changeDownloadEnabled = true; }
Expand All @@ -39,6 +40,7 @@ public class SettingsStatus {
public static void hideCommToJoin() { hideCTJ = true; }
public static void hideDetailedPost() { hideDetailedPosts = true; }
public static void hideRevistBookmark() { hideRBMK = true; }
public static void hideRevistPinnedPost() { hideRPinnedPosts = true; }
public static void hidePromotedTrends() { hidePromotedTrend = true; }

public static boolean enableTimelineSection(){ return (hideLiveThreads || hideBanner || hideForyou); }
Expand Down
Loading