use of android.support.v7.preference.ListPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class TransparencySettings method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.rr_transparency);
PreferenceScreen prefSet = getPreferenceScreen();
final ContentResolver resolver = getActivity().getContentResolver();
// QS header alpha
/*mQSHeaderAlpha =
(SeekBarPreference) prefSet.findPreference(PREF_QS_TRANSPARENT_HEADER);
int qSHeaderAlpha = Settings.System.getInt(resolver,
Settings.System.QS_TRANSPARENT_HEADER, 255);
mQSHeaderAlpha.setValue(qSHeaderAlpha / 1);
mQSHeaderAlpha.setOnPreferenceChangeListener(this);*/
// QS stroke
mQSStroke = (ListPreference) findPreference(PREF_QS_STROKE);
int qSStroke = Settings.System.getIntForUser(resolver, Settings.System.QS_STROKE, 0, UserHandle.USER_CURRENT);
mQSStroke.setValue(String.valueOf(qSStroke));
mQSStroke.setSummary(mQSStroke.getEntry());
mQSStroke.setOnPreferenceChangeListener(this);
// QS stroke color
mQSStrokeColor = (ColorPickerPreference) findPreference(PREF_QS_STROKE_COLOR);
mQSStrokeColor.setOnPreferenceChangeListener(this);
int qSIntColor = Settings.System.getInt(resolver, Settings.System.QS_STROKE_COLOR, DEFAULT_QS_STROKE_COLOR);
String qSHexColor = String.format("#%08x", (0x4285F4 & qSIntColor));
mQSStrokeColor.setSummary(qSHexColor);
mQSStrokeColor.setNewPreviewColor(qSIntColor);
// QS stroke thickness
mQSStrokeThickness = (SeekBarPreference) findPreference(PREF_QS_STROKE_THICKNESS);
int qSStrokeThickness = Settings.System.getInt(resolver, Settings.System.QS_STROKE_THICKNESS, 4);
mQSStrokeThickness.setValue(qSStrokeThickness / 1);
mQSStrokeThickness.setOnPreferenceChangeListener(this);
// QS corner radius
mQSCornerRadius = (SeekBarPreference) findPreference(PREF_QS_CORNER_RADIUS);
int qSCornerRadius = Settings.System.getInt(resolver, Settings.System.QS_CORNER_RADIUS, 5);
mQSCornerRadius.setValue(qSCornerRadius / 1);
mQSCornerRadius.setOnPreferenceChangeListener(this);
// QS dash width
mQSDashWidth = (SeekBarPreference) findPreference(PREF_QS_STROKE_DASH_WIDTH);
int qSDialogDashWidth = Settings.System.getInt(resolver, Settings.System.QS_STROKE_DASH_WIDTH, 0);
if (qSDialogDashWidth != 0) {
mQSDashWidth.setValue(qSDialogDashWidth / 1);
} else {
mQSDashWidth.setValue(0);
}
mQSDashWidth.setOnPreferenceChangeListener(this);
// QS dash gap
mQSDashGap = (SeekBarPreference) findPreference(PREF_QS_STROKE_DASH_GAP);
int qSDialogDashGap = Settings.System.getInt(resolver, Settings.System.QS_STROKE_DASH_GAP, 10);
mQSDashGap.setValue(qSDialogDashGap / 1);
mQSDashGap.setOnPreferenceChangeListener(this);
// Notifications alpha
/*mNotificationsAlpha =
(SeekBarPreference) prefSet.findPreference(PREF_NOTIFICATION_ALPHA);
int notificationsAlpha = Settings.System.getInt(resolver,
Settings.System.NOTIFICATION_ALPHA, 255);
mNotificationsAlpha.setValue(notificationsAlpha / 1);
mNotificationsAlpha.setOnPreferenceChangeListener(this);*/
QSSettingsDisabler(qSStroke);
}
use of android.support.v7.preference.ListPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class TaskManagerSettings method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.rr_tm_ui);
final ContentResolver resolver = getContentResolver();
final PreferenceScreen prefScreen = getPreferenceScreen();
final Resources res = getResources();
mKillButton = (ListPreference) findPreference(TM_KILL_BUTTON);
mKillButton.setValue(String.valueOf(Settings.System.getInt(getContentResolver(), Settings.System.TASK_MANAGER_KILL_BUTTON, 0)));
mKillButton.setSummary(mKillButton.getEntry());
mKillButton.setOnPreferenceChangeListener(this);
}
use of android.support.v7.preference.ListPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class Ticker method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.ticker);
PreferenceScreen prefSet = getPreferenceScreen();
ContentResolver resolver = getActivity().getContentResolver();
mShowTicker = (ListPreference) findPreference(PREF_SHOW_TICKER);
mShowTicker.setOnPreferenceChangeListener(this);
int tickerMode = Settings.System.getIntForUser(getContentResolver(), Settings.System.STATUS_BAR_SHOW_TICKER, 0, UserHandle.USER_CURRENT);
mShowTicker.setValue(String.valueOf(tickerMode));
mShowTicker.setSummary(mShowTicker.getEntry());
mTextColor = (ColorPickerPreference) prefSet.findPreference(PREF_TEXT_COLOR);
mTextColor.setOnPreferenceChangeListener(this);
int textColor = Settings.System.getInt(resolver, Settings.System.STATUS_BAR_TICKER_TEXT_COLOR, 0xffffffff);
String textHexColor = String.format("#%08x", (0xffffffff & textColor));
mTextColor.setSummary(textHexColor);
mTextColor.setNewPreviewColor(textColor);
mIconColor = (ColorPickerPreference) prefSet.findPreference(PREF_ICON_COLOR);
mIconColor.setOnPreferenceChangeListener(this);
int iconColor = Settings.System.getInt(resolver, Settings.System.STATUS_BAR_TICKER_ICON_COLOR, 0xffffffff);
String iconHexColor = String.format("#%08x", (0xffffffff & iconColor));
mIconColor.setSummary(iconHexColor);
mIconColor.setNewPreviewColor(iconColor);
mTickerDefaults = prefSet.findPreference(PREF_TICKER_RESTORE_DEFAULTS);
}
use of android.support.v7.preference.ListPreference in project fresco by facebook.
the class SettingsFragment method updateNumberOfDecodingThreadSummary.
private void updateNumberOfDecodingThreadSummary(final Preference preference) {
final ListPreference listPreference = (ListPreference) preference;
final int valueIndex = listPreference.findIndexOfValue(listPreference.getValue());
String summary = getResources().getStringArray(R.array.decoding_thread_summaries)[valueIndex];
if (valueIndex == 0) {
summary += Const.NUMBER_OF_PROCESSORS;
}
preference.setSummary(summary);
}
use of android.support.v7.preference.ListPreference in project materialistic by hidroh.
the class Preferences method sync.
private static void sync(PreferenceManager preferenceManager, String key) {
Preference pref = preferenceManager.findPreference(key);
if (pref instanceof ListPreference) {
ListPreference listPref = (ListPreference) pref;
pref.setSummary(listPref.getEntry());
}
}
Aggregations