Stay organized with collections Save and categorize content based on your preferences.
added in version 22.1.0
belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1

BaseGridView

public abstract class BaseGridView
extends RecyclerView

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.support.v7.widget.RecyclerView
         ↳ android.support.v17.leanback.widget.BaseGridView
Known Direct Subclasses


An abstract base class for vertically and horizontally scrolling lists. The items come from the RecyclerView.Adapter associated with this view. Do not directly use this class, use VerticalGridView and HorizontalGridView. The class is not intended to be subclassed other than VerticalGridView and HorizontalGridView.

Summary

Nested classes

interface BaseGridView.OnKeyInterceptListener

Listener for intercepting key dispatch events. 

interface BaseGridView.OnMotionInterceptListener

Listener for intercepting generic motion dispatch events. 

interface BaseGridView.OnTouchInterceptListener

Listener for intercepting touch dispatch events. 

interface BaseGridView.OnUnhandledKeyListener

 

Inherited XML attributes

From class android.support.v7.widget.RecyclerView

Constants

float ITEM_ALIGN_OFFSET_PERCENT_DISABLED

Value indicates that percent is not used.

int SAVE_ALL_CHILD

Save on screen views plus save off screen child views without any limitation.

int SAVE_LIMITED_CHILD

Save on screen views plus save off screen child views states up to getSaveChildrenLimitNumber().

int SAVE_NO_CHILD

Dont save states of any child views.

int SAVE_ON_SCREEN_CHILD

Only save on screen child views, the states are lost when they become off screen.

int WINDOW_ALIGN_BOTH_EDGE

The first item and last item are aligned with the two edges of the viewport.

int WINDOW_ALIGN_HIGH_EDGE

The last item is aligned with the high edge of the viewport when navigating to the end of list.

int WINDOW_ALIGN_LOW_EDGE

The first item is aligned with the low edge of the viewport.

int WINDOW_ALIGN_NO_EDGE

The focused item always stays in a key line location.

float WINDOW_ALIGN_OFFSET_PERCENT_DISABLED

Value indicates that percent is not used.

Inherited constants

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 methods

void addOnChildViewHolderSelectedListener(OnChildViewHolderSelectedListener listener)

Registers a callback to be invoked when an item in BaseGridView has been selected.

void animateIn()

Undo animateOut() and slide in child views.

void animateOut()

Temporarily slide out child views to bottom (for VerticalGridView) or end (for HorizontalGridView).

boolean dispatchKeyEvent(KeyEvent event)
boolean dispatchTouchEvent(MotionEvent event)
View focusSearch(int direction)
int getChildDrawingOrder(int childCount, int i)
int getHorizontalMargin()

This method was deprecated in API level 26.1.0. Use getHorizontalSpacing()

int getHorizontalSpacing()

Returns the horizontal spacing in pixels between two child items.

int getInitialPrefetchItemCount()

Gets the number of items to prefetch in collectInitialPrefetchPositions(int, RecyclerView.LayoutManager.LayoutPrefetchRegistry), which defines how many inner items should be prefetched when this GridView is nested inside another RecyclerView.

int getItemAlignmentOffset()

Returns number of pixels to the end of low edge.

float getItemAlignmentOffsetPercent()

Returns the offset percent for item alignment in addition to getItemAlignmentOffset().

int getItemAlignmentViewId()

Returns the id of the view to align with, or <