use of cx.ring.tv.cards.CardPresenterSelector in project ring-client-android by savoirfairelinux.
the class MainFragment method createRow.
private Row createRow(String titleSection, List<Card> cards, boolean shadow) {
CardRow row = new CardRow(CardRow.TYPE_DEFAULT, shadow, titleSection, cards);
PresenterSelector presenterSelector = new CardPresenterSelector(getActivity());
ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(presenterSelector);
for (Card card : cards) {
listRowAdapter.add(card);
}
return new CardListRow(new HeaderItem(HEADER_MISC, titleSection), listRowAdapter, row);
}
use of cx.ring.tv.cards.CardPresenterSelector 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));
});
}
use of cx.ring.tv.cards.CardPresenterSelector in project ring-client-android by savoirfairelinux.
the class MainFragment method setupUIElements.
private void setupUIElements() {
mBackgroundManager = BackgroundManager.getInstance(getActivity());
mBackgroundManager.attach(getActivity().getWindow());
mMetrics = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getMetrics(mMetrics);
// over title
setHeadersState(HEADERS_ENABLED);
setHeadersTransitionOnBackEnabled(true);
// set fastLane (or headers) background color
setBrandColor(getResources().getColor(R.color.color_primary_dark));
// set search icon color
setSearchAffordanceColor(getResources().getColor(R.color.color_primary_light));
mRowsAdapter = new ArrayObjectAdapter(new ShadowRowPresenterSelector());
/* Contact Presenter */
List<Card> cards = new ArrayList<>();
CardRow contactRow = new CardRow(CardRow.TYPE_DEFAULT, true, getString(R.string.tv_contact_row_header), cards);
HeaderItem cardPresenterHeader = new HeaderItem(HEADER_CONTACTS, getString(R.string.tv_contact_row_header));
cardRowAdapter = new ArrayObjectAdapter(new CardPresenterSelector(getActivity()));
CardListRow contactListRow = new CardListRow(cardPresenterHeader, cardRowAdapter, contactRow);
/* CardPresenter */
mRowsAdapter.add(contactListRow);
mRowsAdapter.add(createMyAccountRow());
mRowsAdapter.add(createAboutCardRow());
setAdapter(mRowsAdapter);
// listeners
setOnSearchClickedListener(view -> {
Intent intent = new Intent(getActivity(), SearchActivity.class);
startActivity(intent);
});
setOnItemViewClickedListener(new ItemViewClickedListener());
}
use of cx.ring.tv.cards.CardPresenterSelector in project ring-client-android by savoirfairelinux.
the class MainFragment method createContactRequestRow.
private Row createContactRequestRow() {
List<Card> cards = new ArrayList<>();
CardRow contactRequestRow = new CardRow(CardRow.TYPE_DEFAULT, true, getString(R.string.menu_item_contact_request), cards);
contactRequestRowAdapter = new ArrayObjectAdapter(new CardPresenterSelector(getActivity()));
return new CardListRow(new HeaderItem(HEADER_MISC, getString(R.string.menu_item_contact_request)), contactRequestRowAdapter, contactRequestRow);
}
Aggregations