QS-Clock: Clock size & Clock Colors options [2/2]

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 <phandinhhungvp2001@gmail.com>
This commit is contained in:
ZeNiXxX
2020-07-26 14:38:02 +05:30
committed by Hưng Phan
parent 06ab541376
commit c2dc90c18c
3 changed files with 40 additions and 0 deletions

View File

@@ -1232,4 +1232,10 @@
<string name="screen_state_toggles_mobile_data_summary">Mobile data will be disabled on screen off</string>
<string name="screen_state_off_delay_title">Screen-off actions delay</string>
<string name="screen_state_on_delay_title">Screen-on actions delay</string>
<!-- Qs Header Clock Font Style, Size & Color -->
<string name="sb_clock_styling">SB Clock Styling</string>
<string name="qs_clock_styling">Qs Clock Styling</string>
<string name="qs_clock_font_size_title">Qs Clock Font size</string>
<string name="qs_clock_color_title">Qs Clock Color</string>
</resources>

View File

@@ -122,6 +122,27 @@
android:title="@string/status_bar_clock_color_title"
android:defaultValue="0xffffffff" />
<PreferenceCategory
android:title="@string/qs_clock_styling">
<com.cherish.settings.preferences.CustomSeekBarPreference
android:key="qs_header_clock_size"
android:dependency="status_bar_clock"
android:title="@string/qs_clock_font_size_title"
android:max="30"
settings:min="10"
android:defaultValue="14"
settings:units="dp"/>
<net.margaritov.preference.colorpicker.ColorPickerPreference
android:key="qs_header_clock_color"
android:dependency="status_bar_clock"
android:title="@string/qs_clock_color_title"
android:defaultValue="0xffffffff" />
</PreferenceCategory>
</PreferenceScreen>

View File

@@ -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) {
@@ -104,6 +106,12 @@ public class ClockSettings extends SettingsPreferenceFragment implements
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));
mStatusBarClockShow.setOnPreferenceChangeListener(this);
@@ -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;
}