use of cx.ring.tv.cards.iconcards.IconCard in project ring-client-android by savoirfairelinux.
the class AboutDetailsPresenter method onBindViewHolder.
@Override
public void onBindViewHolder(ViewHolder viewHolder, Object itemData) {
IconCard card = (IconCard) itemData;
mPrimaryText.setText(card.getTitle());
mExtraText.setText(card.getDescription());
}
use of cx.ring.tv.cards.iconcards.IconCard in project ring-client-android by savoirfairelinux.
the class AboutDetailsFragment method setupUi.
private void setupUi() {
Bundle extras = getActivity().getIntent().getExtras();
Card.Type cardType = Card.Type.DEFAULT;
if (extras != null && extras.containsKey("abouttype")) {
int ordinal = extras.getInt("abouttype", 0);
cardType = Card.Type.values()[ordinal];
}
IconCard card = IconCardHelper.getAboutCardByType(getActivity(), cardType);
ClassPresenterSelector selector = new ClassPresenterSelector();
FullWidthDetailsOverviewRowPresenter rowPresenter = new FullWidthDetailsOverviewRowPresenter(new AboutDetailsPresenter(getActivity())) {
@Override
protected RowPresenter.ViewHolder createRowViewHolder(ViewGroup parent) {
// Customize Actionbar and Content by using custom colors.
RowPresenter.ViewHolder viewHolder = super.createRowViewHolder(parent);
View actionsView = viewHolder.view.findViewById(R.id.details_overview_actions_background);
actionsView.setBackgroundColor(getActivity().getResources().getColor(R.color.color_primary_dark));
View detailsView = viewHolder.view.findViewById(R.id.details_frame);
detailsView.setBackgroundColor(getResources().getColor(R.color.color_primary_dark));
return viewHolder;
}
};
selector.addClassPresenter(DetailsOverviewRow.class, rowPresenter);
selector.addClassPresenter(ListRow.class, new ListRowPresenter());
ArrayObjectAdapter mRowsAdapter = new ArrayObjectAdapter(selector);
Resources res = getActivity().getResources();
DetailsOverviewRow detailsOverview = new DetailsOverviewRow(card);
// Add images and action buttons to the details view
detailsOverview.setImageDrawable(res.getDrawable(R.drawable.ic_logo_ring_white));
mRowsAdapter.add(detailsOverview);
setAdapter(mRowsAdapter);
initializeBackground();
}
Aggregations