Search in sources :

Example 1 with CredentialsPreference

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

the class SecurityAccountFragment method addAllCredentials.

@Override
public void addAllCredentials(ArrayList<AccountCredentials> credentials) {
    int i = 0;
    for (AccountCredentials cred : credentials) {
        CredentialsPreference toAdd = new CredentialsPreference(getPreferenceManager().getContext());
        toAdd.setKey("credential" + i);
        toAdd.setPersistent(false);
        toAdd.setCreds(cred);
        toAdd.setIcon(null);
        credentialsCategory.addPreference(toAdd);
        i++;
        toAdd.setOnPreferenceChangeListener(editCredentialListener);
    }
}
Also used : CredentialsPreference(cx.ring.views.CredentialsPreference) AccountCredentials(cx.ring.model.AccountCredentials)

Example 2 with CredentialsPreference

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

the class SecurityAccountFragment method onDisplayPreferenceDialog.

@Override
public void onDisplayPreferenceDialog(Preference preference) {
    if (getFragmentManager().findFragmentByTag(DIALOG_FRAGMENT_TAG) != null) {
        return;
    }
    if (preference instanceof CredentialsPreference) {
        CredentialPreferenceDialog preferenceDialog = CredentialPreferenceDialog.newInstance(preference.getKey());
        preferenceDialog.setTargetFragment(this, 0);
        preferenceDialog.show(getFragmentManager(), DIALOG_FRAGMENT_TAG);
    } else {
        super.onDisplayPreferenceDialog(preference);
    }
}
Also used : CredentialsPreference(cx.ring.views.CredentialsPreference) CredentialPreferenceDialog(cx.ring.views.CredentialPreferenceDialog)

Aggregations

CredentialsPreference (cx.ring.views.CredentialsPreference)2 AccountCredentials (cx.ring.model.AccountCredentials)1 CredentialPreferenceDialog (cx.ring.views.CredentialPreferenceDialog)1