Cherish:QS header image [1/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
@@ -31,12 +31,14 @@ import java.util.ArrayList;
|
||||
|
||||
public class QuickSettings extends SettingsPreferenceFragment implements
|
||||
OnPreferenceChangeListener {
|
||||
|
||||
private static final String BRIGHTNESS_SLIDER = "qs_show_brightness";
|
||||
private static final String FOOTER_TEXT_STRING = "footer_text_string";
|
||||
|
||||
private static final String BRIGHTNESS_SLIDER = "qs_show_brightness";
|
||||
private static final String FOOTER_TEXT_STRING = "footer_text_string";
|
||||
private static final String STATUS_BAR_CUSTOM_HEADER = "status_bar_custom_header";
|
||||
|
||||
private SystemSettingMasterSwitchPreference mBrightnessSlider;
|
||||
private SystemSettingEditTextPreference mFooterString;
|
||||
private SystemSettingMasterSwitchPreference mCustomHeader;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
@@ -54,6 +56,12 @@ public class QuickSettings extends SettingsPreferenceFragment implements
|
||||
BRIGHTNESS_SLIDER, 1) == 1;
|
||||
mBrightnessSlider.setChecked(enabled);
|
||||
|
||||
mCustomHeader = (SystemSettingMasterSwitchPreference) findPreference(STATUS_BAR_CUSTOM_HEADER);
|
||||
int qsHeader = Settings.System.getInt(resolver,
|
||||
Settings.System.STATUS_BAR_CUSTOM_HEADER, 0);
|
||||
mCustomHeader.setChecked(qsHeader != 0);
|
||||
mCustomHeader.setOnPreferenceChangeListener(this);
|
||||
|
||||
mFooterString = (SystemSettingEditTextPreference) findPreference(FOOTER_TEXT_STRING);
|
||||
mFooterString.setOnPreferenceChangeListener(this);
|
||||
String footerString = Settings.System.getString(getContentResolver(),
|
||||
@@ -86,6 +94,11 @@ public class QuickSettings extends SettingsPreferenceFragment implements
|
||||
Settings.System.FOOTER_TEXT_STRING, "#KeepTheLove");
|
||||
}
|
||||
return true;
|
||||
} else if (preference == mCustomHeader) {
|
||||
boolean header = (Boolean) newValue;
|
||||
Settings.System.putInt(resolver,
|
||||
Settings.System.STATUS_BAR_CUSTOM_HEADER, header ? 1 : 0);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user