use of com.xabber.android.ui.adapter.GroupConfiguration 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