Search in sources :

Example 1 with ContactCard

use of cx.ring.tv.cards.contacts.ContactCard in project ring-client-android by savoirfairelinux.

the class RingSearchFragment method displayContact.

@Override
public void displayContact(final CallContact contact) {
    getActivity().runOnUiThread(() -> {
        mRowsAdapter.clear();
        ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(new CardPresenterSelector(getActivity()));
        listRowAdapter.add(new ContactCard(contact, Card.Type.SEARCH_RESULT));
        HeaderItem header = new HeaderItem(getActivity().getResources().getString(R.string.search_results));
        mRowsAdapter.add(new ListRow(header, listRowAdapter));
    });
}
Also used : ContactCard(cx.ring.tv.cards.contacts.ContactCard) CardPresenterSelector(cx.ring.tv.cards.CardPresenterSelector) ArrayObjectAdapter(android.support.v17.leanback.widget.ArrayObjectAdapter) HeaderItem(android.support.v17.leanback.widget.HeaderItem) ListRow(android.support.v17.leanback.widget.ListRow)

Example 2 with ContactCard

use of cx.ring.tv.cards.contacts.ContactCard in project ring-client-android by savoirfairelinux.

the class MainFragment method refreshContact.

@Override
public void refreshContact(final int index, final TVListViewModel contact) {
    getActivity().runOnUiThread(() -> {
        ContactCard contactCard = (ContactCard) cardRowAdapter.get(index);
        contactCard.setModel(contact);
        cardRowAdapter.notifyArrayItemRangeChanged(index, 1);
    });
}
Also used : ContactCard(cx.ring.tv.cards.contacts.ContactCard)

Aggregations

ContactCard (cx.ring.tv.cards.contacts.ContactCard)2 ArrayObjectAdapter (android.support.v17.leanback.widget.ArrayObjectAdapter)1 HeaderItem (android.support.v17.leanback.widget.HeaderItem)1 ListRow (android.support.v17.leanback.widget.ListRow)1 CardPresenterSelector (cx.ring.tv.cards.CardPresenterSelector)1