use of com.xabber.android.presentation.ui.contactlist.viewobjects.GroupVO in project xabber-android by redsolution.
the class ContactListPresenter method createContactListWithGroups.
private void createContactListWithGroups(List<IFlexible> items, boolean showEmptyGroups, Map<String, GroupConfiguration> groups, Comparator<AbstractContact> comparator) {
for (GroupConfiguration rosterConfiguration : groups.values()) {
if (showEmptyGroups || !rosterConfiguration.isEmpty()) {
GroupVO group = GroupVO.convert(rosterConfiguration, false, this);
rosterConfiguration.sortAbstractContacts(comparator);
for (AbstractContact contact : rosterConfiguration.getAbstractContacts()) {
group.addSubItem(SettingsManager.contactsShowMessages() ? ExtContactVO.convert(contact, this) : ContactVO.convert(contact, this));
}
items.add(group);
}
}
}
use of com.xabber.android.presentation.ui.contactlist.viewobjects.GroupVO in project xabber-android by redsolution.
the class ContactListPresenter method createContactListWithAccountsAndGroups.
private void createContactListWithAccountsAndGroups(List<IFlexible> items, AccountConfiguration rosterAccount, boolean showEmptyGroups, Comparator<AbstractContact> comparator) {
AccountWithGroupsVO account = AccountWithGroupsVO.convert(rosterAccount, this);
boolean firstGroupInAccount = true;
for (GroupConfiguration rosterConfiguration : rosterAccount.getSortedGroupConfigurations()) {
if (showEmptyGroups || !rosterConfiguration.isEmpty()) {
GroupVO group = GroupVO.convert(rosterConfiguration, firstGroupInAccount, this);
firstGroupInAccount = false;
rosterConfiguration.sortAbstractContacts(comparator);
for (AbstractContact contact : rosterConfiguration.getAbstractContacts()) {
group.addSubItem(SettingsManager.contactsShowMessages() ? ExtContactVO.convert(contact, this) : ContactVO.convert(contact, this));
}
account.addSubItem(group);
}
}
items.add(account);
}
use of com.xabber.android.presentation.ui.contactlist.viewobjects.GroupVO in project xabber-android by redsolution.
the class ContactListFragment method onItemContextMenu.
@Override
public void onItemContextMenu(int adapterPosition, ContextMenu menu) {
IFlexible item = adapter.getItem(adapterPosition);
if (item != null && item instanceof ContactVO) {
AccountJid accountJid = ((ContactVO) item).getAccountJid();
UserJid userJid = ((ContactVO) item).getUserJid();
AbstractContact abstractContact = RosterManager.getInstance().getAbstractContact(accountJid, userJid);
ContextMenuHelper.createContactContextMenu(getActivity(), presenter, abstractContact, menu);
return;
}
if (item != null && item instanceof GroupVO) {
AccountJid accountJid = ((GroupVO) item).getAccountJid();
ContextMenuHelper.createGroupContextMenu(getActivity(), presenter, accountJid, ((GroupVO) item).getGroupName(), menu);
return;
}
}
Aggregations