From a0bf7cbee1484e56a6c9024493c2659e7079d2b7 Mon Sep 17 00:00:00 2001 From: SuperDroidBond Date: Sun, 28 Oct 2018 14:20:55 +0530 Subject: [PATCH] Cherish:LS Weather Temp & City Fonts [2/2] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hưng Phan --- res/values/cherish_arrays.xml | 79 +++++++++++++++++++ res/values/cherish_strings.xml | 8 ++ res/xml/omnijaws_settings.xml | 20 +++++ .../fragments/OmniJawsSettings.java | 35 +++++++- 4 files changed, 140 insertions(+), 2 deletions(-) diff --git a/res/values/cherish_arrays.xml b/res/values/cherish_arrays.xml index 2eca02d..57e33c1 100644 --- a/res/values/cherish_arrays.xml +++ b/res/values/cherish_arrays.xml @@ -826,4 +826,83 @@ 13 14 + + + + @string/lock_clock_font_stock + @string/lock_clock_font_italic + @string/lock_clock_font_bold + @string/lock_clock_font_bold_italic + @string/lock_clock_font_light_italic + @string/lock_clock_font_light + @string/lock_clock_font_thin_italic + @string/lock_clock_font_thin + @string/lock_clock_font_condensed_normal + @string/lock_clock_font_condensed_italic + @string/lock_clock_font_condensed_bold + @string/lock_clock_font_condensed_bold_italic + @string/lock_clock_font_condensed_light + @string/lock_clock_font_condensed_light_italic + @string/lock_clock_font_medium_normal + @string/lock_clock_font_medium_italic + @string/lock_clock_font_black + @string/lock_clock_font_black_italic + @string/lock_clock_font_dancingscript + @string/lock_clock_font_dancingscript_bold + @string/lock_clock_font_comingsoon + @string/lock_clock_font_notoserif + @string/lock_clock_font_notoserif_italic + @string/lock_clock_font_notoserif_bold + @string/lock_clock_font_notoserif_bold_italic + @string/lock_clock_font_gobold + @string/lock_clock_font_roadrage + @string/lock_clock_font_snowstorm + @string/lock_clock_font_googlesans + @string/lock_clock_font_neoneon + @string/lock_clock_font_themeable + @string/lock_clock_font_samsung + @string/lock_clock_font_mexcellent + @string/lock_clock_font_burnstown + @string/lock_clock_font_dumbledor + @string/lock_clock_font_phantombold + + + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 33 + 33 + 34 + 35 + diff --git a/res/values/cherish_strings.xml b/res/values/cherish_strings.xml index 3998696..ae4e273 100644 --- a/res/values/cherish_strings.xml +++ b/res/values/cherish_strings.xml @@ -846,4 +846,12 @@ Show Condition Image Show weather conditions image + + LS Weather Temp font + Change the default font of the lockscreen weather temp + Select lock weather temp font + LS Weather City font + Change the default font of the lockscreen weather city + Select lock weather city font + diff --git a/res/xml/omnijaws_settings.xml b/res/xml/omnijaws_settings.xml index 7993db2..5d8f473 100644 --- a/res/xml/omnijaws_settings.xml +++ b/res/xml/omnijaws_settings.xml @@ -48,10 +48,30 @@ android:title="@string/lockscreen_weather_show_city_title" android:summary="@string/lockscreen_weather_show_city_summary" android:defaultValue="true" /> + + + + diff --git a/src/com/cherish/settings/preferences/fragments/OmniJawsSettings.java b/src/com/cherish/settings/preferences/fragments/OmniJawsSettings.java index 2720ec8..54a4890 100644 --- a/src/com/cherish/settings/preferences/fragments/OmniJawsSettings.java +++ b/src/com/cherish/settings/preferences/fragments/OmniJawsSettings.java @@ -55,9 +55,13 @@ public class OmniJawsSettings extends SettingsPreferenceFragment implements private static final String DEFAULT_WEATHER_ICON_PREFIX = "outline"; private static final String WEATHER_SERVICE_PACKAGE = "org.omnirom.omnijaws"; private static final String CHRONUS_ICON_PACK_INTENT = "com.dvtonder.chronus.ICON_PACK"; + private static final String LOCK_WEATHER_TEMP_FONTS = "lock_weather_temp_fonts"; + private static final String LOCK_WEATHER_CITY_FONTS = "lock_weather_city_fonts"; private PreferenceCategory mWeatherCategory; private ListPreference mWeatherIconPack; + ListPreference mLockTempFonts; + ListPreference mLockCityFonts; @Override public int getMetricsCategory() { @@ -99,6 +103,20 @@ public class OmniJawsSettings extends SettingsPreferenceFragment implements mWeatherIconPack.setSummary(mWeatherIconPack.getEntry()); mWeatherIconPack.setOnPreferenceChangeListener(this); } + + // Lockscren Weather Temp Fonts + mLockTempFonts = (ListPreference) findPreference(LOCK_WEATHER_TEMP_FONTS); + mLockTempFonts.setValue(String.valueOf(Settings.System.getInt( + getContentResolver(), Settings.System.LOCK_WEATHER_TEMP_FONTS, 27))); + mLockTempFonts.setSummary(mLockTempFonts.getEntry()); + mLockTempFonts.setOnPreferenceChangeListener(this); + + // Lockscren Weather City Fonts + mLockCityFonts = (ListPreference) findPreference(LOCK_WEATHER_CITY_FONTS); + mLockCityFonts.setValue(String.valueOf(Settings.System.getInt( + getContentResolver(), Settings.System.LOCK_WEATHER_CITY_FONTS, 27))); + mLockCityFonts.setSummary(mLockCityFonts.getEntry()); + mLockCityFonts.setOnPreferenceChangeListener(this); } public boolean onPreferenceChange(Preference preference, Object objValue) { @@ -108,8 +126,21 @@ public class OmniJawsSettings extends SettingsPreferenceFragment implements Settings.System.OMNIJAWS_WEATHER_ICON_PACK, value); int valueIndex = mWeatherIconPack.findIndexOfValue(value); mWeatherIconPack.setSummary(mWeatherIconPack.getEntries()[valueIndex]); - } - return true; + return true; + } else if (preference == mLockTempFonts) { + Settings.System.putInt(getContentResolver(), Settings.System.LOCK_WEATHER_TEMP_FONTS, + Integer.valueOf((String) objValue)); + mLockTempFonts.setValue(String.valueOf(objValue)); + mLockTempFonts.setSummary(mLockTempFonts.getEntry()); + return true; + } else if (preference == mLockCityFonts) { + Settings.System.putInt(getContentResolver(), Settings.System.LOCK_WEATHER_CITY_FONTS, + Integer.valueOf((String) objValue)); + mLockCityFonts.setValue(String.valueOf(objValue)); + mLockCityFonts.setSummary(mLockCityFonts.getEntry()); + return true; + } + return false; } private void getAvailableWeatherIconPacks(List entries, List values) {