From 318a1a0403dded433a5dc9d7f8987f226c461236 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 edad29ed..6b705a1f 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -221,6 +221,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 1e49cb98..de6f3391 100644 --- a/res/xml/button_settings.xml +++ b/res/xml/button_settings.xml @@ -90,6 +90,21 @@ + + + + + + + + diff --git a/src/org/lineageos/lineageparts/input/ButtonSettings.java b/src/org/lineageos/lineageparts/input/ButtonSettings.java index d340836d..a37d6f7f 100644 --- a/src/org/lineageos/lineageparts/input/ButtonSettings.java +++ b/src/org/lineageos/lineageparts/input/ButtonSettings.java @@ -101,6 +101,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"; @@ -112,6 +113,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; @@ -185,6 +187,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); @@ -207,6 +210,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 b734928e77f7eeae6a689eda92d87dcc9136b6ee Mon Sep 17 00:00:00 2001 From: "manu.suresh" Date: Wed, 25 Feb 2026 19:49:56 +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 5c078ca7..1363df3a 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 6b705a1f..edad29ed 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -221,9 +221,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