Search in sources :

Example 1 with CustomEditTextPreferenceCompat

use of com.android.settingslib.CustomEditTextPreferenceCompat in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SettingsPreferenceFragment method onDisplayPreferenceDialog.

@Override
public void onDisplayPreferenceDialog(Preference preference) {
    if (preference.getKey() == null) {
        // Auto-key preferences that don't have a key, so the dialog can find them.
        preference.setKey(UUID.randomUUID().toString());
    }
    DialogFragment f = null;
    if (preference instanceof RestrictedListPreference) {
        f = RestrictedListPreference.RestrictedListPreferenceDialogFragment.newInstance(preference.getKey());
    } else if (preference instanceof CustomListPreference) {
        f = CustomListPreference.CustomListPreferenceDialogFragment.newInstance(preference.getKey());
    } else if (preference instanceof CustomDialogPreferenceCompat) {
        f = CustomDialogPreferenceCompat.CustomPreferenceDialogFragment.newInstance(preference.getKey());
    } else if (preference instanceof CustomEditTextPreferenceCompat) {
        f = CustomEditTextPreferenceCompat.CustomPreferenceDialogFragment.newInstance(preference.getKey());
    } else {
        super.onDisplayPreferenceDialog(preference);
        return;
    }
    f.setTargetFragment(this, 0);
    f.show(getFragmentManager(), "dialog_preference");
    onDialogShowing();
}
Also used : CustomEditTextPreferenceCompat(com.android.settingslib.CustomEditTextPreferenceCompat) InstrumentedDialogFragment(com.android.settings.core.instrumentation.InstrumentedDialogFragment) DialogFragment(androidx.fragment.app.DialogFragment) CustomDialogPreferenceCompat(com.android.settingslib.CustomDialogPreferenceCompat)

Aggregations

DialogFragment (androidx.fragment.app.DialogFragment)1 InstrumentedDialogFragment (com.android.settings.core.instrumentation.InstrumentedDialogFragment)1 CustomDialogPreferenceCompat (com.android.settingslib.CustomDialogPreferenceCompat)1 CustomEditTextPreferenceCompat (com.android.settingslib.CustomEditTextPreferenceCompat)1