Skip to content

Commit

Permalink
feat(Twitter): Added Hide followed by context patch
Browse files Browse the repository at this point in the history
  • Loading branch information
swakwork committed Sep 26, 2024
1 parent 35fc129 commit da6fc21
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
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 @@ -263,6 +263,9 @@ public static boolean enableForcePip() {
public static boolean enableDebugMenu() {
return Utils.getBooleanPerf(Settings.MISC_DEBUG_MENU);
}
public static boolean hideSocialProof() {
return Utils.getBooleanPerf(Settings.MISC_HIDE_SOCIAL_PROOF);
}

private static ArrayList getList(String key){
ArrayList<String> arrayList = new ArrayList<String>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,15 @@ public void buildMiscSection(boolean buildCategory){
);
}


if (SettingsStatus.hideSocialProof) {
addPreference(category,
helper.switchPreference(
strRes("piko_pref_hide_social_proof"),
strRes("piko_pref_hide_social_proof_desc"),
Settings.MISC_HIDE_SOCIAL_PROOF
)
);
}

}

Expand Down Expand Up @@ -493,7 +501,6 @@ public void buildCustomiseSection(boolean buildCategory){
);
}


addPreference(category,
helper.switchPreference(
strRes("piko_pref_quick_settings"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class Settings extends BaseSettings {
public static final BooleanSetting MISC_ROUND_OFF_NUMBERS = new BooleanSetting("misc_round_off_numbers", true);
public static final BooleanSetting MISC_DEBUG_MENU = new BooleanSetting("misc_debug_menu", false);
public static final BooleanSetting MISC_QUICK_SETTINGS_BUTTON = new BooleanSetting("misc_quick_settings_button", false);
public static final BooleanSetting MISC_HIDE_SOCIAL_PROOF = new BooleanSetting("misc_hide_social_proof", false);

public static final BooleanSetting ADS_HIDE_PROMOTED_TRENDS = new BooleanSetting("ads_hide_promoted_trends", true);
public static final BooleanSetting ADS_HIDE_PROMOTED_POSTS = new BooleanSetting("ads_hide_promoted_posts", true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ public class SettingsStatus {
public static boolean deleteFromDb = false;
public static boolean nativeDownloader = false;
public static boolean hideNudgeButton = false;
public static boolean hideSocialProof = false;

public static void hideSocialProof() {
hideSocialProof = true;
}
public static void hideNudgeButton() {
hideNudgeButton = true;
}
Expand Down Expand Up @@ -295,7 +299,7 @@ public static boolean enableTimelineSection() {
}

public static boolean enableMiscSection() {
return (roundOffNumbers || enableFontMod || hideRecommendedUsers || hideFAB || hideViewCount || customSharingDomainEnabled || hideFABBtns);
return ( hideSocialProof || roundOffNumbers || enableFontMod || hideRecommendedUsers || hideFAB || hideViewCount || customSharingDomainEnabled || hideFABBtns);
}

public static boolean enableAdsSection() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public void onCreate(@org.jetbrains.annotations.Nullable Bundle savedInstanceSta
flags.put(strRes("piko_pref_customisation_reply_sorting"),SettingsStatus.defaultReplySortFilter);
flags.put(strEnableRes("piko_pref_force_hd"),SettingsStatus.enableForceHD);
flags.put(strRes("piko_pref_hide_nudge_button"),SettingsStatus.hideNudgeButton);
flags.put(strRes("piko_pref_hide_social_proof"),SettingsStatus.hideSocialProof);

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

Expand Down

0 comments on commit da6fc21

Please sign in to comment.