From bf89107981979a032298622cc9e80fc51b21110b Mon Sep 17 00:00:00 2001 From: crimera <44558091+crimera@users.noreply.github.com> Date: Thu, 15 Aug 2024 08:25:21 +0800 Subject: [PATCH 1/2] feat: Quick settings button is now optional --- .../twitter/settings/PikoSettingsButton.java | 10 +++++++--- .../integrations/twitter/settings/Settings.java | 1 + .../twitter/settings/SettingsFragment.java | 10 +++++++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/app/revanced/integrations/twitter/settings/PikoSettingsButton.java b/app/src/main/java/app/revanced/integrations/twitter/settings/PikoSettingsButton.java index f3389c7b1f..1a4dd0379f 100644 --- a/app/src/main/java/app/revanced/integrations/twitter/settings/PikoSettingsButton.java +++ b/app/src/main/java/app/revanced/integrations/twitter/settings/PikoSettingsButton.java @@ -4,7 +4,6 @@ import android.util.AttributeSet; import android.view.View; import androidx.appcompat.widget.AppCompatButton; -import app.revanced.integrations.twitter.settings.ActivityHook; import app.revanced.integrations.twitter.Utils; public class PikoSettingsButton extends AppCompatButton implements View.OnClickListener { @@ -28,14 +27,19 @@ public PikoSettingsButton(Context context, AttributeSet attrs, int defStyleAttr) // Initialization method private void init() { setOnClickListener(this); + if (!Utils.getBooleanPerf(Settings.MISC_QUICK_SETTINGS_BUTTON)) { + setVisibility(GONE); + } } // Override the onClick method @Override public void onClick(View v) { - try{ + try { ActivityHook.startSettingsActivity(); - }catch (Exception e){Utils.logger(e);} + } catch (Exception e) { + Utils.logger(e); + } } } 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 ed094af5ae..e808122cbd 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 @@ -22,6 +22,7 @@ public class Settings extends BaseSettings { public static final StringSetting MISC_FEATURE_FLAGS_SEARCH = new StringSetting("misc_feature_flags_search", ""); 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 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); 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 f7d4452ebd..daa7b592cf 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 @@ -260,7 +260,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) { } - //Misc Section + //misc Section if (SettingsStatus.enableMiscSection()) { LegacyTwitterPreferenceCategory miscPrefs = preferenceCategory(strRes("piko_title_misc"), screen); if (SettingsStatus.enableFontMod) { @@ -351,6 +351,14 @@ public void onCreate(@Nullable Bundle savedInstanceState) { ); } + miscPrefs.addPreference( + switchPreference( + strRes("piko_pref_quick_settings"), + strRes("piko_pref_quick_settings_summary"), + Settings.MISC_QUICK_SETTINGS_BUTTON + ) + ); + if (SettingsStatus.featureFlagsEnabled) { miscPrefs.addPreference( buttonPreference( From a509273aabdef549d118b5658f7bf907ffd958d9 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 15 Aug 2024 00:26:26 +0000 Subject: [PATCH 2/2] chore(release): 1.26.0-dev.1 [skip ci] ## [1.26.0-dev.1](https://github.com/crimera/revanced-integrations/compare/v1.25.1...v1.26.0-dev.1) (2024-08-15) ### Features * Quick settings button is now optional ([bf89107](https://github.com/crimera/revanced-integrations/commit/bf89107981979a032298622cc9e80fc51b21110b)) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cd52cfb80..914b424f37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.26.0-dev.1](https://github.com/crimera/revanced-integrations/compare/v1.25.1...v1.26.0-dev.1) (2024-08-15) + + +### Features + +* Quick settings button is now optional ([bf89107](https://github.com/crimera/revanced-integrations/commit/bf89107981979a032298622cc9e80fc51b21110b)) + ## [1.25.1](https://github.com/crimera/revanced-integrations/compare/v1.25.0...v1.25.1) (2024-08-12) diff --git a/gradle.properties b/gradle.properties index 12eb456ba1..c3e81cb9e2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ org.gradle.parallel = true org.gradle.caching = true android.useAndroidX = true -version = 1.25.1 +version = 1.26.0-dev.1