Search in sources :

Example 21 with AbstractContact

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;
}
Also used : TextView(android.widget.TextView) AbstractContact(com.xabber.android.data.roster.AbstractContact)

Example 22 with AbstractContact

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();
    }
}
Also used : AdapterContextMenuInfo(android.widget.AdapterView.AdapterContextMenuInfo) BaseEntity(com.xabber.android.data.entity.BaseEntity) AccountConfiguration(com.xabber.android.ui.adapter.AccountConfiguration) GroupConfiguration(com.xabber.android.ui.adapter.GroupConfiguration) AbstractContact(com.xabber.android.data.roster.AbstractContact)

Aggregations

AbstractContact (com.xabber.android.data.roster.AbstractContact)22 AbstractChat (com.xabber.android.data.message.AbstractChat)6 UserJid (com.xabber.android.data.entity.UserJid)5 RoomContact (com.xabber.android.data.extension.muc.RoomContact)5 ArrayList (java.util.ArrayList)5 TextView (android.widget.TextView)4 RoomChat (com.xabber.android.data.extension.muc.RoomChat)4 ChatContact (com.xabber.android.data.message.ChatContact)4 RosterContact (com.xabber.android.data.roster.RosterContact)4 GroupConfiguration (com.xabber.android.ui.adapter.contactlist.GroupConfiguration)4 AccountJid (com.xabber.android.data.entity.AccountJid)3 GroupVO (com.xabber.android.presentation.ui.contactlist.viewobjects.GroupVO)3 IFlexible (eu.davidea.flexibleadapter.items.IFlexible)3 ImageView (android.widget.ImageView)2 CommonState (com.xabber.android.data.account.CommonState)2 Collection (java.util.Collection)2 Map (java.util.Map)2 TreeMap (java.util.TreeMap)2 AdapterContextMenuInfo (android.widget.AdapterView.AdapterContextMenuInfo)1 AccountItem (com.xabber.android.data.account.AccountItem)1