use of com.xabber.android.data.roster.AbstractContact in project xabber-android by redsolution.
the class FingerprintViewer method update.
private void update() {
isUpdating = true;
AbstractContact abstractContact = RosterManager.getInstance().getBestContact(account, user);
verifiedView.setChecked(OTRManager.getInstance().isVerified(account, user));
scanView.setEnabled(remoteFingerprint != null);
verifiedView.setEnabled(remoteFingerprint != null);
((TextView) findViewById(R.id.otr_remote_fingerprint)).setText(remoteFingerprint == null ? getString(R.string.unknown) : showFingerprint(remoteFingerprint));
showView.setEnabled(localFingerprint != null);
copyView.setEnabled(localFingerprint != null);
((TextView) findViewById(R.id.otr_local_fingerprint)).setText(localFingerprint == null ? getString(R.string.unknown) : showFingerprint(localFingerprint));
contactTitleActionBarInflater.update(abstractContact);
isUpdating = false;
}
use of com.xabber.android.data.roster.AbstractContact in project xabber-android by redsolution.
the class ContactListFragment method onCreateContextMenu.
@Override
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) {
AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
BaseEntity baseEntity = (BaseEntity) listView.getItemAtPosition(info.position);
if (baseEntity instanceof AbstractContact) {
ContextMenuHelper.createContactContextMenu(getActivity(), adapter, (AbstractContact) baseEntity, menu);
} else if (baseEntity instanceof AccountConfiguration) {
ContextMenuHelper.createAccountContextMenu(getActivity(), adapter, baseEntity.getAccount(), menu);
} else if (baseEntity instanceof GroupConfiguration) {
ContextMenuHelper.createGroupContextMenu(getActivity(), adapter, baseEntity.getAccount(), baseEntity.getUser(), menu);
} else {
throw new IllegalStateException();
}
}
Aggregations