Cherish:Lockscreen Date Fonts [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
@@ -416,4 +416,9 @@
|
||||
<string name="lock_clock_font_burnstown">Burnstown</string>
|
||||
<string name="lock_clock_font_dumbledor">Dumbledor</string>
|
||||
<string name="lock_clock_font_phantombold">PhantomBold</string>
|
||||
|
||||
<!-- Lock Date Fonts -->
|
||||
<string name="lock_date_font_title">Date font options</string>
|
||||
<string name="lock_date_font_summary">Change the default font of the lockscreen date widget</string>
|
||||
<string name="lock_date_font_dialog_title">Select lock date font</string>
|
||||
</resources>
|
||||
|
||||
@@ -53,6 +53,15 @@
|
||||
android:summary="@string/lock_clock_font_summary"
|
||||
android:persistent="false" />
|
||||
|
||||
<ListPreference
|
||||
android:key="lock_date_fonts"
|
||||
android:title="@string/lock_date_font_title"
|
||||
android:dialogTitle="@string/lock_date_font_dialog_title"
|
||||
android:entries="@array/lock_clock_fonts_entries"
|
||||
android:entryValues="@array/lock_clock_fonts_values"
|
||||
android:summary="@string/lock_date_font_summary"
|
||||
android:persistent="false" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<!-- Lockscreen Visualizer-->
|
||||
|
||||
@@ -44,7 +44,10 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
|
||||
Preference.OnPreferenceChangeListener {
|
||||
|
||||
private static final String LOCK_CLOCK_FONTS = "lock_clock_fonts";
|
||||
private static final String LOCK_DATE_FONTS = "lock_date_fonts";
|
||||
|
||||
private ListPreference mLockClockFonts;
|
||||
private ListPreference mLockDateFonts;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
@@ -61,6 +64,13 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
|
||||
getContentResolver(), Settings.System.LOCK_CLOCK_FONTS, 34)));
|
||||
mLockClockFonts.setSummary(mLockClockFonts.getEntry());
|
||||
mLockClockFonts.setOnPreferenceChangeListener(this);
|
||||
|
||||
// Lockscren Date Fonts
|
||||
mLockDateFonts = (ListPreference) findPreference(LOCK_DATE_FONTS);
|
||||
mLockDateFonts.setValue(String.valueOf(Settings.System.getInt(
|
||||
getContentResolver(), Settings.System.LOCK_DATE_FONTS, 32)));
|
||||
mLockDateFonts.setSummary(mLockDateFonts.getEntry());
|
||||
mLockDateFonts.setOnPreferenceChangeListener(this);
|
||||
}
|
||||
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
@@ -72,6 +82,12 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
|
||||
mLockClockFonts.setValue(String.valueOf(newValue));
|
||||
mLockClockFonts.setSummary(mLockClockFonts.getEntry());
|
||||
return true;
|
||||
} else if (preference == mLockDateFonts) {
|
||||
Settings.System.putInt(getContentResolver(), Settings.System.LOCK_DATE_FONTS,
|
||||
Integer.valueOf((String) newValue));
|
||||
mLockDateFonts.setValue(String.valueOf(newValue));
|
||||
mLockDateFonts.setSummary(mLockDateFonts.getEntry());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user