use of com.xabber.android.ui.adapter.AccountConfiguration 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();
}
}
use of com.xabber.android.ui.adapter.AccountConfiguration in project xabber-android by redsolution.
the class ContactListFragment method scrollTo.
/**
* Scroll contact list to specified account.
*
* @param account
*/
void scrollTo(String account) {
long count = listView.getCount();
for (int position = 0; position < (int) count; position++) {
BaseEntity baseEntity = (BaseEntity) listView.getItemAtPosition(position);
if (baseEntity != null && baseEntity instanceof AccountConfiguration && baseEntity.getAccount().equals(account)) {
stopMovement();
listView.setSelection(position);
break;
}
}
}
Aggregations