Skip to content

Commit

Permalink
feat(Reddit): add Hide recommended communities shelf patch inotia00…
Browse files Browse the repository at this point in the history
  • Loading branch information
inotia00 committed Jun 22, 2024
1 parent 71bcece commit 5e78dcf
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package app.revanced.integrations.reddit.patches;

import app.revanced.integrations.reddit.settings.Settings;

@SuppressWarnings("unused")
public final class RecommendedCommunitiesPatch {

public static boolean hideRecommendedCommunitiesShelf() {
return Settings.HIDE_RECOMMENDED_COMMUNITIES_SHELF.get();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class Settings extends BaseSettings {
public static final BooleanSetting HIDE_CREATE_BUTTON = new BooleanSetting("revanced_hide_create_button", FALSE, true);
public static final BooleanSetting HIDE_DISCOVER_BUTTON = new BooleanSetting("revanced_hide_discover_button", FALSE, true);
public static final BooleanSetting HIDE_RECENTLY_VISITED_SHELF = new BooleanSetting("revanced_hide_recently_visited_shelf", FALSE);
public static final BooleanSetting HIDE_RECOMMENDED_COMMUNITIES_SHELF = new BooleanSetting("revanced_hide_recommended_communities_shelf", FALSE, true);
public static final BooleanSetting HIDE_TOOLBAR_BUTTON = new BooleanSetting("revanced_hide_toolbar_button", FALSE, true);
public static final BooleanSetting REMOVE_NSFW_DIALOG = new BooleanSetting("revanced_remove_nsfw_dialog", FALSE, true);
public static final BooleanSetting REMOVE_NOTIFICATION_DIALOG = new BooleanSetting("revanced_remove_notification_dialog", FALSE, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class SettingsStatus {
public static boolean openLinksDirectlyEnabled = false;
public static boolean openLinksExternallyEnabled = false;
public static boolean recentlyVisitedShelfEnabled = false;
public static boolean recommendedCommunitiesShelfEnabled = false;
public static boolean sanitizeUrlQueryEnabled = false;
public static boolean screenshotPopupEnabled = false;
public static boolean subRedditDialogEnabled = false;
Expand All @@ -33,6 +34,10 @@ public static void enableRecentlyVisitedShelf() {
recentlyVisitedShelfEnabled = true;
}

public static void enableRecommendedCommunitiesShelf() {
recommendedCommunitiesShelfEnabled = true;
}

public static void enableSubRedditDialog() {
subRedditDialogEnabled = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ public void addPreferences(Context context) {
Settings.HIDE_RECENTLY_VISITED_SHELF
));
}
if (SettingsStatus.recommendedCommunitiesShelfEnabled) {
addPreference(new TogglePreference(
context,
"Hide recommended communities",
"Hides the recommended communities shelves in subreddits.",
Settings.HIDE_RECOMMENDED_COMMUNITIES_SHELF
));
}
if (SettingsStatus.toolBarButtonEnabled) {
addPreference(new TogglePreference(
context,
Expand Down

0 comments on commit 5e78dcf

Please sign in to comment.