public class

ListRowPresenter.SelectItemViewHolderTask

extends Presenter.ViewHolderTask

 java.lang.Object

androidx.leanback.widget.Presenter.ViewHolderTask

↳androidx.leanback.widget.ListRowPresenter.SelectItemViewHolderTask

Overview

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

Constructors
publicSelectItemViewHolderTask(int itemPosition)

Methods
public intgetItemPosition()

Returns the adapter position of item to select.

public Presenter.ViewHolderTaskgetItemTask()

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

public booleanisSmoothScroll()

Returns true if smooth scrolling to the item false otherwise.

public voidrun(Presenter.ViewHolder holder)

Called to perform a task on view holder.

public voidsetItemPosition(int itemPosition)

Sets the adapter position of item to select.

public voidsetItemTask(Presenter.ViewHolderTask itemTask)

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

public voidsetSmoothScroll(boolean smoothScroll)

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

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public SelectItemViewHolderTask(int itemPosition)

Methods

public void setItemPosition(int itemPosition)

Sets the adapter position of item to select.

Parameters:

itemPosition: Position of the item in adapter.

public int getItemPosition()

Returns the adapter position of item to select.

Returns:

The adapter position of item to select.

public void setSmoothScroll(boolean smoothScroll)

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

Parameters:

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

public boolean isSmoothScroll()

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

Returns:

True for smooth scrolling to the item, false otherwise.

public Presenter.ViewHolderTask getItemTask()

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

Returns:

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

public void setItemTask(Presenter.ViewHolderTask itemTask)

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

Parameters:

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

public void run(Presenter.ViewHolder holder)

Called to perform a task on view holder.

Parameters:

holder: The view holder to perform task.