parts: move clock indicator to its own fragment
Change-Id: I53ad2ba34a2ba1820f18a8a2469a7448c84165e4
Signed-off-by: Joey <jbevilacqua@shiftphones.com>
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 20b0a0a..9d3b0a9 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -92,7 +92,7 @@
<string name="status_bar_icons_title">Statusleistensymbole</string>
<string name="status_bar_system_icons_title">Systemsymbole</string>
<string name="status_bar_system_icons_summary">Festlegen, welche Statusleistensymbole angezeigt werden</string>
- <string name="status_bar_clock_title">Uhr</string>
+ <string name="status_bar_clock_title">Uhrzeitanzeige</string>
<string name="status_bar_clock_show_seconds_title">Sekunden anzeigen</string>
<string name="status_bar_clock_show_seconds_summary">Stunden, Minuten und Sekunden anzeigen</string>
<string name="status_bar_clock_position_title">Position der Uhr</string>
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index 6f967d1..55f2a89 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -91,7 +91,7 @@
<string name="status_bar_icons_title">Icone barra di stato</string>
<string name="status_bar_system_icons_title">Icone di sistema</string>
<string name="status_bar_system_icons_summary">Controlla quali icone vengono visualizzate nella barra di stato</string>
- <string name="status_bar_clock_title">Orologio</string>
+ <string name="status_bar_clock_title">Indicatore orologio</string>
<string name="status_bar_clock_show_seconds_title">Mostra secondi</string>
<string name="status_bar_clock_show_seconds_summary">Mostra ore, minuti e secondi</string>
<string name="status_bar_clock_position_title">Posizione orologio</string>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 63934ed..7ab7eb8 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -115,7 +115,7 @@
<string name="status_bar_system_icons_summary">Control which status bar icons are shown</string>
<!-- Status bar - Clock -->
- <string name="status_bar_clock_title">Clock</string>
+ <string name="status_bar_clock_title">Clock indicator</string>
<string name="status_bar_clock_show_seconds_title">Show seconds</string>
<string name="status_bar_clock_show_seconds_summary">Show hours, minutes, and seconds</string>
diff --git a/res/xml/parts_catalog.xml b/res/xml/parts_catalog.xml
index 581cb97..1620116 100644
--- a/res/xml/parts_catalog.xml
+++ b/res/xml/parts_catalog.xml
@@ -45,6 +45,11 @@
android:fragment="com.shiftos.shiftparts.statusbar.StatusBarSettings"
shift:xmlRes="@xml/status_bar_settings" />
+ <part android:key="status_bar_clock_settings"
+ android:title="@string/status_bar_clock_title"
+ android:fragment="com.shiftos.shiftparts.statusbar.StatusBarClockSettings"
+ shift:xmlRes="@xml/status_bar_clock_settings" />
+
<part android:key="power_menu"
android:title="@string/power_menu_title"
android:fragment="com.shiftos.shiftparts.input.PowerMenuActions"
diff --git a/res/xml/status_bar_clock_settings.xml b/res/xml/status_bar_clock_settings.xml
new file mode 100644
index 0000000..701c259
--- /dev/null
+++ b/res/xml/status_bar_clock_settings.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014-2016 The CyanogenMod Project
+ Copyright (C) 2017-2018 The LineageOS Project
+ Copyright (C) 2020 Shift GmbH
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<PreferenceScreen
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:shift="http://schemas.android.com/apk/res/shiftos.platform"
+ android:key="status_bar_clock_settings"
+ android:title="@string/status_bar_clock_title">
+
+ <shiftos.preference.ShiftSystemSettingListPreference
+ android:key="status_bar_clock"
+ android:title="@string/status_bar_clock_position_title"
+ android:summary="%s"
+ android:dialogTitle="@string/status_bar_clock_position_title"
+ android:entries="@array/status_bar_clock_position_entries"
+ android:entryValues="@array/status_bar_clock_position_values"
+ android:defaultValue="0" />
+
+ <shiftos.preference.SecureSettingSwitchPreference
+ android:key="clock_seconds"
+ android:title="@string/status_bar_clock_show_seconds_title"
+ android:summary="@string/status_bar_clock_show_seconds_summary"
+ android:defaultValue="false" />
+
+ <shiftos.preference.ShiftSystemSettingListPreference
+ android:key="status_bar_am_pm"
+ android:title="@string/status_bar_am_pm_title"
+ android:summary="%s"
+ android:dialogTitle="@string/status_bar_am_pm_title"
+ android:entries="@array/status_bar_am_pm_entries"
+ android:entryValues="@array/status_bar_am_pm_values"
+ android:defaultValue="2" />
+</PreferenceScreen>
diff --git a/res/xml/status_bar_settings.xml b/res/xml/status_bar_settings.xml
index a2d7d45..30ff7f5 100644
--- a/res/xml/status_bar_settings.xml
+++ b/res/xml/status_bar_settings.xml
@@ -35,46 +35,17 @@
android:title="@string/network_traffic_settings_title"
android:summary="@string/network_traffic_settings_summary" />
- <PreferenceCategory
- android:title="@string/status_bar_icons_title">
+ <PreferenceScreen
+ android:key="status_bar_icons"
+ android:title="@string/status_bar_system_icons_title"
+ android:summary="@string/status_bar_system_icons_summary">
+ <intent android:action="com.android.settings.action.STATUS_BAR_TUNER" />
+ </PreferenceScreen>
- <PreferenceScreen
- android:key="status_bar_icons"
- android:title="@string/status_bar_system_icons_title"
- android:summary="@string/status_bar_system_icons_summary">
- <intent android:action="com.android.settings.action.STATUS_BAR_TUNER" />
- </PreferenceScreen>
-
- </PreferenceCategory>
-
- <PreferenceCategory
+ <PreferenceScreen
+ android:fragment="com.shiftos.shiftparts.statusbar.StatusBarClockSettings"
android:key="status_bar_clock_key"
- android:title="@string/status_bar_clock_title">
-
- <shiftos.preference.ShiftSystemSettingListPreference
- android:key="status_bar_clock"
- android:title="@string/status_bar_clock_position_title"
- android:summary="%s"
- android:dialogTitle="@string/status_bar_clock_position_title"
- android:entries="@array/status_bar_clock_position_entries"
- android:entryValues="@array/status_bar_clock_position_values"
- android:defaultValue="0" />
-
- <shiftos.preference.SecureSettingSwitchPreference
- android:key="clock_seconds"
- android:title="@string/status_bar_clock_show_seconds_title"
- android:summary="@string/status_bar_clock_show_seconds_summary"
- android:defaultValue="false" />
-
- <shiftos.preference.ShiftSystemSettingListPreference
- android:key="status_bar_am_pm"
- android:title="@string/status_bar_am_pm_title"
- android:summary="%s"
- android:dialogTitle="@string/status_bar_am_pm_title"
- android:entries="@array/status_bar_am_pm_entries"
- android:entryValues="@array/status_bar_am_pm_values"
- android:defaultValue="2" />
- </PreferenceCategory>
+ android:title="@string/status_bar_clock_title" />
<PreferenceCategory
android:title="@string/status_bar_brightness_category">