Implement quick QS brightness slider [2/3]
Change-Id: I2d20d9ed8f3542b1ec8da9cf78a71195baf7f1f1
Signed-off-by: Jesse Chan <jc@lineageos.org>
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 0b49c5c..1101f1b 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -170,6 +170,18 @@
<item>2</item>
</string-array>
+ <string-array name="status_bar_brightness_slider_entries" translatable="false">
+ <item>@string/status_bar_brightness_slider_show_never</item>
+ <item>@string/status_bar_brightness_slider_show_expanded</item>
+ <item>@string/status_bar_brightness_slider_show_always</item>
+ </string-array>
+
+ <string-array name="status_bar_brightness_slider_values" translatable="false">
+ <item>0</item>
+ <item>1</item>
+ <item>2</item>
+ </string-array>
+
<!-- Quick pulldown -->
<string-array name="status_bar_quick_qs_pulldown_entries" translatable="false">
<item>@string/status_bar_quick_qs_pulldown_off</item>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index a17406a..01ecd0b 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -144,6 +144,9 @@
<string name="status_bar_brightness_slider_summary">Adjust brightness from the Quick Settings</string>
<string name="status_bar_brightness_slider_auto_title">Auto brightness</string>
<string name="status_bar_brightness_slider_auto_summary">Show toggle for adaptive brightness near the slider</string>
+ <string name="status_bar_brightness_slider_show_never">Never show</string>
+ <string name="status_bar_brightness_slider_show_expanded">Show when expanded</string>
+ <string name="status_bar_brightness_slider_show_always">Show always</string>
<string name="status_bar_toggle_brightness">Brightness control</string>
<string name="status_bar_toggle_brightness_summary">Adjust brightness by sliding across the status bar</string>
diff --git a/res/xml/status_bar_settings.xml b/res/xml/status_bar_settings.xml
index a4d2b08..40c225d 100644
--- a/res/xml/status_bar_settings.xml
+++ b/res/xml/status_bar_settings.xml
@@ -105,11 +105,14 @@
<PreferenceCategory
android:title="@string/status_bar_brightness_category">
- <shiftos.preference.ShiftSecureSettingSwitchPreference
+ <shiftos.preference.ShiftSecureSettingListPreference
android:key="qs_show_brightness_slider"
android:title="@string/status_bar_brightness_slider_title"
- android:summary="@string/status_bar_brightness_slider_summary"
- android:defaultValue="true" />
+ android:summary="%s"
+ android:dialogTitle="@string/status_bar_brightness_slider_title"
+ android:entries="@array/status_bar_brightness_slider_entries"
+ android:entryValues="@array/status_bar_brightness_slider_values"
+ android:defaultValue="1" />
<shiftos.preference.ShiftSecureSettingSwitchPreference
android:key="qs_show_auto_brightness"