From 1e01fa38e98ee9c019b57f513af7e930d8afa4d2 Mon Sep 17 00:00:00 2001 From: "manu.suresh" Date: Tue, 24 Feb 2026 17:23:15 +0530 Subject: [PATCH 1/2] LineageParts: Add new PreferenceCategory and RemotePreference for Hardware Switch --- res/drawable/ic_hardware_switch.xml | 17 +++++++++++++++++ res/values/strings.xml | 3 +++ res/xml/button_settings.xml | 15 +++++++++++++++ .../lineageparts/input/ButtonSettings.java | 9 +++++++++ 4 files changed, 44 insertions(+) create mode 100644 res/drawable/ic_hardware_switch.xml diff --git a/res/drawable/ic_hardware_switch.xml b/res/drawable/ic_hardware_switch.xml new file mode 100644 index 00000000..ba19d31d --- /dev/null +++ b/res/drawable/ic_hardware_switch.xml @@ -0,0 +1,17 @@ + + + + + + diff --git a/res/values/strings.xml b/res/values/strings.xml index a4506fb9..7b4550fe 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -223,6 +223,9 @@ Answer incoming calls by pressing the home button Extras Additional buttons + Hardware switch + Hardware switch + Configure the hardware switch Click to partial screenshot Short click Volume Down and Power to take partial screenshot diff --git a/res/xml/button_settings.xml b/res/xml/button_settings.xml index 97e4a223..003c2c0e 100644 --- a/res/xml/button_settings.xml +++ b/res/xml/button_settings.xml @@ -84,6 +84,21 @@ + + + + + + + + diff --git a/src/org/lineageos/lineageparts/input/ButtonSettings.java b/src/org/lineageos/lineageparts/input/ButtonSettings.java index e531b7e9..f8505009 100644 --- a/src/org/lineageos/lineageparts/input/ButtonSettings.java +++ b/src/org/lineageos/lineageparts/input/ButtonSettings.java @@ -98,6 +98,7 @@ public class ButtonSettings extends SettingsPreferenceFragment private static final String KEY_SWAP_CAPACITIVE_KEYS = "swap_capacitive_keys"; private static final String KEY_NAV_BAR_INVERSE = "sysui_nav_bar_inverse"; private static final String KEY_ENABLE_TASKBAR = "enable_taskbar"; + private static final String KEY_HARDWARE_SWITCH = "hardware_switch"; private static final String CATEGORY_POWER = "power_key"; private static final String CATEGORY_HOME = "home_key"; @@ -109,6 +110,7 @@ public class ButtonSettings extends SettingsPreferenceFragment private static final String CATEGORY_VOLUME = "volume_keys"; private static final String CATEGORY_NAVBAR = "navigation_bar_category"; private static final String CATEGORY_EXTRAS = "extras_category"; + private static final String CATEGORY_HARDWARE_SWITCH = "hardware_switch_category"; private ListPreference mBackLongPressAction; private ListPreference mHomeLongPressAction; @@ -181,6 +183,7 @@ public class ButtonSettings extends SettingsPreferenceFragment final PreferenceCategory volumeCategory = prefScreen.findPreference(CATEGORY_VOLUME); final PreferenceCategory cameraCategory = prefScreen.findPreference(CATEGORY_CAMERA); final PreferenceCategory extrasCategory = prefScreen.findPreference(CATEGORY_EXTRAS); + final PreferenceCategory hardwareSwitchCategory = prefScreen.findPreference(CATEGORY_HARDWARE_SWITCH); // Power button ends calls. mPowerEndCall = findPreference(KEY_POWER_END_CALL); @@ -203,6 +206,12 @@ public class ButtonSettings extends SettingsPreferenceFragment mNavigationPreferencesCat = findPreference(CATEGORY_NAVBAR); + Preference hardwareSwitchPref = findPreference(KEY_HARDWARE_SWITCH); + if (hardwareSwitchCategory != null + && (hardwareSwitchPref == null || !hardwareSwitchPref.isVisible())) { + prefScreen.removePreference(hardwareSwitchCategory); + } + Action defaultBackLongPressAction = Action.fromIntSafe(res.getInteger( org.lineageos.platform.internal.R.integer.config_longPressOnBackBehavior)); Action defaultHomeLongPressAction = Action.fromIntSafe(res.getInteger( -- GitLab From f91bfedd66bf315c5d2ffebe2c1adf39267911ff Mon Sep 17 00:00:00 2001 From: "manu.suresh" Date: Wed, 25 Feb 2026 19:43:45 +0530 Subject: [PATCH 2/2] LineageParts: Move Hardware Switch strings to e_strings --- res/values/e_strings.xml | 5 +++++ res/values/strings.xml | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/res/values/e_strings.xml b/res/values/e_strings.xml index ded5ce87..d33f1bc1 100644 --- a/res/values/e_strings.xml +++ b/res/values/e_strings.xml @@ -27,4 +27,9 @@ OpenKeychain + + + Hardware switch + Hardware switch + Configure the hardware switch diff --git a/res/values/strings.xml b/res/values/strings.xml index 7b4550fe..a4506fb9 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -223,9 +223,6 @@ Answer incoming calls by pressing the home button Extras Additional buttons - Hardware switch - Hardware switch - Configure the hardware switch Click to partial screenshot Short click Volume Down and Power to take partial screenshot -- GitLab