Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.


interface FacetProviderAdapter

Optional interface that implemented by RecyclerView.Adapter to query FacetProvider for a given item view type within Adapter. Note that RecyclerView.ViewHolder may also implement FacetProvider which has a higher priority than the one returned fromgetFacetProvider(int).

A typical use case of FacetProvider is that VerticalGridView/HorizontalGridView retrieves ItemAlignmentFacet for a ViewHolder or a item view type.

App does not need implement FacetProviderAdapter when using ObjectAdapter, Presenter and ItemBridgeAdapter. ItemBridgeAdapter implemented FacetProviderAdapter, it returns the FacetProvider implemented by Presenter which is mapped to the item view type.

For example, app calls presenter.setFacet(ItemAlignmentFacet.class, itemAlignmentFacet) to set alignment of the ViewHolders created by this Presenter.


Public methods

abstract FacetProvider!

Queries FacetProvider for a given type within Adapter.

Public methods


abstract fun getFacetProvider(type: Int): FacetProvider!

Queries FacetProvider for a given type within Adapter.

type Int: type of the item.
FacetProvider!: Facet provider for the type.