From c2dc90c18cc1783253cb3dd0bbe4cd825284ce7e Mon Sep 17 00:00:00 2001 From: ZeNiXxX Date: Sun, 26 Jul 2020 14:38:02 +0530 Subject: [PATCH] QS-Clock: Clock size & Clock Colors options [2/2] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Few Addons in the commit - 1. Separate SB & Qs Clock Styling 2. Beautify n Categorize it 3. This one is for Inteded Pun Change-Id: Icc501b6c6872b14ce21d8bc7d0632c71deb360f7 Signed-off-by: Hưng Phan --- res/values/cherish_strings.xml | 6 ++++++ res/xml/clock_settings.xml | 21 +++++++++++++++++++ .../settings/fragments/ClockSettings.java | 13 ++++++++++++ 3 files changed, 40 insertions(+) diff --git a/res/values/cherish_strings.xml b/res/values/cherish_strings.xml index 966d20c..2712b51 100644 --- a/res/values/cherish_strings.xml +++ b/res/values/cherish_strings.xml @@ -1232,4 +1232,10 @@ Mobile data will be disabled on screen off Screen-off actions delay Screen-on actions delay + + + SB Clock Styling + Qs Clock Styling + Qs Clock Font size + Qs Clock Color diff --git a/res/xml/clock_settings.xml b/res/xml/clock_settings.xml index 178c2b5..bd5b5db 100644 --- a/res/xml/clock_settings.xml +++ b/res/xml/clock_settings.xml @@ -121,6 +121,27 @@ android:icon="@drawable/ic_color" android:title="@string/status_bar_clock_color_title" android:defaultValue="0xffffffff" /> + + + + + + + + + diff --git a/src/com/cherish/settings/fragments/ClockSettings.java b/src/com/cherish/settings/fragments/ClockSettings.java index 11c69e7..18bdd31 100644 --- a/src/com/cherish/settings/fragments/ClockSettings.java +++ b/src/com/cherish/settings/fragments/ClockSettings.java @@ -71,6 +71,7 @@ public class ClockSettings extends SettingsPreferenceFragment implements public static final int CLOCK_DATE_STYLE_UPPERCASE = 2; private static final int CUSTOM_CLOCK_DATE_FORMAT_INDEX = 18; private static final String STATUS_BAR_CLOCK_DATE_POSITION = "statusbar_clock_date_position"; + private static final String QS_HEADER_CLOCK_SIZE = "qs_header_clock_size"; static final int DEFAULT_STATUS_CLOCK_COLOR = 0xffffffff; @@ -84,6 +85,7 @@ public class ClockSettings extends SettingsPreferenceFragment implements private ColorPickerPreference mClockColor; private CustomSeekBarPreference mClockSize; private ListPreference mClockDatePosition; + private CustomSeekBarPreference mQsClockSize; @Override public void onCreate(Bundle icicle) { @@ -103,6 +105,12 @@ public class ClockSettings extends SettingsPreferenceFragment implements mClockDateDisplay = (ListPreference) findPreference(STATUS_BAR_CLOCK_DATE_DISPLAY); mClockDateStyle = (ListPreference) findPreference(STATUS_BAR_CLOCK_DATE_STYLE); mClockDatePosition = (ListPreference) findPreference(STATUS_BAR_CLOCK_DATE_POSITION); + + mQsClockSize = (CustomSeekBarPreference) findPreference(QS_HEADER_CLOCK_SIZE); + int qsClockSize = Settings.System.getInt(resolver, + Settings.System.QS_HEADER_CLOCK_SIZE, 14); + mQsClockSize.setValue(qsClockSize / 1); + mQsClockSize.setOnPreferenceChangeListener(this); mStatusBarClockShow.setChecked((Settings.System.getInt(resolver, Settings.System.STATUS_BAR_CLOCK, 1) == 1)); @@ -312,6 +320,11 @@ public class ClockSettings extends SettingsPreferenceFragment implements mClockDatePosition.setSummary(mClockDatePosition.getEntries()[index]); parseClockDateFormats(); return true; + } else if (preference == mQsClockSize) { + int width = ((Integer)newValue).intValue(); + Settings.System.putInt(resolver, + Settings.System.QS_HEADER_CLOCK_SIZE, width); + return true; } return false; }