VerticalGridPresenter

public class VerticalGridPresenter
extends Presenter

java.lang.Object
   ↳ androidx.leanback.widget.Presenter
     ↳ androidx.leanback.widget.VerticalGridPresenter


A presenter that renders objects in a VerticalGridView.

Summary

Nested classes

class VerticalGridPresenter.ViewHolder

ViewHolder for the VerticalGridPresenter. 

Public constructors

VerticalGridPresenter()

Constructs a VerticalGridPresenter with defaults.

VerticalGridPresenter(int focusZoomFactor)

Constructs a VerticalGridPresenter with the given parameters.

VerticalGridPresenter(int focusZoomFactor, boolean useFocusDimmer)

Constructs a VerticalGridPresenter with the given parameters.

Public methods

final boolean areChildRoundedCornersEnabled()

Returns true if rounded corners are enabled for children of this row.

final void enableChildRoundedCorners(boolean enable)

Enables or disabled rounded corners on children of this row.

final int getFocusZoomFactor()

Returns the zoom factor used for focus highlighting.

final boolean getKeepChildForeground()

Returns true if keeps foreground of child of this grid, the foreground will not be used for overlay color.

int getNumberOfColumns()

Returns the number of columns in the vertical grid.

final OnItemViewClickedListener getOnItemViewClickedListener()

Returns the item clicked listener.

final OnItemViewSelectedListener getOnItemViewSelectedListener()

Returns the item selected listener.

final boolean getShadowEnabled()

Returns true if child shadow is enabled.

final boolean isFocusDimmerUsed()

Returns true if the focus dimmer is used for focus highlighting; false otherwise.

boolean isUsingDefaultShadow()

Default implementation returns true if SDK version >= 21, shadow (either static or z-order based) will be applied to each individual child of VerticalGridView.

boolean isUsingZOrder(Context context)

Returns true if SDK >= L, where Z shadow is enabled so that Z order is enabled on each child of vertical grid.

void onBindViewHolder(Presenter.ViewHolder viewHolder, Object item)

Binds a View to an item.

final VerticalGridPresenter.ViewHolder onCreateViewHolder(ViewGroup parent)

Creates a new View.

void onUnbindViewHolder(Presenter.ViewHolder viewHolder)

Unbinds a View from an item.

void setEntranceTransitionState(VerticalGridPresenter.ViewHolder holder, boolean afterEntrance)

Changes the visibility of views.

final void setKeepChildForeground(boolean keep)

Set if keeps foreground of child of this grid, the foreground will not be used for overlay color.

void setNumberOfColumns(int numColumns)

Sets the number of columns in the vertical grid.

final void setOnItemViewClickedListener(OnItemViewClickedListener listener)

Sets the item clicked listener.

final void setOnItemViewSelectedListener(OnItemViewSelectedListener listener)

Sets the item selected listener.

final void setShadowEnabled(boolean enabled)

Enable or disable child shadow.

Protected methods

VerticalGridPresenter.ViewHolder createGridViewHolder(ViewGroup parent)

Subclass may override this to inflate a different layout.

ShadowOverlayHelper.Options createShadowOverlayOptions()

Create ShadowOverlayHelper Options.

void initializeGridViewHolder(VerticalGridPresenter.ViewHolder vh)

Called after a VerticalGridPresenter.ViewHolder is created.

Inherited methods