Search in sources :

Example 1 with ContactsWrapper

use of com.fanap.podchat.call.contacts.ContactsWrapper in project pod-chat-android-sdk by FanapSoft.

the class CallPresenter method onGetContacts.

@Override
public void onGetContacts(String content, ChatResponse<ResultContact> outPutContact) {
    super.onGetContacts(content, outPutContact);
    ArrayList<ContactsWrapper> contactsWrappers = new ArrayList<>();
    for (Contact c : outPutContact.getResult().getContacts()) {
        ContactsWrapper contactsWrapper = new ContactsWrapper(c);
        contactsWrappers.add(contactsWrapper);
    }
    ContactsFragment fragment = new ContactsFragment();
    Bundle v = new Bundle();
    v.putParcelableArrayList("CONTACTS", contactsWrappers);
    fragment.setArguments(v);
    if (!outPutContact.isCache())
        view.showContactsFragment(fragment);
    else
        view.updateContactsFragment(contactsWrappers);
}
Also used : Bundle(android.os.Bundle) ArrayList(java.util.ArrayList) ContactsWrapper(com.fanap.podchat.call.contacts.ContactsWrapper) ContactsFragment(com.fanap.podchat.call.contacts.ContactsFragment) ResultContact(com.fanap.podchat.model.ResultContact) ResultAddContact(com.fanap.podchat.model.ResultAddContact) RequestGetContact(com.fanap.podchat.requestobject.RequestGetContact) Contact(com.fanap.podchat.mainmodel.Contact)

Aggregations

Bundle (android.os.Bundle)1 ContactsFragment (com.fanap.podchat.call.contacts.ContactsFragment)1 ContactsWrapper (com.fanap.podchat.call.contacts.ContactsWrapper)1 Contact (com.fanap.podchat.mainmodel.Contact)1 ResultAddContact (com.fanap.podchat.model.ResultAddContact)1 ResultContact (com.fanap.podchat.model.ResultContact)1 RequestGetContact (com.fanap.podchat.requestobject.RequestGetContact)1 ArrayList (java.util.ArrayList)1