use of com.xabber.android.ui.adapter.contactlist.GroupConfiguration in project xabber-android by redsolution.
the class ContactListPresenter method getTwoNextRecentChat.
public ArrayList<IFlexible> getTwoNextRecentChat() {
Collection<AbstractChat> chats = MessageManager.getInstance().getChatsOfEnabledAccount();
GroupConfiguration chatsGroup = getChatsGroup(chats, currentChatsState);
ArrayList<AbstractContact> contacts = (ArrayList<AbstractContact>) chatsGroup.getAbstractContacts();
ArrayList<IFlexible> items = new ArrayList<>();
if (contacts != null && contacts.size() >= MAX_RECENT_ITEMS) {
items.add(ChatVO.convert(contacts.get(MAX_RECENT_ITEMS - 2), this, null));
if (getAllChatsSize() > MAX_RECENT_ITEMS)
items.add(ChatWithButtonVO.convert(contacts.get(MAX_RECENT_ITEMS - 1), this));
else
items.add(ChatVO.convert(contacts.get(MAX_RECENT_ITEMS - 1), this));
}
return items;
}
Aggregations