ListRowPresenter.SelectItemViewHolderTask


public class ListRowPresenter.SelectItemViewHolderTask extends 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

SelectItemViewHolderTask(int itemPosition)

Public methods

int

Returns the adapter position of item to select.

@Nullable 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.

void

Called to perform a task on view holder.

void
setItemPosition(int itemPosition)

Sets the adapter position of item to select.

void

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

void
setSmoothScroll(boolean smoothScroll)

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

Public constructors

SelectItemViewHolderTask

Added in 1.1.0
public SelectItemViewHolderTask(int itemPosition)

Public methods

getItemPosition

Added in 1.1.0
public int getItemPosition()

Returns the adapter position of item to select.

Returns
int

The adapter position of item to select.

getItemTask

Added in 1.1.0
public @Nullable Presenter.ViewHolderTask getItemTask()

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

Returns
@Nullable Presenter.ViewHolderTask

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

isSmoothScroll

Added in 1.1.0
public boolean isSmoothScroll()

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

public void run(@Nullable Presenter.ViewHolder holder)

Called to perform a task on view holder.

Parameters
@Nullable Presenter.ViewHolder holder

The view holder to perform task.

setItemPosition

Added in 1.1.0
public void setItemPosition(int itemPosition)

Sets the adapter position of item to select.

Parameters
int itemPosition

Position of the item in adapter.

setItemTask

Added in 1.1.0
public void setItemTask(@Nullable Presenter.ViewHolderTask itemTask)

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

Parameters
@Nullable Presenter.ViewHolderTask itemTask

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

setSmoothScroll

Added in 1.1.0
public void setSmoothScroll(boolean smoothScroll)

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

Parameters
boolean smoothScroll

True for smooth scrolling to the item, false otherwise.