Search in sources :

Example 1 with CustomEditTextPreference

use of com.android.settingslib.CustomEditTextPreference in project android_packages_apps_Settings 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 RestrictedListPreference) {
        f = RestrictedListPreference.RestrictedListPreferenceDialogFragment.newInstance(preference.getKey());
    } else if (preference instanceof CustomListPreference) {
        f = CustomListPreference.CustomListPreferenceDialogFragment.newInstance(preference.getKey());
    } else if (preference instanceof CustomDialogPreference) {
        f = CustomDialogPreference.CustomPreferenceDialogFragment.newInstance(preference.getKey());
    } else if (preference instanceof CustomEditTextPreference) {
        f = CustomEditTextPreference.CustomPreferenceDialogFragment.newInstance(preference.getKey());
    } else {
        super.onDisplayPreferenceDialog(preference);
        return;
    }
    f.setTargetFragment(this, 0);
    f.show(getFragmentManager(), "dialog_preference");
    onDialogShowing();
}
Also used : CustomEditTextPreference(com.android.settingslib.CustomEditTextPreference) InstrumentedDialogFragment(com.android.settings.core.instrumentation.InstrumentedDialogFragment) DialogFragment(android.app.DialogFragment) CustomDialogPreference(com.android.settingslib.CustomDialogPreference)

Example 2 with CustomEditTextPreference

use of com.android.settingslib.CustomEditTextPreference in project android_packages_apps_Settings by SudaMod.

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 CustomDialogPreference) {
        f = CustomDialogPreference.CustomPreferenceDialogFragment.newInstance(preference.getKey());
    } else if (preference instanceof CustomEditTextPreference) {
        f = CustomEditTextPreference.CustomPreferenceDialogFragment.newInstance(preference.getKey());
    } else {
        super.onDisplayPreferenceDialog(preference);
        return;
    }
    f.setTargetFragment(this, 0);
    f.show(getFragmentManager(), "dialog_preference");
    onDialogShowing();
}
Also used : CustomEditTextPreference(com.android.settingslib.CustomEditTextPreference) InstrumentedDialogFragment(com.android.settings.core.instrumentation.InstrumentedDialogFragment) DialogFragment(android.app.DialogFragment) CustomDialogPreference(com.android.settingslib.CustomDialogPreference)

Example 3 with CustomEditTextPreference

use of com.android.settingslib.CustomEditTextPreference in project android_packages_apps_Settings by DirtyUnicorns.

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 CustomDialogPreference) {
        f = CustomDialogPreference.CustomPreferenceDialogFragment.newInstance(preference.getKey());
    } else if (preference instanceof CustomEditTextPreference) {
        f = CustomEditTextPreference.CustomPreferenceDialogFragment.newInstance(preference.getKey());
    } else {
        super.onDisplayPreferenceDialog(preference);
        return;
    }
    f.setTargetFragment(this, 0);
    f.show(getFragmentManager(), "dialog_preference");
    onDialogShowing();
}
Also used : CustomEditTextPreference(com.android.settingslib.CustomEditTextPreference) InstrumentedDialogFragment(com.android.settings.core.instrumentation.InstrumentedDialogFragment) DialogFragment(android.app.DialogFragment) CustomDialogPreference(com.android.settingslib.CustomDialogPreference)

Example 4 with CustomEditTextPreference

use of com.android.settingslib.CustomEditTextPreference in project android_packages_apps_Settings by crdroidandroid.

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 CustomDialogPreference) {
        f = CustomDialogPreference.CustomPreferenceDialogFragment.newInstance(preference.getKey());
    } else if (preference instanceof CustomDialogPref) {
        f = CustomDialogPref.CustomPreferenceDialogFragment.newInstance(preference.getKey());
    } else if (preference instanceof CustomEditTextPreference) {
        f = CustomEditTextPreference.CustomPreferenceDialogFragment.newInstance(preference.getKey());
    } else {
        super.onDisplayPreferenceDialog(preference);
        return;
    }
    f.setTargetFragment(this, 0);
    f.show(getFragmentManager(), "dialog_preference");
    onDialogShowing();
}
Also used : CustomDialogPref(com.crdroid.settings.preferences.CustomDialogPref) CustomEditTextPreference(com.android.settingslib.CustomEditTextPreference) InstrumentedDialogFragment(com.android.settings.core.instrumentation.InstrumentedDialogFragment) DialogFragment(android.app.DialogFragment) CustomDialogPreference(com.android.settingslib.CustomDialogPreference)

Example 5 with CustomEditTextPreference

use of com.android.settingslib.CustomEditTextPreference in project platform_packages_apps_Settings by BlissRoms.

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 CustomDialogPreference) {
        f = CustomDialogPreference.CustomPreferenceDialogFragment.newInstance(preference.getKey());
    } else if (preference instanceof CustomEditTextPreference) {
        f = CustomEditTextPreference.CustomPreferenceDialogFragment.newInstance(preference.getKey());
    } else {
        super.onDisplayPreferenceDialog(preference);
        return;
    }
    f.setTargetFragment(this, 0);
    f.show(getFragmentManager(), "dialog_preference");
    onDialogShowing();
}
Also used : CustomEditTextPreference(com.android.settingslib.CustomEditTextPreference) InstrumentedDialogFragment(com.android.settings.core.instrumentation.InstrumentedDialogFragment) DialogFragment(android.app.DialogFragment) CustomDialogPreference(com.android.settingslib.CustomDialogPreference)

Aggregations

DialogFragment (android.app.DialogFragment)5 InstrumentedDialogFragment (com.android.settings.core.instrumentation.InstrumentedDialogFragment)5 CustomDialogPreference (com.android.settingslib.CustomDialogPreference)5 CustomEditTextPreference (com.android.settingslib.CustomEditTextPreference)5 CustomDialogPref (com.crdroid.settings.preferences.CustomDialogPref)1