Skip to content

Most visited

Recently visited

navigation

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
From class android.view.ViewGroup
From class android.view.View

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.0.0
VerticalGridView (Context context)

Parameters
context Context

VerticalGridView

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

Parameters
context Context

attrs AttributeSet

VerticalGridView

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

Parameters
context Context

attrs AttributeSet

defStyle int

Public methods

setColumnWidth

added in version 22.0.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.0.0
void setNumColumns (int numColumns)

Sets the number of columns. Defaults to one.

Parameters
numColumns int

Protected methods

initAttributes

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

Parameters
context Context

attrs AttributeSet

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.