use of androidx.preference.ListPreference in project android_packages_apps_Settings by omnirom.
the class EnabledNetworkModePreferenceController method updateState.
@Override
public void updateState(Preference preference) {
super.updateState(preference);
final ListPreference listPreference = (ListPreference) preference;
mBuilder.setPreferenceEntries();
mBuilder.setPreferenceValueAndSummary();
listPreference.setEntries(mBuilder.getEntries());
listPreference.setEntryValues(mBuilder.getEntryValues());
listPreference.setValue(Integer.toString(mBuilder.getSelectedEntryValue()));
listPreference.setSummary(mBuilder.getSummary());
}
use of androidx.preference.ListPreference in project android_packages_apps_Settings by omnirom.
the class EnabledNetworkModePreferenceController method onPreferenceChange.
@Override
public boolean onPreferenceChange(Preference preference, Object object) {
final int newPreferredNetworkMode = Integer.parseInt((String) object);
final ListPreference listPreference = (ListPreference) preference;
if (mTelephonyManager.setPreferredNetworkTypeBitmask(MobileNetworkUtils.getRafFromNetworkType(newPreferredNetworkMode))) {
mBuilder.setPreferenceValueAndSummary(newPreferredNetworkMode);
listPreference.setValue(Integer.toString(mBuilder.getSelectedEntryValue()));
listPreference.setSummary(mBuilder.getSummary());
return true;
}
return false;
}
use of androidx.preference.ListPreference in project android_packages_apps_Settings by omnirom.
the class AccessibilityButtonLocationPreferenceController method onPreferenceChange.
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
final ListPreference listPreference = (ListPreference) preference;
final Integer value = Ints.tryParse((String) newValue);
if (value != null) {
Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_BUTTON_MODE, value);
updateState(listPreference);
}
return true;
}
use of androidx.preference.ListPreference in project android_packages_apps_Settings by omnirom.
the class AccessibilityButtonLocationPreferenceController method updateState.
@Override
public void updateState(Preference preference) {
super.updateState(preference);
final ListPreference listPreference = (ListPreference) preference;
listPreference.setValue(getCurrentAccessibilityButtonMode());
}
use of androidx.preference.ListPreference in project android_packages_apps_Settings by omnirom.
the class SelectLongPressTimeoutPreferenceController method updateState.
@Override
public void updateState(Preference preference) {
super.updateState(preference);
if (!(preference instanceof ListPreference)) {
return;
}
final ListPreference listPreference = (ListPreference) preference;
listPreference.setValue(getLongPressTimeoutValue());
}
Aggregations