ListRowPresenter.SelectItemViewHolderTask

class ListRowPresenter.SelectItemViewHolderTask : Presenter.ViewHolderTask


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

Public functions

Int

Returns the adapter position of item to select.

Presenter.ViewHolderTask?

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

Boolean

Returns true if smooth scrolling to the item false otherwise.

Unit

Called to perform a task on view holder.

Unit
setItemPosition(itemPosition: Int)

Sets the adapter position of item to select.

Unit

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

Unit
setSmoothScroll(smoothScroll: Boolean)

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

Public constructors

SelectItemViewHolderTask

Added in 1.1.0
SelectItemViewHolderTask(itemPosition: Int)

Public functions

getItemPosition

Added in 1.1.0
fun getItemPosition(): Int

Returns the adapter position of item to select.

Returns
Int

The adapter position of item to select.

getItemTask

Added in 1.1.0
fun getItemTask(): Presenter.ViewHolderTask?

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

Returns
Presenter.ViewHolderTask?

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

isSmoothScroll

Added in 1.1.0
fun isSmoothScroll(): Boolean

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

Returns
Boolean

True for smooth scrolling to the item, false otherwise.

run

fun run(holder: Presenter.ViewHolder?): Unit

Called to perform a task on view holder.

Parameters
holder: Presenter.ViewHolder?

The view holder to perform task.

setItemPosition

Added in 1.1.0
fun setItemPosition(itemPosition: Int): Unit

Sets the adapter position of item to select.

Parameters
itemPosition: Int

Position of the item in adapter.

setItemTask

Added in 1.1.0
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

Added in 1.1.0
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.