FacetProvider
public interface FacetProvider
GuidedActionsStylist.ViewHolder |
ViewHolder caches information about the action item layouts' subviews. |
ItemBridgeAdapter.ViewHolder |
ViewHolder for the ItemBridgeAdapter. |
Presenter.ViewHolder |
ViewHolder can be subclassed and used to cache any view accessors needed to improve binding performance (for example, results of findViewById) without needing to subclass a View. |
Presenter |
A Presenter is used to generate |
AbstractDetailsDescriptionPresenter.ViewHolder |
The ViewHolder for the |
AbstractDetailsDescriptionPresenter |
An abstract |
AbstractMediaItemPresenter.ViewHolder |
The ViewHolder for the |
AbstractMediaItemPresenter |
Abstract |
AbstractMediaListHeaderPresenter.ViewHolder |
The ViewHolder for the |
AbstractMediaListHeaderPresenter |
Abstract presenter class for rendering the header for a list of media items in a playlist. |
DetailsOverviewLogoPresenter.ViewHolder |
ViewHolder for Logo view of DetailsOverviewRow. |
DetailsOverviewLogoPresenter |
Presenter that responsible to create a ImageView and bind to DetailsOverviewRow. |
DetailsOverviewRowPresenter.ViewHolder |
A ViewHolder for the DetailsOverviewRow. |
DetailsOverviewRowPresenter |
This class is deprecated. |
DividerPresenter |
DividerPresenter provides a default presentation for |
FullWidthDetailsOverviewRowPresenter.ViewHolder |
A ViewHolder for the DetailsOverviewRow. |
FullWidthDetailsOverviewRowPresenter |
Renders a |
ListRowPresenter.ViewHolder |
ViewHolder for the ListRowPresenter. |
ListRowPresenter |
ListRowPresenter renders |
PlaybackControlsRowPresenter.ViewHolder |
A ViewHolder for the PlaybackControlsRow. |
PlaybackControlsRowPresenter |
A PlaybackControlsRowPresenter renders a |
PlaybackRowPresenter.ViewHolder |
This container is used for trapping click events and passing them to the playback controls. |
PlaybackRowPresenter |
Subclass of |
PlaybackTransportRowPresenter.ViewHolder |
A ViewHolder for the PlaybackControlsRow supporting seek UI. |
PlaybackTransportRowPresenter |
A PlaybackTransportRowPresenter renders a |
RowHeaderPresenter.ViewHolder |
A ViewHolder for the RowHeaderPresenter. |
RowHeaderPresenter |
RowHeaderPresenter provides a default presentation for |
RowPresenter.ViewHolder |
A ViewHolder for a |
RowPresenter |
An abstract |
VerticalGridPresenter.ViewHolder |
ViewHolder for the VerticalGridPresenter. |
VerticalGridPresenter |
A presenter that renders objects in a |
This is the query interface to supply optional features(aka facets) on an object without the need of letting the object to subclass or implement java interfaces. Facets allow leanback to re-compose optional features from leanback ViewHolder to RecyclerView ViewHolder. A typical "facet" class is ItemAlignmentFacet
that defines how to align a ViewHolder inside VerticalGridView or HorizontalGridView. A FacetProvider could be retrieved from two sources by VerticalGridView/HorizontalGridView in the following order.
-
ViewHolder based facet:
RecyclerView.ViewHolder can implement FacetProvider. If app uses leanback Presenter.ViewHolder, the facet of Presenter.ViewHolder will be relayed by ItemBridgeAdapter.ViewHolder which is a wrapper of Presenter.ViewHolder. ViewHolder based facet is used less frequently than item view type based facet because in most cases ViewHolders of same type share the same alignment definition.
For example, app calls viewHolder.setFacet(ItemAlignmentFacet.class, itemAlignmentFacet) to set alignment of the ViewHolder instance.
-
RecyclerView item view type based facet:
RecyclerView.Adapter can implement
FacetProviderAdapter
which returns FacetProvider for each item view type. If app uses leanback ObjectAdapter and Presenter, app wraps the ObjectAdapter and Presenter usingItemBridgeAdapter
. The implementation ofgetFacetProvider
will return the FacetProvider implemented byPresenter
which is mapped to the item view type.For example, app calls presenter.setFacet(ItemAlignmentFacet.class, itemAlignmentFacet) to set alignment of all ViewHolders created by this Presenter.