Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
added in version 1.0.0
belongs to Maven artifact androidx.leanback:leanback:1.0.0-rc01


public class VerticalGridView
extends BaseGridView

   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ androidx.recyclerview.widget.RecyclerView
         ↳ androidx.leanback.widget.BaseGridView
           ↳ androidx.leanback.widget.VerticalGridView

A ViewGroup that shows items in a vertically scrolling list. The items come from the RecyclerView.Adapter associated with this view.

RecyclerView.Adapter can optionally implement FacetProviderAdapter which provides FacetProvider for a given view type; RecyclerView.ViewHolder can also implement FacetProvider. Facet from ViewHolder has a higher priority than the one from FacetProviderAdapter associated with viewType. Supported optional facets are:

  1. ItemAlignmentFacet When this facet is provided by ViewHolder or FacetProviderAdapter, it will override the item alignment settings set on VerticalGridView. This facet also allows multiple alignment positions within one ViewHolder.


Inherited XML attributes

Inherited constants

Inherited fields

Public constructors

VerticalGridView(Context context)
VerticalGridView(Context context, AttributeSet attrs)
VerticalGridView(Context context, AttributeSet attrs, int defStyle)

Public methods

void setColumnWidth(int width)

Sets the column width.

void setNumColumns(int numColumns)

Sets the number of columns.

Protected methods

void initAttributes(Context context, AttributeSet attrs)

Inherited methods

Public constructors


added in version 1.0.0
public VerticalGridView (Context context)

context Context


added in version 1.0.0
public VerticalGridView (Context context, 
                AttributeSet attrs)

context Context