Cherish:Ls clock customizations

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
minaripenguin37
2022-11-18 19:45:07 +07:00
committed by Hưng Phan
parent 124b13fc02
commit 68ff3a9cc0
4 changed files with 169 additions and 0 deletions

View File

@@ -657,4 +657,119 @@
<item>2</item> <item>2</item>
<item>3</item> <item>3</item>
</string-array> </string-array>
<!-- Lockscreen Clock -->
<string-array name="kg_custom_clock_font_entries" translatable="false">
<item>@string/default_string</item>
<item>accuratist</item>
<item>aclonica</item>
<item>amarante</item>
<item>bariol</item>
<item>cagliostro</item>
<item>cocon</item>
<item>comfortaa</item>
<item>comicsans</item>
<item>coolstory</item>
<item>exotwo</item>
<item>fifa 2018</item>
<item>fluid sans</item>
<item>google sans</item>
<item>grandhotel</item>
<item>harmony os sans</item>
<item>inter custom</item>
<item>jtleonor</item>
<item>lato</item>
<item>lg smart gothic</item>
<item>linotte</item>
<item>misans</item>
<item>nokia pure</item>
<item>nothingdot57</item>
<item>nunito</item>
<item>oneplus sans</item>
<item>oneplus slate</item>
<item>oppo sans</item>
<item>oswald bold</item>
<item>product sans vh</item>
<item>quando</item>
<item>redressed</item>
<item>reemkufi</item>
<item>roboto condensed</item>
<item>rosemary</item>
<item>rubik bold</item>
<item>samsung one</item>
<item>san francisco</item>
<item>simple day</item>
<item>sony sketch</item>
<item>storopia</item>
<item>surfer</item>
<item>ubuntu</item>
<item>manrope</item>
<item>notosans</item>
<item>recursive casual</item>
<item>recursive</item>
<item>roboto system</item>
<item>sourcesans</item>
<item>serif</item>
<item>google sans clock(weight 400)</item>
<item>apice outline</item>
<item>audimat</item>
<item>geometos soft extra bold</item>
</string-array>
<string-array name="kg_custom_clock_font_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
<item>11</item>
<item>12</item>
<item>13</item>
<item>14</item>
<item>15</item>
<item>16</item>
<item>17</item>
<item>18</item>
<item>19</item>
<item>20</item>
<item>21</item>
<item>22</item>
<item>23</item>
<item>24</item>
<item>25</item>
<item>26</item>
<item>27</item>
<item>28</item>
<item>29</item>
<item>30</item>
<item>31</item>
<item>32</item>
<item>33</item>
<item>34</item>
<item>35</item>
<item>36</item>
<item>37</item>
<item>38</item>
<item>39</item>
<item>40</item>
<item>41</item>
<item>42</item>
<item>43</item>
<item>44</item>
<item>45</item>
<item>46</item>
<item>47</item>
<item>48</item>
<item>49</item>
<item>50</item>
<item>51</item>
<item>52</item>
<item>53</item>
</string-array>
</resources> </resources>

View File

@@ -851,4 +851,14 @@
<!-- Squiggle animation --> <!-- Squiggle animation -->
<string name="show_squiggle_animation_title">Show squiggle animation</string> <string name="show_squiggle_animation_title">Show squiggle animation</string>
<string name="show_squiggle_animation_summary">Show media panel squiggle animation, after change need to switch music, pause music or move the progress bar to apply</string> <string name="show_squiggle_animation_summary">Show media panel squiggle animation, after change need to switch music, pause music or move the progress bar to apply</string>
<!-- Lockscreen interface -->
<string name="lockscreen_interface_title">Lockscreen User Interface</string>
<string name="lockscreen_clock_color_title">Custom lockscreen clock color</string>
<string name="lockscreen_clock_color_summary">Use custom color instead of wallpaper accent</string>
<string name="kg_custom_clock_color_title">Choose lockscreen clock color</string>
<string name="kg_custom_clock_font_title">Custom lockscreen clock font</string>
<string name="kg_custom_date_font_title">Custom lockscreen date font</string>
<string name="small_clock_doubleline_title">Double-line Lockscreen clock format</string>
<string name="small_clock_doubleline_summary">Use double-line clock instead of single line style for lockscreen clock</string>
</resources> </resources>

View File

@@ -76,6 +76,38 @@
</PreferenceCategory> </PreferenceCategory>
<SwitchPreference
android:key="kg_custom_clock_color_enabled"
android:title="@string/lockscreen_clock_color_title"
android:summary="@string/lockscreen_clock_color_summary"
android:defaultValue="false" />
<net.margaritov.preference.colorpicker.SecureSettingColorPickerPreference
android:key="kg_custom_clock_color"
android:title="@string/kg_custom_clock_color_title"
android:defaultValue="0x92FFFFFF"
android:dependency="kg_custom_clock_color_enabled"/>
<com.cherish.settings.preferences.SecureSettingListPreference
android:key="kg_custom_clock_font"
android:title="@string/kg_custom_clock_font_title"
android:entries="@array/kg_custom_clock_font_entries"
android:entryValues="@array/kg_custom_clock_font_values"
android:defaultValue="0"/>
<com.cherish.settings.preferences.SecureSettingListPreference
android:key="kg_custom_date_font"
android:title="@string/kg_custom_date_font_title"
android:entries="@array/kg_custom_clock_font_entries"
android:entryValues="@array/kg_custom_clock_font_values"
android:defaultValue="0"/>
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="small_clock_double_line"
android:title="@string/small_clock_doubleline_title"
android:summary="@string/small_clock_doubleline_summary"
android:defaultValue="false" />
<!-- Udfps options --> <!-- Udfps options -->
<PreferenceCategory <PreferenceCategory
android:key="udfps_category" android:key="udfps_category"

View File

@@ -76,6 +76,7 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
private static final String DEFAULT_CLOCK = "com.android.keyguard.clock.DefaultClockController"; private static final String DEFAULT_CLOCK = "com.android.keyguard.clock.DefaultClockController";
private static final String UDFPS_CATEGORY = "udfps_category"; private static final String UDFPS_CATEGORY = "udfps_category";
private static final String TORCH_POWER_BUTTON_GESTURE = "torch_power_button_gesture"; private static final String TORCH_POWER_BUTTON_GESTURE = "torch_power_button_gesture";
private static final String KG_CUSTOM_CLOCK_COLOR_ENABLED = "kg_custom_clock_color_enabled";
static final int MODE_DISABLED = 0; static final int MODE_DISABLED = 0;
static final int MODE_NIGHT = 1; static final int MODE_NIGHT = 1;
@@ -87,6 +88,7 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
private PreferenceCategory mUdfpsCategory; private PreferenceCategory mUdfpsCategory;
private Context mContext; private Context mContext;
private ListPreference mTorchPowerButton; private ListPreference mTorchPowerButton;
private SwitchPreference mKGCustomClockColor;
Preference mAODPref; Preference mAODPref;
@@ -120,6 +122,11 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
mLockClockStyles.setValue(mLockClockStylesValue); mLockClockStyles.setValue(mLockClockStylesValue);
mLockClockStyles.setSummary(mLockClockStyles.getEntry()); mLockClockStyles.setSummary(mLockClockStyles.getEntry());
mLockClockStyles.setOnPreferenceChangeListener(this); mLockClockStyles.setOnPreferenceChangeListener(this);
mKGCustomClockColor = (SwitchPreference) findPreference(KG_CUSTOM_CLOCK_COLOR_ENABLED);
boolean mKGCustomClockColorEnabled = Settings.Secure.getIntForUser(resolver,
Settings.Secure.KG_CUSTOM_CLOCK_COLOR_ENABLED, 0, UserHandle.USER_CURRENT) != 0;
mKGCustomClockColor.setChecked(mKGCustomClockColorEnabled);
mKGCustomClockColor.setOnPreferenceChangeListener(this);
// screen off torch // screen off torch
mTorchPowerButton = (ListPreference) findPreference(TORCH_POWER_BUTTON_GESTURE); mTorchPowerButton = (ListPreference) findPreference(TORCH_POWER_BUTTON_GESTURE);
@@ -175,6 +182,11 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
Settings.System.putInt(resolver, Settings.System.TORCH_POWER_BUTTON_GESTURE, Settings.System.putInt(resolver, Settings.System.TORCH_POWER_BUTTON_GESTURE,
mTorchPowerButtonValue); mTorchPowerButtonValue);
return true; return true;
} else if (preference == mKGCustomClockColor) {
boolean val = (Boolean) newValue;
Settings.Secure.putIntForUser(resolver,
Settings.Secure.KG_CUSTOM_CLOCK_COLOR_ENABLED, val ? 1 : 0, UserHandle.USER_CURRENT);
return true;
} }
return false; return false;
} }