use of androidx.preference.ListPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ZenRuleMessagesPreferenceController method updateFromContactsValue.
private void updateFromContactsValue(Preference preference) {
if (mRule == null || mRule.getZenPolicy() == null) {
return;
}
ListPreference listPreference = (ListPreference) preference;
listPreference.setSummary(mBackend.getContactsMessagesSummary(mRule.getZenPolicy()));
final String currentVal = ZenModeBackend.getKeyFromZenPolicySetting(mRule.getZenPolicy().getPriorityMessageSenders());
listPreference.setValue(mListValues[getIndexOfSendersValue(currentVal)]);
}
use of androidx.preference.ListPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class Buttons method initList.
private ListPreference initList(String key, int value) {
ListPreference list = getPreferenceScreen().findPreference(key);
if (list == null)
return null;
list.setValue(Integer.toString(value));
list.setSummary(list.getEntry());
list.setOnPreferenceChangeListener(this);
return list;
}
use of androidx.preference.ListPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class GestureAnywhereSettings method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.gesture_anywhere);
mContext = getActivity();
mEnabledPref = (SwitchPreference) findPreference(KEY_ENABLED);
mEnabledPref.setChecked((Settings.System.getInt(getContentResolver(), Settings.System.GESTURE_ANYWHERE_ENABLED, 0) == 1));
mEnabledPref.setOnPreferenceChangeListener(this);
PreferenceScreen prefSet = getPreferenceScreen();
mPositionPref = (ListPreference) prefSet.findPreference(KEY_POSITION);
mPositionPref.setOnPreferenceChangeListener(this);
int position = Settings.System.getInt(getContentResolver(), Settings.System.GESTURE_ANYWHERE_POSITION, Gravity.LEFT);
mPositionPref.setValue(String.valueOf(position));
mTriggerWidthPref = (CustomSeekBarPreference) findPreference(KEY_TRIGGER_WIDTH);
mTriggerWidthPref.setValue(Settings.System.getInt(getContentResolver(), Settings.System.GESTURE_ANYWHERE_TRIGGER_WIDTH, 40));
mTriggerWidthPref.setOnPreferenceChangeListener(this);
mTriggerTopPref = (CustomSeekBarPreference) findPreference(KEY_TRIGGER_TOP);
mTriggerTopPref.setValue(Settings.System.getInt(getContentResolver(), Settings.System.GESTURE_ANYWHERE_TRIGGER_TOP, 0));
mTriggerTopPref.setOnPreferenceChangeListener(this);
mTriggerBottomPref = (CustomSeekBarPreference) findPreference(KEY_TRIGGER_BOTTOM);
mTriggerBottomPref.setValue(Settings.System.getInt(getContentResolver(), Settings.System.GESTURE_ANYWHERE_TRIGGER_HEIGHT, 100));
mTriggerBottomPref.setOnPreferenceChangeListener(this);
Preference pref = findPreference(KEY_GESTURES);
pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
startActivity(new Intent(getActivity(), GestureAnywhereBuilderActivity.class));
return true;
}
});
int anim = Settings.System.getInt(getActivity().getContentResolver(), Settings.System.RR_CONFIG_ANIM, 0);
try {
if (anim == 0) {
removePreference("animation");
} else if (anim == 1) {
removePreference("preview");
} else if (anim == 2) {
removePreference("animation");
removePreference("preview");
}
} catch (Exception e) {
}
if (SystemNavigationPreferenceController.isEdgeToEdgeEnabled(mContext)) {
mFooterPreferenceMixin.createFooterPreference().setTitle(R.string.ga_warning_message);
}
}
use of androidx.preference.ListPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class UpdatableListPreferenceDialogFragment method onDialogClosed.
@Override
public void onDialogClosed(boolean positiveResult) {
if (positiveResult && mClickedDialogEntryIndex >= 0) {
final ListPreference preference = getListPreference();
final String value = mEntryValues[mClickedDialogEntryIndex].toString();
if (preference.callChangeListener(value)) {
preference.setValue(value);
}
}
}
use of androidx.preference.ListPreference in project android_packages_apps_crDroidSettings by crdroidandroid.
the class Buttons method initList.
private ListPreference initList(String key, int value) {
ListPreference list = getPreferenceScreen().findPreference(key);
if (list == null)
return null;
list.setValue(Integer.toString(value));
list.setSummary(list.getEntry());
list.setOnPreferenceChangeListener(this);
return list;
}
Aggregations