From 4068a66899a508c0e66670a0aa581ea2a75b3da7 Mon Sep 17 00:00:00 2001 From: Swakshan Date: Thu, 16 May 2024 00:15:28 +0530 Subject: [PATCH 1/3] refactor(Twitter): Separated `App icon` and `Navigation icon` patch --- .../integrations/twitter/settings/Settings.java | 2 +- .../twitter/settings/SettingsAboutFragment.java | 3 ++- .../twitter/settings/SettingsFragment.java | 4 ++-- .../integrations/twitter/settings/SettingsStatus.java | 10 +++++----- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/app/revanced/integrations/twitter/settings/Settings.java b/app/src/main/java/app/revanced/integrations/twitter/settings/Settings.java index 7dda530b6a..72fe48d543 100644 --- a/app/src/main/java/app/revanced/integrations/twitter/settings/Settings.java +++ b/app/src/main/java/app/revanced/integrations/twitter/settings/Settings.java @@ -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"); diff --git a/app/src/main/java/app/revanced/integrations/twitter/settings/SettingsAboutFragment.java b/app/src/main/java/app/revanced/integrations/twitter/settings/SettingsAboutFragment.java index c0d6ca1bcd..5a3c72cca9 100644 --- a/app/src/main/java/app/revanced/integrations/twitter/settings/SettingsAboutFragment.java +++ b/app/src/main/java/app/revanced/integrations/twitter/settings/SettingsAboutFragment.java @@ -58,7 +58,8 @@ public void onCreate(@org.jetbrains.annotations.Nullable Bundle savedInstanceSta Map 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("app_icon",SettingsStatus.customAppIcon); + flags.put("custom_navigation",SettingsStatus.navBarCustomisation); 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); diff --git a/app/src/main/java/app/revanced/integrations/twitter/settings/SettingsFragment.java b/app/src/main/java/app/revanced/integrations/twitter/settings/SettingsFragment.java index 63934a7275..d3446d8113 100644 --- a/app/src/main/java/app/revanced/integrations/twitter/settings/SettingsFragment.java +++ b/app/src/main/java/app/revanced/integrations/twitter/settings/SettingsFragment.java @@ -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"), @@ -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); diff --git a/app/src/main/java/app/revanced/integrations/twitter/settings/SettingsStatus.java b/app/src/main/java/app/revanced/integrations/twitter/settings/SettingsStatus.java index ea61582445..8531829102 100644 --- a/app/src/main/java/app/revanced/integrations/twitter/settings/SettingsStatus.java +++ b/app/src/main/java/app/revanced/integrations/twitter/settings/SettingsStatus.java @@ -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; @@ -85,7 +85,7 @@ 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; } @@ -93,13 +93,13 @@ public class SettingsStatus { 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() {} } From 2e7f94dcff46707d529d01c02aebfd63b488d824 Mon Sep 17 00:00:00 2001 From: Swakshan Date: Thu, 16 May 2024 01:00:00 +0530 Subject: [PATCH 2/3] refactor(Twitter): Sorted about fragment --- .../settings/SettingsAboutFragment.java | 88 +++++++++---------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/app/src/main/java/app/revanced/integrations/twitter/settings/SettingsAboutFragment.java b/app/src/main/java/app/revanced/integrations/twitter/settings/SettingsAboutFragment.java index 5a3c72cca9..5fb4070653 100644 --- a/app/src/main/java/app/revanced/integrations/twitter/settings/SettingsAboutFragment.java +++ b/app/src/main/java/app/revanced/integrations/twitter/settings/SettingsAboutFragment.java @@ -53,56 +53,56 @@ public void onCreate(@org.jetbrains.annotations.Nullable Bundle savedInstanceSta ) ); - LegacyTwitterPreferenceCategory patPref = preferenceCategory(strRes("piko_pref_patches"), screen); + TreeMap 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 flags = new HashMap(); - flags.put("piko_pref_video_download",SettingsStatus.enableVidDownload); - flags.put("piko_pref_reader_mode",SettingsStatus.enableReaderMode); - flags.put("app_icon",SettingsStatus.customAppIcon); - flags.put("custom_navigation",SettingsStatus.navBarCustomisation); - 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 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") ) From 2a849172bcac0db9a6456513e096a2183249666e Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 16 May 2024 02:09:30 +0000 Subject: [PATCH 3/3] chore(release): 1.18.1-dev.1 [skip ci] ## [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)) --- CHANGELOG.md | 8 ++++++++ gradle.properties | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59d4568f34..603984b64a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/gradle.properties b/gradle.properties index fdbf7eccdc..9277051712 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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