use of android.support.v17.leanback.widget.FullWidthDetailsOverviewSharedElementHelper in project ring-client-android by savoirfairelinux.
the class TVContactRequestFragment method setupAdapter.
private void setupAdapter() {
// Set detail background and style.
FullWidthDetailsOverviewRowPresenter detailsPresenter = new FullWidthDetailsOverviewRowPresenter(new TVContactRequestDetailPresenter(), new TVContactRequestDetailsOverviewLogoPresenter());
detailsPresenter.setBackgroundColor(ContextCompat.getColor(getActivity(), R.color.color_primary_dark));
detailsPresenter.setInitialState(FullWidthDetailsOverviewRowPresenter.STATE_HALF);
// Hook up transition element.
FullWidthDetailsOverviewSharedElementHelper mHelper = new FullWidthDetailsOverviewSharedElementHelper();
mHelper.setSharedElementEnterTransition(getActivity(), TVContactRequestActivity.SHARED_ELEMENT_NAME);
detailsPresenter.setListener(mHelper);
detailsPresenter.setParticipatingEntranceTransition(false);
prepareEntranceTransition();
detailsPresenter.setOnActionClickedListener(action -> {
if (action.getId() == ACTION_ACCEPT) {
presenter.acceptTrustRequest(mSelectedContactRequest);
} else if (action.getId() == ACTION_REFUSE) {
presenter.refuseTrustRequest(mSelectedContactRequest);
} else if (action.getId() == ACTION_BLOCK) {
presenter.blockTrustRequest(mSelectedContactRequest);
}
});
ClassPresenterSelector mPresenterSelector = new ClassPresenterSelector();
mPresenterSelector.addClassPresenter(DetailsOverviewRow.class, detailsPresenter);
mPresenterSelector.addClassPresenter(ListRow.class, new ListRowPresenter());
mAdapter = new ArrayObjectAdapter(mPresenterSelector);
setAdapter(mAdapter);
}
use of android.support.v17.leanback.widget.FullWidthDetailsOverviewSharedElementHelper in project butter-android by butterproject.
the class TVBaseDetailsFragment method setupDetailsOverviewRowPresenter.
private void setupDetailsOverviewRowPresenter(MediaWrapper item) {
// Set detail background and style.
FullWidthDetailsOverviewRowPresenter detailsPresenter = new FullWidthDetailsOverviewRowPresenter(getDetailPresenter());
if (item.hasColor()) {
detailsPresenter.setBackgroundColor(item.getColor());
}
detailsPresenter.setOnActionClickedListener(this);
final FullWidthDetailsOverviewSharedElementHelper sharedElementHelper = new FullWidthDetailsOverviewSharedElementHelper();
sharedElementHelper.setSharedElementEnterTransition(getActivity(), TVMediaDetailActivity.SHARED_ELEMENT_NAME);
detailsPresenter.setListener(sharedElementHelper);
detailsPresenter.setParticipatingEntranceTransition(false);
presenterSelector.addClassPresenter(DetailsOverviewRow.class, detailsPresenter);
presenterSelector.addClassPresenter(ListRow.class, new ListRowPresenter());
}
Aggregations