Search in sources :

Example 1 with CustomDialogPreference

use of org.cyanogenmod.cmparts.widget.CustomDialogPreference in project android_packages_apps_CMParts by LineageOS.

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 CustomDialogPreference) {
        f = CustomDialogPreference.CustomPreferenceDialogFragment.newInstance(preference.getKey());
    } else {
        super.onDisplayPreferenceDialog(preference);
        return;
    }
    f.setTargetFragment(this, 0);
    f.show(getFragmentManager(), "dialog_preference");
    onDialogShowing();
}
Also used : DialogFragment(android.app.DialogFragment) CustomDialogPreference(org.cyanogenmod.cmparts.widget.CustomDialogPreference)

Aggregations

DialogFragment (android.app.DialogFragment)1 CustomDialogPreference (org.cyanogenmod.cmparts.widget.CustomDialogPreference)1