public class ItemBridgeAdapter
extends Adapter implements FacetProviderAdapter

   ↳ androidx.recyclerview.widget.RecyclerView.Adapter
     ↳ androidx.leanback.widget.ItemBridgeAdapter

Bridge from Presenter to RecyclerView.Adapter. Public to allow use by third party Presenters.


Nested classes

class ItemBridgeAdapter.AdapterListener

Interface for listening to ViewHolder operations. 

class ItemBridgeAdapter.ViewHolder

ViewHolder for the ItemBridgeAdapter. 

class ItemBridgeAdapter.Wrapper

Interface for wrapping a view created by a Presenter into another view. 

Public constructors

ItemBridgeAdapter(ObjectAdapter adapter, PresenterSelector presenterSelector)
ItemBridgeAdapter(ObjectAdapter adapter)

Public methods

void clear()

Clears the adapter.

FacetProvider getFacetProvider(int type)

Queries FacetProvider for a given type within Adapter.

int getItemCount()

Returns the total number of items in the data set held by the adapter.

long getItemId(int position)

Return the stable ID for the item at position.

int getItemViewType(int position)

Return the view type of the item at position for the purposes of view recycling.

ArrayList<Presenter> getPresenterMapper()

Returns the presenter mapper array.

ItemBridgeAdapter.Wrapper getWrapper()

Returns the ItemBridgeAdapter.Wrapper.

final void onBindViewHolder(RecyclerView.ViewHolder holder, int position, List payloads)

Called by RecyclerView to display the data at the specified position.

final void onBindViewHolder(RecyclerView.ViewHolder holder, int position)

Called by RecyclerView to display the data at the specified position.

final RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType)

View.OnFocusChangeListener that assigned in Presenter.onCreateViewHolder(ViewGroup) may be chained, user should never change View.OnFocusChangeListener after that.

final boolean onFailedToRecycleView(RecyclerView.ViewHolder holder)

Called by the RecyclerView if a ViewHolder created by this Adapter cannot be recycled due to its transient state.

final void onViewAttachedToWindow(RecyclerView.ViewHolder holder)

Called when a view created by this adapter has been attached to a window.

final void onViewDetachedFromWindow(RecyclerView.ViewHolder holder)

Called when a view created by this adapter has been detached from its window.

final void onViewRecycled(RecyclerView.ViewHolder holder)

Called when a view created by this adapter has been recycled.

void setAdapter(ObjectAdapter adapter)

Sets the ObjectAdapter.

void setAdapterListener(ItemBridgeAdapter.AdapterListener listener)

Sets the AdapterListener.

void setPresenter(PresenterSelector presenterSelector)

Changes Presenter that creates and binds the view.

void setPresenterMapper(ArrayList<Presenter> presenters)

Sets the presenter mapper array.

void setWrapper(ItemBridgeAdapter.Wrapper wrapper)

Sets the ItemBridgeAdapter.Wrapper.

Protected methods

void onAddPresenter(Presenter presenter, int type)

Called when presenter is added to Adapter.

void onAttachedToWindow(ItemBridgeAdapter.ViewHolder viewHolder)

Called when ViewHolder has been attached to window.