diff options
| author | Ali B <abittin@gmail.com> | 2021-05-08 21:01:45 +0300 |
|---|---|---|
| committer | GtrCraft <nickvanbokhorst@hotmail.com> | 2021-05-13 21:05:34 +0200 |
| commit | 491083fd13685f9bfb213a5f644ebd25373f6180 (patch) | |
| tree | 6f2fa2f89cb45959d33064cc5213a5d5a6a38c10 | |
| parent | 2e4487f531ee41685cd707b515bfd084381bfabe (diff) | |
PartsBin: make panel settings self-removing
Change-Id: I97ee4845237e9b6587b5d1f186cd7e52df69fbc2
| -rw-r--r-- | res/values/config.xml | 2 | ||||
| -rw-r--r-- | res/xml/main.xml | 7 | ||||
| -rw-r--r-- | src/com/aicp/device/DeviceSettings.java | 4 |
3 files changed, 7 insertions, 6 deletions
diff --git a/res/values/config.xml b/res/values/config.xml index cd2e086..2f35d19 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -27,7 +27,7 @@ <bool name="config_device_supports_gestures">false</bool> <!-- Whether device provides panel options --> - <bool name="config_device_supports_panels">true</bool> + <bool name="config_device_supports_panels">false</bool> <!-- Whether device supports disabling hwkeys --> <string name="pathHWKToggle"></string> diff --git a/res/xml/main.xml b/res/xml/main.xml index df907a8..bec0228 100644 --- a/res/xml/main.xml +++ b/res/xml/main.xml @@ -59,16 +59,17 @@ android:title="@string/hbm_mode_title" android:persistent="false" /> - <Preference + <com.aicp.gear.preference.SelfRemovingPreference android:key="panel_category" android:title="@string/panel_category_title" android:icon="@drawable/ic_panel" android:summary="@string/panel_category_summary" - android:persistent="false" > + android:persistent="false" + aicpextras:requiresConfig="@bool/config_device_supports_panels"> <intent android:action="android.intent.action.MAIN" android:targetPackage="com.aicp.device" android:targetClass="com.aicp.device.PanelSettingsActivity" /> - </Preference> + </com.aicp.gear.preference.SelfRemovingPreference> </PreferenceCategory> <com.aicp.gear.preference.SelfRemovingPreferenceCategory diff --git a/src/com/aicp/device/DeviceSettings.java b/src/com/aicp/device/DeviceSettings.java index 9ca4c64..e6c97fe 100644 --- a/src/com/aicp/device/DeviceSettings.java +++ b/src/com/aicp/device/DeviceSettings.java @@ -251,8 +251,8 @@ public class DeviceSettings extends PreferenceFragment implements graphicsCategory.removePreference(mDCDModeSwitch); graphicsRemoved += 1; } - if (!supportsPanels) { - mPanelSettings.getParent().removePreference(mPanelSettings); + SelfRemovingPreference mPanelSettings = (SelfRemovingPreference) findPreference(KEY_PANEL_SETTINGS); + if (mPanelSettings == null) { graphicsRemoved += 1; } if (graphicsRemoved == 3) graphicsCategory.getParent().removePreference(graphicsCategory); |
