Cherish:LS OwnerInfo Fonts & Size Options [2/2]

SuperdroidBond:- It's done on the basis of LS Date Font & Size.

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
SuperDroidBond
2018-10-25 00:49:34 +05:30
committed by Hưng Phan
parent 9269a6a1a5
commit b2cb7d21bf
3 changed files with 52 additions and 0 deletions

View File

@@ -48,11 +48,15 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
private static final String LOCK_DATE_FONTS = "lock_date_fonts";
private static final String CLOCK_FONT_SIZE = "lockclock_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 LOCKOWNER_FONT_SIZE = "lockowner_font_size";
private ListPreference mLockClockFonts;
private ListPreference mLockDateFonts;
private ListPreference mLockOwnerInfoFonts;
private CustomSeekBarPreference mClockFontSize;
private CustomSeekBarPreference mDateFontSize;
private CustomSeekBarPreference mOwnerInfoFontSize;
@Override
public void onCreate(Bundle icicle) {
@@ -88,6 +92,19 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
mDateFontSize.setValue(Settings.System.getInt(getContentResolver(),
Settings.System.LOCKDATE_FONT_SIZE, 18));
mDateFontSize.setOnPreferenceChangeListener(this);
// Lockscren OwnerInfo Fonts
mLockOwnerInfoFonts = (ListPreference) findPreference(LOCK_OWNERINFO_FONTS);
mLockOwnerInfoFonts.setValue(String.valueOf(Settings.System.getInt(
getContentResolver(), Settings.System.LOCK_OWNERINFO_FONTS, 0)));
mLockOwnerInfoFonts.setSummary(mLockOwnerInfoFonts.getEntry());
mLockOwnerInfoFonts.setOnPreferenceChangeListener(this);
// Lockscren OwnerInfo Size
mOwnerInfoFontSize = (CustomSeekBarPreference) findPreference(LOCKOWNER_FONT_SIZE);
mOwnerInfoFontSize.setValue(Settings.System.getInt(getContentResolver(),
Settings.System.LOCKOWNER_FONT_SIZE,21));
mOwnerInfoFontSize.setOnPreferenceChangeListener(this);
}
public boolean onPreferenceChange(Preference preference, Object newValue) {
@@ -115,6 +132,17 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
Settings.System.putInt(getContentResolver(),
Settings.System.LOCKDATE_FONT_SIZE, top*1);
return true;
} else if (preference == mLockOwnerInfoFonts) {
Settings.System.putInt(getContentResolver(), Settings.System.LOCK_OWNERINFO_FONTS,
Integer.valueOf((String) newValue));
mLockOwnerInfoFonts.setValue(String.valueOf(newValue));
mLockOwnerInfoFonts.setSummary(mLockOwnerInfoFonts.getEntry());
return true;
} else if (preference == mOwnerInfoFontSize) {
int top = (Integer) newValue;
Settings.System.putInt(getContentResolver(),
Settings.System.LOCKOWNER_FONT_SIZE, top*1);
return true;
}
return false;
}