SelectItemViewHolderTask

open class SelectItemViewHolderTask : Presenter.ViewHolderTask
kotlin.Any
   ↳ androidx.leanback.widget.Presenter.ViewHolderTask
   ↳ androidx.leanback.widget.ListRowPresenter.SelectItemViewHolderTask

A task on the ListRowPresenter.ViewHolder that can select an item by position in the HorizontalGridView and perform an optional item task on it.

Summary

Public constructors

<init>(itemPosition: Int)

Public methods

open Int

Returns the adapter position of item to select.

open Presenter.ViewHolderTask!

Returns optional task to run when the item is selected, null for no task.

open Boolean

Returns true if smooth scrolling to the item false otherwise.

open Unit

open Unit
setItemPosition(itemPosition: Int)

Sets the adapter position of item to select.

open Unit

Sets task to run when the item is selected, null for no task.

open Unit
setSmoothScroll(smoothScroll: Boolean)

Sets smooth scrolling to the item or jump to the item without scrolling.

Public constructors

<init>

SelectItemViewHolderTask(itemPosition: Int)

Public methods

getItemPosition

open fun getItemPosition(): Int

Returns the adapter position of item to select.

Return
Int: The adapter position of item to select.

getItemTask

open fun getItemTask(): Presenter.ViewHolderTask!

Returns optional task to run when the item is selected, null for no task.

Return
Presenter.ViewHolderTask!: Optional task to run when the item is selected, null for no task.

isSmoothScroll

open fun isSmoothScroll(): Boolean

Returns true if smooth scrolling to the item false otherwise. By default it is true.

Return
Boolean: True for smooth scrolling to the item, false otherwise.

run

open fun run(holder: Presenter.ViewHolder!): Unit

setItemPosition

open fun setItemPosition(itemPosition: Int): Unit

Sets the adapter position of item to select.

Parameters
itemPosition Int: Position of the item in adapter.

setItemTask

open fun setItemTask(itemTask: Presenter.ViewHolderTask!): Unit

Sets task to run when the item is selected, null for no task.

Parameters
itemTask Presenter.ViewHolderTask!: Optional task to run when the item is selected, null for no task.

setSmoothScroll

open fun setSmoothScroll(smoothScroll: Boolean): Unit

Sets smooth scrolling to the item or jump to the item without scrolling. By default it is true.

Parameters
smoothScroll Boolean: True for smooth scrolling to the item, false otherwise.