Android APIs
public class

VerticalGridPresenter

extends Presenter
java.lang.Object
   ↳ android.support.v17.leanback.widget.Presenter
     ↳ android.support.v17.leanback.widget.VerticalGridPresenter

Class Overview

A presenter that renders objects in a vertical grid.

Summary

Nested Classes
class VerticalGridPresenter.ViewHolder  
Public Constructors
VerticalGridPresenter()
VerticalGridPresenter(int zoomFactor)
Public Methods
int getNumberOfColumns()
Returns the number of columns in the vertical grid.
final OnItemClickedListener getOnItemClickedListener()
Returns the item clicked listener.
final OnItemSelectedListener getOnItemSelectedListener()
Returns the item selected listener.
final boolean getShadowEnabled()
Returns true if child shadow is enabled.
boolean isUsingDefaultShadow()
Returns true if opticalBounds is supported (SDK >= 18) so that default shadow is applied to each individual child of VerticalGridView.
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 setNumberOfColumns(int numColumns)
Sets the number of columns in the vertical grid.
final void setOnItemClickedListener(OnItemClickedListener listener)
Sets the item clicked listener.
final void setOnItemSelectedListener(OnItemSelectedListener 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.
void initializeGridViewHolder(VerticalGridPresenter.ViewHolder vh)
[Expand]
Inherited Methods
From class android.support.v17.leanback.widget.Presenter
From class java.lang.Object

Public Constructors

public VerticalGridPresenter ()

public VerticalGridPresenter (int zoomFactor)

Public Methods

public int getNumberOfColumns ()

Returns the number of columns in the vertical grid.

public final OnItemClickedListener getOnItemClickedListener ()

Returns the item clicked listener.

public final OnItemSelectedListener getOnItemSelectedListener ()

Returns the item selected listener.

public final boolean getShadowEnabled ()

Returns true if child shadow is enabled. This is not only for enable/disable default shadow implementation but also subclass must respect this flag.

public boolean isUsingDefaultShadow ()

Returns true if opticalBounds is supported (SDK >= 18) so that default shadow is applied to each individual child of VerticalGridView. Subclass may return false to disable.

public void onBindViewHolder (Presenter.ViewHolder viewHolder, Object item)

Binds a View to an item.

public final VerticalGridPresenter.ViewHolder onCreateViewHolder (ViewGroup parent)

Creates a new View.

public void onUnbindViewHolder (Presenter.ViewHolder viewHolder)

Unbinds a View from an item. Any expensive references may be released here, and any fields that are not bound for every item should be cleared here.

public void setNumberOfColumns (int numColumns)

Sets the number of columns in the vertical grid.

public final void setOnItemClickedListener (OnItemClickedListener listener)

Sets the item clicked listener. OnItemClickedListener will override View.OnClickListener that item presenter sets during onCreateViewHolder(ViewGroup). So in general, developer should choose one of the listeners but not both.

public final void setOnItemSelectedListener (OnItemSelectedListener listener)

Sets the item selected listener. Since this is a grid the row parameter is always null.

public final void setShadowEnabled (boolean enabled)

Enable or disable child shadow. This is not only for enable/disable default shadow implementation but also subclass must respect this flag.

Protected Methods

protected VerticalGridPresenter.ViewHolder createGridViewHolder (ViewGroup parent)

Subclass may override this to inflate a different layout.

protected void initializeGridViewHolder (VerticalGridPresenter.ViewHolder vh)