TypoClock: User selected Font Style & Font Size [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
committed by
Hưng Phan
parent
274b2d840a
commit
241c19c498
@@ -378,6 +378,7 @@
|
|||||||
|
|
||||||
<!-- Lock Clock Fonts -->
|
<!-- Lock Clock Fonts -->
|
||||||
<string name="lock_clock_font_title">Clock font options</string>
|
<string name="lock_clock_font_title">Clock font options</string>
|
||||||
|
<string name="custom_text_clock_font_title">Typo Clock font options</string>
|
||||||
<string name="lock_clock_font_summary">Change the default font of the lockscreen clock widget</string>
|
<string name="lock_clock_font_summary">Change the default font of the lockscreen clock widget</string>
|
||||||
<string name="lock_clock_font_dialog_title">Select lock clock font</string>
|
<string name="lock_clock_font_dialog_title">Select lock clock font</string>
|
||||||
<string name="lock_clock_font_stock">Normal (default)</string>
|
<string name="lock_clock_font_stock">Normal (default)</string>
|
||||||
@@ -425,6 +426,7 @@
|
|||||||
<!-- Lock Clock & Date Size -->
|
<!-- Lock Clock & Date Size -->
|
||||||
<string name="lockdate_font_size_title">Date font size</string>
|
<string name="lockdate_font_size_title">Date font size</string>
|
||||||
<string name="lockclock_font_size_title">Clock font size</string>
|
<string name="lockclock_font_size_title">Clock font size</string>
|
||||||
|
<string name="custom_text_clock_font_size_title">Typography Clock size</string>
|
||||||
|
|
||||||
<!-- Lockscreen Colors -->
|
<!-- Lockscreen Colors -->
|
||||||
<string name="lockscreen_colors">Lockscreen Colors</string>
|
<string name="lockscreen_colors">Lockscreen Colors</string>
|
||||||
|
|||||||
@@ -54,6 +54,16 @@
|
|||||||
android:defaultValue="34"
|
android:defaultValue="34"
|
||||||
android:persistent="false" />
|
android:persistent="false" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:key="custom_text_clock_fonts"
|
||||||
|
android:title="@string/custom_text_clock_font_title"
|
||||||
|
android:dialogTitle="@string/lock_clock_font_dialog_title"
|
||||||
|
android:entries="@array/lock_clock_fonts_entries"
|
||||||
|
android:entryValues="@array/lock_clock_fonts_values"
|
||||||
|
android:summary="%s"
|
||||||
|
android:defaultValue="32"
|
||||||
|
android:persistent="false" />
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:key="lock_date_fonts"
|
android:key="lock_date_fonts"
|
||||||
android:title="@string/lock_date_font_title"
|
android:title="@string/lock_date_font_title"
|
||||||
@@ -90,6 +100,15 @@
|
|||||||
android:persistent="false"
|
android:persistent="false"
|
||||||
android:defaultValue="78" />
|
android:defaultValue="78" />
|
||||||
|
|
||||||
|
<com.cherish.settings.preferences.CustomSeekBarPreference
|
||||||
|
android:key="custom_text_clock_font_size"
|
||||||
|
android:title="@string/custom_text_clock_font_size_title"
|
||||||
|
android:max="55"
|
||||||
|
settings:min="35"
|
||||||
|
settings:units="dp"
|
||||||
|
android:persistent="false"
|
||||||
|
android:defaultValue="40" />
|
||||||
|
|
||||||
<com.cherish.settings.preferences.CustomSeekBarPreference
|
<com.cherish.settings.preferences.CustomSeekBarPreference
|
||||||
android:key="lockdate_font_size"
|
android:key="lockdate_font_size"
|
||||||
android:title="@string/lockdate_font_size_title"
|
android:title="@string/lockdate_font_size_title"
|
||||||
|
|||||||
@@ -45,18 +45,22 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
|
|||||||
Preference.OnPreferenceChangeListener {
|
Preference.OnPreferenceChangeListener {
|
||||||
|
|
||||||
private static final String LOCK_CLOCK_FONTS = "lock_clock_fonts";
|
private static final String LOCK_CLOCK_FONTS = "lock_clock_fonts";
|
||||||
|
private static final String CUSTOM_TEXT_CLOCK_FONTS = "custom_text_clock_fonts";
|
||||||
private static final String LOCK_DATE_FONTS = "lock_date_fonts";
|
private static final String LOCK_DATE_FONTS = "lock_date_fonts";
|
||||||
private static final String CLOCK_FONT_SIZE = "lockclock_font_size";
|
private static final String CLOCK_FONT_SIZE = "lockclock_font_size";
|
||||||
|
private static final String CUSTOM_TEXT_CLOCK_FONT_SIZE = "custom_text_clock_font_size";
|
||||||
private static final String DATE_FONT_SIZE = "lockdate_font_size";
|
private static final String DATE_FONT_SIZE = "lockdate_font_size";
|
||||||
private static final String LOCK_OWNERINFO_FONTS = "lock_ownerinfo_fonts";
|
private static final String LOCK_OWNERINFO_FONTS = "lock_ownerinfo_fonts";
|
||||||
private static final String LOCKOWNER_FONT_SIZE = "lockowner_font_size";
|
private static final String LOCKOWNER_FONT_SIZE = "lockowner_font_size";
|
||||||
|
|
||||||
private ListPreference mLockClockFonts;
|
private ListPreference mLockClockFonts;
|
||||||
private ListPreference mLockDateFonts;
|
private ListPreference mLockDateFonts;
|
||||||
|
private ListPreference mTextClockFonts;
|
||||||
private ListPreference mLockOwnerInfoFonts;
|
private ListPreference mLockOwnerInfoFonts;
|
||||||
private CustomSeekBarPreference mClockFontSize;
|
private CustomSeekBarPreference mClockFontSize;
|
||||||
private CustomSeekBarPreference mDateFontSize;
|
private CustomSeekBarPreference mDateFontSize;
|
||||||
private CustomSeekBarPreference mOwnerInfoFontSize;
|
private CustomSeekBarPreference mOwnerInfoFontSize;
|
||||||
|
private CustomSeekBarPreference mCustomTextClockFontSize;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle icicle) {
|
public void onCreate(Bundle icicle) {
|
||||||
@@ -105,6 +109,19 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
|
|||||||
mOwnerInfoFontSize.setValue(Settings.System.getInt(getContentResolver(),
|
mOwnerInfoFontSize.setValue(Settings.System.getInt(getContentResolver(),
|
||||||
Settings.System.LOCKOWNER_FONT_SIZE,21));
|
Settings.System.LOCKOWNER_FONT_SIZE,21));
|
||||||
mOwnerInfoFontSize.setOnPreferenceChangeListener(this);
|
mOwnerInfoFontSize.setOnPreferenceChangeListener(this);
|
||||||
|
|
||||||
|
// Lockscren Text Clock Fonts
|
||||||
|
mTextClockFonts = (ListPreference) findPreference(CUSTOM_TEXT_CLOCK_FONTS);
|
||||||
|
mTextClockFonts.setValue(String.valueOf(Settings.System.getInt(
|
||||||
|
getContentResolver(), Settings.System.CUSTOM_TEXT_CLOCK_FONTS, 32)));
|
||||||
|
mTextClockFonts.setSummary(mTextClockFonts.getEntry());
|
||||||
|
mTextClockFonts.setOnPreferenceChangeListener(this);
|
||||||
|
|
||||||
|
// Custom Text Clock Size
|
||||||
|
mCustomTextClockFontSize = (CustomSeekBarPreference) findPreference(CUSTOM_TEXT_CLOCK_FONT_SIZE);
|
||||||
|
mCustomTextClockFontSize.setValue(Settings.System.getInt(getContentResolver(),
|
||||||
|
Settings.System.CUSTOM_TEXT_CLOCK_FONT_SIZE, 40));
|
||||||
|
mCustomTextClockFontSize.setOnPreferenceChangeListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||||
@@ -115,6 +132,12 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
|
|||||||
Integer.valueOf((String) newValue));
|
Integer.valueOf((String) newValue));
|
||||||
mLockClockFonts.setValue(String.valueOf(newValue));
|
mLockClockFonts.setValue(String.valueOf(newValue));
|
||||||
mLockClockFonts.setSummary(mLockClockFonts.getEntry());
|
mLockClockFonts.setSummary(mLockClockFonts.getEntry());
|
||||||
|
return true;
|
||||||
|
} else if (preference == mTextClockFonts) {
|
||||||
|
Settings.System.putInt(getContentResolver(), Settings.System.CUSTOM_TEXT_CLOCK_FONTS,
|
||||||
|
Integer.valueOf((String) newValue));
|
||||||
|
mTextClockFonts.setValue(String.valueOf(newValue));
|
||||||
|
mTextClockFonts.setSummary(mTextClockFonts.getEntry());
|
||||||
return true;
|
return true;
|
||||||
} else if (preference == mLockDateFonts) {
|
} else if (preference == mLockDateFonts) {
|
||||||
Settings.System.putInt(getContentResolver(), Settings.System.LOCK_DATE_FONTS,
|
Settings.System.putInt(getContentResolver(), Settings.System.LOCK_DATE_FONTS,
|
||||||
@@ -127,6 +150,11 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
|
|||||||
Settings.System.putInt(getContentResolver(),
|
Settings.System.putInt(getContentResolver(),
|
||||||
Settings.System.LOCKCLOCK_FONT_SIZE, top*1);
|
Settings.System.LOCKCLOCK_FONT_SIZE, top*1);
|
||||||
return true;
|
return true;
|
||||||
|
} else if (preference == mCustomTextClockFontSize) {
|
||||||
|
int top = (Integer) newValue;
|
||||||
|
Settings.System.putInt(getContentResolver(),
|
||||||
|
Settings.System.CUSTOM_TEXT_CLOCK_FONT_SIZE, top*1);
|
||||||
|
return true;
|
||||||
} else if (preference == mDateFontSize) {
|
} else if (preference == mDateFontSize) {
|
||||||
int top = (Integer) newValue;
|
int top = (Integer) newValue;
|
||||||
Settings.System.putInt(getContentResolver(),
|
Settings.System.putInt(getContentResolver(),
|
||||||
|
|||||||
Reference in New Issue
Block a user