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);
}
}
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);
}
}
Aggregations