added in version 22.1.0
belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1

VerticalGridView

public class VerticalGridView
extends BaseGridView

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.support.v7.widget.RecyclerView
         ↳ android.support.v17.leanback.widget.BaseGridView
           ↳ android.support.v17.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.

Summary

Inherited XML attributes

From class android.support.v7.widget.RecyclerView

Inherited constants

From class android.support.v17.leanback.widget.BaseGridView
From class android.support.v7.widget.RecyclerView
From class android.view.ViewGroup
From class android.view.View

Inherited fields

From class android.view.View

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

From class android.support.v17.leanback.widget.BaseGridView
From class android.support.v7.widget.RecyclerView
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.support.v4.view.ScrollingView
From interface android.support.v4.view.NestedScrollingChild2
From interface android.view.ViewParent
From interface android.view.ViewManager
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource
From interface android.support.v4.view.NestedScrollingChild

Public constructors

VerticalGridView

added in version 22.1.0
VerticalGridView (Context context)

Parameters
context Context

VerticalGridView

added in version 22.1.0
VerticalGridView (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

VerticalGridView

added in version 22.1.0
VerticalGridView (Context context, 
                AttributeSet attrs, 
                int defStyle)

Parameters
context Context

attrs AttributeSet

defStyle int

Public methods

setColumnWidth

added in version 22.1.0
void setColumnWidth (int width)

Sets the column width.

Parameters
width int: May be WRAP_CONTENT, or a size in pixels. If zero, column width will be fixed based on number of columns and view width.

setNumColumns

added in version 22.1.0
void setNumColumns (int numColumns)

Sets the number of columns. Defaults to one.

Parameters
numColumns int

Protected methods

initAttributes

added in version 22.1.0
void initAttributes (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet