Skip to content

Commit

Permalink
Merge pull request #51 from crimera/dev
Browse files Browse the repository at this point in the history
chore: Merge branch `dev` to `main`
  • Loading branch information
crimera authored May 18, 2024
2 parents b04f009 + 2a84917 commit 70d8b8c
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 52 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## [1.18.1-dev.1](https://github.com/crimera/revanced-integrations/compare/v1.18.0...v1.18.1-dev.1) (2024-05-16)


### Refactors

* **Twitter:** Separated `App icon` and `Navigation icon` patch ([4068a66](https://github.com/crimera/revanced-integrations/commit/4068a66899a508c0e66670a0aa581ea2a75b3da7))
* **Twitter:** Sorted about fragment ([2e7f94d](https://github.com/crimera/revanced-integrations/commit/2e7f94dcff46707d529d01c02aebfd63b488d824))

## [1.18.0](https://github.com/crimera/revanced-integrations/compare/v1.17.0...v1.18.0) (2024-05-15)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class Settings extends BaseSettings {

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);
public static final StringSetting PREMIUM_ICONS = new StringSetting("premium_app_icon_n_nav_icon", "");
public static final StringSetting PREMIUM_ICONS = new StringSetting("premium_app_icon", "");

public static final StringSetting CUSTOM_PROFILE_TABS = new StringSetting("customisation_profile_tabs", "");
public static final StringSetting CUSTOM_TIMELINE_TABS = new StringSetting("customisation_timeline_tabs", "show_both");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,55 +53,56 @@ public void onCreate(@org.jetbrains.annotations.Nullable Bundle savedInstanceSta
)
);

LegacyTwitterPreferenceCategory patPref = preferenceCategory(strRes("piko_pref_patches"), screen);
TreeMap<String,Boolean> flags = new TreeMap();
flags.put(strRes("piko_pref_video_download"),SettingsStatus.enableVidDownload);
flags.put(strRes("piko_pref_reader_mode"),SettingsStatus.enableReaderMode);
flags.put(strRes("app_icon"),SettingsStatus.customAppIcon);
flags.put(strRes("custom_navigation"),SettingsStatus.navBarCustomisation);
flags.put(strRes("piko_pref_download"),SettingsStatus.changeDownloadEnabled);
flags.put(strRes("piko_pref_download_media_link_handle"),SettingsStatus.mediaLinkHandle);
flags.put(strRes("piko_pref_hide_promoted_posts"),SettingsStatus.hideAds);
flags.put(strRes("piko_pref_hide_g_ads"),SettingsStatus.hideGAds);
flags.put(strRes("piko_pref_wtf_section"),SettingsStatus.hideWTF);
flags.put(strRes("piko_pref_cts_section"),SettingsStatus.hideCTS);
flags.put(strRes("piko_pref_ctj_section"),SettingsStatus.hideCTJ);
flags.put(strRes("piko_pref_ryb_section"),SettingsStatus.hideRBMK);
flags.put(strRes("piko_pref_pinned_posts_section"),SettingsStatus.hideRPinnedPosts);
flags.put(strRes("piko_pref_hide_detailed_posts"),SettingsStatus.hideDetailedPosts);
flags.put(strRes("piko_pref_hide_trends"),SettingsStatus.hidePromotedTrend);
flags.put(strRes("piko_pref_chirp_font"),SettingsStatus.enableFontMod);
flags.put(strRes("piko_pref_hide_fab"),SettingsStatus.hideFAB);
flags.put(strRes("piko_pref_hide_fab_menu"),SettingsStatus.hideFABBtns);
flags.put(strRes("piko_pref_show_sensitive_media"),SettingsStatus.showSensitiveMedia);
flags.put(strRes("piko_pref_selectable_text"),SettingsStatus.selectableText);
flags.put(strRes("piko_pref_rec_users"),SettingsStatus.hideRecommendedUsers);
flags.put(strRes("piko_pref_browser_chooser"),SettingsStatus.browserChooserEnabled);
flags.put(strRes("piko_pref_custom_share_domain"),SettingsStatus.customSharingDomainEnabled);
flags.put(strRes("piko_pref_feature_flags"),SettingsStatus.featureFlagsEnabled);
flags.put(strRes("piko_pref_customisation_profiletabs"),SettingsStatus.profileTabCustomisation);
flags.put(strRes("piko_pref_customisation_timelinetabs"),SettingsStatus.timelineTabCustomisation);
flags.put(strRes("piko_pref_customisation_navbartabs"),SettingsStatus.navBarCustomisation);
flags.put(strRes("piko_pref_customisation_sidebartabs"),SettingsStatus.sideBarCustomisation);
flags.put(strRes("piko_pref_disable_auto_timeline_scroll"),SettingsStatus.disableAutoTimelineScroll);
flags.put(strRes("piko_pref_hide_live_threads"),SettingsStatus.hideLiveThreads);
flags.put(strRes("piko_pref_hide_banner"),SettingsStatus.hideBanner);
flags.put(strRes("piko_pref_hide_bmk_timeline"),SettingsStatus.hideInlineBmk);
flags.put(strRes("piko_pref_show_poll_result"),SettingsStatus.showPollResultsEnabled);
flags.put(strRes("piko_pref_comm_notes"),SettingsStatus.hideCommunityNote);
flags.put(strRes("piko_pref_hide_quick_promote"),SettingsStatus.hidePromoteButton);
flags.put(strRes("piko_pref_hide_immersive_player"),SettingsStatus.hideImmersivePlayer);
flags.put(strRes("piko_pref_clear_tracking_params"),SettingsStatus.cleartrackingparams);
flags.put(strRes("piko_pref_unshorten_link"),SettingsStatus.unshortenlink);
flags.put(strRes("piko_pref_force_translate"),SettingsStatus.forceTranslate);

Map<String,Boolean> flags = new HashMap();
flags.put("piko_pref_video_download",SettingsStatus.enableVidDownload);
flags.put("piko_pref_reader_mode",SettingsStatus.enableReaderMode);
flags.put("piko_pref_icon_n_navbar_btn",SettingsStatus.enableAppIconNNavIcon);
flags.put("piko_pref_download",SettingsStatus.changeDownloadEnabled);
flags.put("piko_pref_download_media_link_handle",SettingsStatus.mediaLinkHandle);
flags.put("piko_pref_hide_promoted_posts",SettingsStatus.hideAds);
flags.put("piko_pref_hide_g_ads",SettingsStatus.hideGAds);
flags.put("piko_pref_wtf_section",SettingsStatus.hideWTF);
flags.put("piko_pref_cts_section",SettingsStatus.hideCTS);
flags.put("piko_pref_ctj_section",SettingsStatus.hideCTJ);
flags.put("piko_pref_ryb_section",SettingsStatus.hideRBMK);
flags.put("piko_pref_pinned_posts_section",SettingsStatus.hideRPinnedPosts);
flags.put("piko_pref_hide_detailed_posts",SettingsStatus.hideDetailedPosts);
flags.put("piko_pref_hide_trends",SettingsStatus.hidePromotedTrend);
flags.put("piko_pref_chirp_font",SettingsStatus.enableFontMod);
flags.put("piko_pref_hide_fab",SettingsStatus.hideFAB);
flags.put("piko_pref_hide_fab_menu",SettingsStatus.hideFABBtns);
flags.put("piko_pref_show_sensitive_media",SettingsStatus.showSensitiveMedia);
flags.put("piko_pref_selectable_text",SettingsStatus.selectableText);
flags.put("piko_pref_rec_users",SettingsStatus.hideRecommendedUsers);
flags.put("piko_pref_browser_chooser",SettingsStatus.browserChooserEnabled);
flags.put("piko_pref_custom_share_domain",SettingsStatus.customSharingDomainEnabled);
flags.put("piko_pref_feature_flags",SettingsStatus.featureFlagsEnabled);
flags.put("piko_pref_customisation_profiletabs",SettingsStatus.profileTabCustomisation);
flags.put("piko_pref_customisation_timelinetabs",SettingsStatus.timelineTabCustomisation);
flags.put("piko_pref_customisation_navbartabs",SettingsStatus.navBarCustomisation);
flags.put("piko_pref_customisation_sidebartabs",SettingsStatus.sideBarCustomisation);
flags.put("piko_pref_disable_auto_timeline_scroll",SettingsStatus.disableAutoTimelineScroll);
flags.put("piko_pref_hide_live_threads",SettingsStatus.hideLiveThreads);
flags.put("piko_pref_hide_banner",SettingsStatus.hideBanner);
flags.put("piko_pref_hide_bmk_timeline",SettingsStatus.hideInlineBmk);
flags.put("piko_pref_show_poll_result",SettingsStatus.showPollResultsEnabled);
flags.put("piko_pref_comm_notes",SettingsStatus.hideCommunityNote);
flags.put("piko_pref_force_translate",SettingsStatus.forceTranslate);
flags.put("piko_pref_hide_quick_promote",SettingsStatus.hidePromoteButton);
flags.put("piko_pref_hide_immersive_player",SettingsStatus.hideImmersivePlayer);
flags.put("piko_pref_clear_tracking_params",SettingsStatus.cleartrackingparams);
flags.put("piko_pref_unshorten_link",SettingsStatus.unshortenlink);
LegacyTwitterPreferenceCategory patPref = preferenceCategory(strRes("piko_pref_patches"), screen);

for (Map.Entry<String, Boolean> entry : flags.entrySet()) {
String resName = entry.getKey();
boolean sts = (boolean)entry.getValue();
boolean sts = (boolean) entry.getValue();

patPref.addPreference(
patPref.addPreference(
buttonPreference2(
strRes(resName),
resName,
sts,
strRes("piko_pref_patches")
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
)
);
}
if (SettingsStatus.enableAppIconNNavIcon) {
if (SettingsStatus.customAppIcon || SettingsStatus.navBarCustomisation) {
premiumPrefs.addPreference(
buttonPreference(
strRes("piko_pref_icon_n_navbar_btn"),
Expand Down Expand Up @@ -550,7 +550,7 @@ public boolean onPreferenceClick(Preference preference) {
app.revanced.integrations.twitter.Utils.startUndoPostActivity();
} else if (key.equals(Settings.PREMIUM_ICONS.key)) {
app.revanced.integrations.twitter.Utils.startAppIconNNavIconActivity();
} else if (key.equals(Settings.MISC_FEATURE_FLAGS.key)) {
}else if (key.equals(Settings.MISC_FEATURE_FLAGS.key)) {
startFragment(new FeatureFlagsFragment());
} else if (key.equals(Settings.EXPORT_PREF.key)) {
startBackupFragment(new BackupPrefFragment(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class SettingsStatus {

public static boolean enableReaderMode = false;
public static boolean enableUndoPosts = false;
public static boolean enableAppIconNNavIcon = false;
public static boolean customAppIcon = false;

public static boolean hideImmersivePlayer = false;

Expand Down Expand Up @@ -85,21 +85,21 @@ public class SettingsStatus {

public static void enableReaderMode() { enableReaderMode = true; }
public static void enableUndoPosts() { enableUndoPosts = true; }
public static void enableAppIconNNavIcon() { enableAppIconNNavIcon = true; }
public static void customAppIcon() { customAppIcon = true; }
public static void hideImmersivePlayer() { hideImmersivePlayer = true; }

public static void profileTabCustomisation() { profileTabCustomisation = true; }
public static void timelineTabCustomisation() { timelineTabCustomisation = true; }
public static void sideBarCustomisation() { sideBarCustomisation = true; }
public static void navBarCustomisation() { navBarCustomisation = true; }

public static boolean enableTimelineSection(){ return (disableAutoTimelineScroll || forceTranslate || hidePromoteButton || hideCommunityNote|| hideLiveThreads || hideBanner || hideInlineBmk || showPollResultsEnabled || hideImmersivePlayer); }
public static boolean enableTimelineSection(){ return (navBarCustomisation || disableAutoTimelineScroll || forceTranslate || hidePromoteButton || hideCommunityNote|| hideLiveThreads || hideBanner || hideInlineBmk || showPollResultsEnabled || hideImmersivePlayer); }
public static boolean enableMiscSection() { return (enableFontMod || hideRecommendedUsers || hideFAB || hideViewCount || customSharingDomainEnabled || hideFABBtns); }
public static boolean enableAdsSection() {return (hideAds|| hideGAds || hideWTF || hideCTS || hideCTJ || hideDetailedPosts || hideRBMK ||hidePromotedTrend); }
public static boolean enableDownloadSection() {return (changeDownloadEnabled || mediaLinkHandle); }

public static boolean enablePremiumSection() {return (enableReaderMode || enableUndoPosts || enableAppIconNNavIcon); }
public static boolean enableCustomisationSection() {return (sideBarCustomisation || profileTabCustomisation || timelineTabCustomisation); }
public static boolean enablePremiumSection() {return (enableReaderMode || enableUndoPosts || customAppIcon); }
public static boolean enableCustomisationSection() {return (navBarCustomisation || sideBarCustomisation || profileTabCustomisation || timelineTabCustomisation); }

public static void load() {}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.parallel = true
org.gradle.caching = true
android.useAndroidX = true
version = 1.18.0
version = 1.18.1-dev.1

0 comments on commit 70d8b8c

Please sign in to comment.