Skip to content

Commit

Permalink
feat(Twitter): Added Hide hidden replies patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Swakshan committed May 20, 2024
1 parent 3b474d3 commit 9b9dd0d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
7 changes: 7 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 @@ -161,6 +161,13 @@ public static boolean hideImmersivePlayer() {
return !Utils.getBooleanPerf(Settings.TIMELINE_HIDE_IMMERSIVE_PLAYER);
}

public static boolean hideHiddenReplies(boolean bool){
if(Utils.getBooleanPerf(Settings.TIMELINE_HIDE_HIDDEN_REPLIES)){
return false;
}
return bool;
}

public static boolean hidePromotedTrend(Object data) {
if (data != null && Utils.getBooleanPerf(Settings.ADS_HIDE_PROMOTED_TRENDS)) {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class Settings extends BaseSettings {
public static final BooleanSetting TIMELINE_HIDE_IMMERSIVE_PLAYER = new BooleanSetting("timeline_hide_immersive_player", false);
public static final BooleanSetting TIMELINE_HIDE_PROMOTE_BUTTON = new BooleanSetting("timeline_hide_promote_button", false);
public static final BooleanSetting TIMELINE_HIDE_FORCE_TRANSLATE = new BooleanSetting("timeline_force_translate", false);
public static final BooleanSetting TIMELINE_HIDE_HIDDEN_REPLIES = new BooleanSetting("timeline_hide_hidden_replies", false);

public static final BooleanSetting PREMIUM_READER_MODE = new BooleanSetting("premium_reader_mode", false);
public static final BooleanSetting PREMIUM_UNDO_POSTS = new BooleanSetting("premium_undo_posts", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public void onCreate(@org.jetbrains.annotations.Nullable Bundle savedInstanceSta
flags.put(strRes("piko_pref_customisation_inlinetabs"),SettingsStatus.inlineBarCustomisation);
flags.put(strRes("piko_pref_debug_menu"),SettingsStatus.enableDebugMenu);
flags.put(strRes("piko_pref_hide_premium_prompt"),SettingsStatus.hidePremiumPrompt);
flags.put(strRes("piko_pref_hide_hidden_replies"),SettingsStatus.hideHiddenReplies);

LegacyTwitterPreferenceCategory patPref = preferenceCategory(strRes("piko_pref_patches"), screen);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,15 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
);
}

if (SettingsStatus.hideHiddenReplies) {
timelinePrefs.addPreference(
switchPreference(
strRes("piko_pref_hide_hidden_replies"),
"",
Settings.TIMELINE_HIDE_HIDDEN_REPLIES
)
);
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class SettingsStatus {
public static boolean hideRBMK = false;
public static boolean hideRPinnedPosts = false;
public static boolean hidePremiumPrompt = false;
public static boolean hideHiddenReplies = false;

public static boolean enableReaderMode = false;
public static boolean enableUndoPosts = false;
Expand Down Expand Up @@ -77,6 +78,7 @@ public class SettingsStatus {
public static void hidePremiumPrompt(){ hidePremiumPrompt = true; }
public static void enableShowPollResults() { showPollResultsEnabled = true; }
public static void forceTranslate() { forceTranslate = true; }
public static void hideHiddenReplies() { hideHiddenReplies = true; }
public static void hidePromoteButton() { hidePromoteButton = true; }
public static void enableDebugMenu() { enableDebugMenu = true; }

Expand Down

0 comments on commit 9b9dd0d

Please sign in to comment.