Search in sources :

Example 1 with EditTextPreferenceDialog

use of cx.ring.views.EditTextPreferenceDialog in project ring-client-android by savoirfairelinux.

the class GeneralAccountFragment method onDisplayPreferenceDialog.

@Override
public void onDisplayPreferenceDialog(Preference preference) {
    if (getFragmentManager().findFragmentByTag(DIALOG_FRAGMENT_TAG) != null) {
        return;
    }
    if (preference instanceof EditTextIntegerPreference) {
        EditTextPreferenceDialog f = EditTextPreferenceDialog.newInstance(preference.getKey(), EditorInfo.TYPE_CLASS_NUMBER);
        f.setTargetFragment(this, 0);
        f.show(getFragmentManager(), DIALOG_FRAGMENT_TAG);
    } else if (preference instanceof PasswordPreference) {
        EditTextPreferenceDialog f = EditTextPreferenceDialog.newInstance(preference.getKey(), EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_PASSWORD);
        f.setTargetFragment(this, 0);
        f.show(getFragmentManager(), DIALOG_FRAGMENT_TAG);
    } else {
        super.onDisplayPreferenceDialog(preference);
    }
}
Also used : EditTextIntegerPreference(cx.ring.views.EditTextIntegerPreference) EditTextPreferenceDialog(cx.ring.views.EditTextPreferenceDialog) PasswordPreference(cx.ring.views.PasswordPreference)

Example 2 with EditTextPreferenceDialog

use of cx.ring.views.EditTextPreferenceDialog in project ring-client-android by savoirfairelinux.

the class AdvancedAccountFragment method onDisplayPreferenceDialog.

@Override
public void onDisplayPreferenceDialog(Preference preference) {
    if (getFragmentManager().findFragmentByTag(DIALOG_FRAGMENT_TAG) != null) {
        return;
    }
    if (preference instanceof EditTextIntegerPreference) {
        EditTextPreferenceDialog f = EditTextPreferenceDialog.newInstance(preference.getKey(), EditorInfo.TYPE_CLASS_NUMBER);
        f.setTargetFragment(this, 0);
        f.show(getFragmentManager(), DIALOG_FRAGMENT_TAG);
    } else if (preference instanceof PasswordPreference) {
        EditTextPreferenceDialog f = EditTextPreferenceDialog.newInstance(preference.getKey(), EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_PASSWORD);
        f.setTargetFragment(this, 0);
        f.show(getFragmentManager(), DIALOG_FRAGMENT_TAG);
    } else {
        super.onDisplayPreferenceDialog(preference);
    }
}
Also used : EditTextIntegerPreference(cx.ring.views.EditTextIntegerPreference) EditTextPreferenceDialog(cx.ring.views.EditTextPreferenceDialog) PasswordPreference(cx.ring.views.PasswordPreference)

Aggregations

EditTextIntegerPreference (cx.ring.views.EditTextIntegerPreference)2 EditTextPreferenceDialog (cx.ring.views.EditTextPreferenceDialog)2 PasswordPreference (cx.ring.views.PasswordPreference)2