Search in sources :

Example 1 with AccountWithGroupsVO

use of com.xabber.android.presentation.ui.contactlist.viewobjects.AccountWithGroupsVO 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);
}
Also used : AccountWithGroupsVO(com.xabber.android.presentation.ui.contactlist.viewobjects.AccountWithGroupsVO) GroupConfiguration(com.xabber.android.ui.adapter.contactlist.GroupConfiguration) AbstractContact(com.xabber.android.data.roster.AbstractContact) GroupVO(com.xabber.android.presentation.ui.contactlist.viewobjects.GroupVO)

Aggregations

AbstractContact (com.xabber.android.data.roster.AbstractContact)1 AccountWithGroupsVO (com.xabber.android.presentation.ui.contactlist.viewobjects.AccountWithGroupsVO)1 GroupVO (com.xabber.android.presentation.ui.contactlist.viewobjects.GroupVO)1 GroupConfiguration (com.xabber.android.ui.adapter.contactlist.GroupConfiguration)1