ItemBridgeAdapter

open class ItemBridgeAdapter : FacetProviderAdapter
kotlin.Any
   ↳ androidx.leanback.widget.ItemBridgeAdapter

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

Summary

Nested classes
open

Interface for listening to ViewHolder operations.

open

ViewHolder for the ItemBridgeAdapter.

abstract

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

Public constructors
<init>(adapter: ObjectAdapter!, presenterSelector: PresenterSelector!)

<init>(adapter: ObjectAdapter!)

Public methods
open Unit

Clears the adapter.

ViewHolder!
onCreateViewHolder(parent: ViewGroup!, viewType: Int)

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

open ArrayList<Presenter!>!

Returns the presenter mapper array.

Unit
onViewDetachedFromWindow(holder: ViewHolder!)

open Int

open Long
getItemId(position: Int)

open Unit

Sets the AdapterListener.

open Unit

Sets the presenter mapper array.

open Unit

Sets the Wrapper.

Boolean
onFailedToRecycleView(holder: ViewHolder!)

open Unit

Sets the ObjectAdapter.

Unit
onBindViewHolder(holder: ViewHolder!, position: Int)

Unit
onBindViewHolder(holder: ViewHolder!, position: Int, payloads: MutableList<Any?>!)

open Int
getItemViewType(position: Int)

open FacetProvider!

Unit
onViewRecycled(holder: ViewHolder!)

open ItemBridgeAdapter.Wrapper!

Returns the Wrapper.

open Unit
setPresenter(presenterSelector: PresenterSelector!)

Changes Presenter that creates and binds the view.

Unit
onViewAttachedToWindow(holder: ViewHolder!)

Protected methods
open Unit
onAddPresenter(presenter: Presenter!, type: Int)

Called when presenter is added to Adapter.

open Unit

Called when ViewHolder has been attached to window.

open Unit

Called when ViewHolder is created.

open Unit

Called when ViewHolder has been bound to data.

open Unit

Called when ViewHolder has been unbound from data.

open Unit

Called when ViewHolder has been detached from window.

Public constructors

<init>

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

<init>

ItemBridgeAdapter(adapter: ObjectAdapter!)

<init>

ItemBridgeAdapter()

Public methods

clear

open fun clear(): Unit

Clears the adapter.

onCreateViewHolder

fun onCreateViewHolder(parent: ViewGroup!, viewType: Int): ViewHolder!

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

getPresenterMapper

open fun getPresenterMapper(): ArrayList<Presenter!>!

Returns the presenter mapper array.

onViewDetachedFromWindow

fun onViewDetachedFromWindow(holder: ViewHolder!): Unit

getItemCount

open fun getItemCount(): Int

getItemId

open fun getItemId(position: Int): Long

setAdapterListener

open fun setAdapterListener(listener: ItemBridgeAdapter.AdapterListener!): Unit

Sets the AdapterListener.

setPresenterMapper

open fun setPresenterMapper(presenters: ArrayList<Presenter!>!): Unit

Sets the presenter mapper array.

setWrapper

open fun setWrapper(wrapper: ItemBridgeAdapter.Wrapper!): Unit

Sets the Wrapper.

onFailedToRecycleView

fun onFailedToRecycleView(holder: ViewHolder!): Boolean

setAdapter

open fun setAdapter(adapter: ObjectAdapter!): Unit

Sets the ObjectAdapter.

onBindViewHolder

fun onBindViewHolder(holder: ViewHolder!, position: Int): Unit

onBindViewHolder

fun onBindViewHolder(holder: ViewHolder!, position: Int, payloads: MutableList<Any?>!): Unit

getItemViewType

open fun getItemViewType(position: Int): Int

getFacetProvider

open fun getFacetProvider(type: Int): FacetProvider!

onViewRecycled

fun onViewRecycled(holder: ViewHolder!): Unit

getWrapper

open fun getWrapper(): ItemBridgeAdapter.Wrapper!

Returns the Wrapper.

setPresenter

open fun setPresenter(presenterSelector: PresenterSelector!): Unit

Changes Presenter that creates and binds the view.

Parameters
presenterSelector PresenterSelector!: Presenter that creates and binds the view.

onViewAttachedToWindow

fun onViewAttachedToWindow(holder: ViewHolder!): Unit

Protected methods

onAddPresenter

protected open fun onAddPresenter(presenter: Presenter!, type: Int): Unit

Called when presenter is added to Adapter.

onAttachedToWindow

protected open fun onAttachedToWindow(viewHolder: ItemBridgeAdapter.ViewHolder!): Unit

Called when ViewHolder has been attached to window.

onCreate

protected open fun onCreate(viewHolder: ItemBridgeAdapter.ViewHolder!): Unit

Called when ViewHolder is created.

onBind

protected open fun onBind(viewHolder: ItemBridgeAdapter.ViewHolder!): Unit

Called when ViewHolder has been bound to data.

onUnbind

protected open fun onUnbind(viewHolder: ItemBridgeAdapter.ViewHolder!): Unit

Called when ViewHolder has been unbound from data.

onDetachedFromWindow

protected open fun onDetachedFromWindow(viewHolder: ItemBridgeAdapter.ViewHolder!): Unit

Called when ViewHolder has been detached from window.