Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

BaseGridView

abstract class BaseGridView : RecyclerView
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ androidx.recyclerview.widget.RecyclerView
   ↳ androidx.leanback.widget.BaseGridView

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
abstract

Listener for intercepting key dispatch events.

abstract

Interface for receiving notification when BaseGridView has completed a full layout calculation.

abstract

Listener for intercepting generic motion dispatch events.

abstract

Listener for intercepting touch dispatch events.

abstract

abstract

Defines behavior of duration and interpolator for smoothScrollBy().

Constants
static Float

Value indicates that percent is not used.

static Int

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

static Int

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

static Int

Dont save states of any child views.

static Int

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

static Int

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

static Int

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

static Int

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

static Int

The focused item always stays in a key line location.

static Float

Value indicates that percent is not used.

Inherited constants
Public methods
open Unit

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

Unit

Registers a callback to be invoked when the BaseGridView completes a full layout calculation.

open Unit

Undo animateOut() and slide in child views.

open Unit

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

open Boolean

open Boolean

open View!
focusSearch(direction: Int)

open Int
getChildDrawingOrder(childCount: Int, i: Int)

open Int

Returns the spacing in pixels between two child items horizontally.

open Int

Returns the horizontal spacing in pixels between two child items.

open Int

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

open Int

Returns number of pixels to the end of low edge.

open Float

Returns the offset percent for item alignment in addition to .

open Int

Returns the id of the view to align with, or android.view.View#NO_ID for the root RecyclerView.ViewHolder#itemView.

open BaseGridView.OnUnhandledKeyListener!

Returns the unhandled key listener.

Int

Returns the limit used when when getSaveChildrenPolicy() is SAVE_LIMITED_CHILD

Int

Returns the policy for saving children.

open Int

Returns the adapter position of selected item.

open BaseGridView.SmoothScrollByBehavior?

Returns custom behavior for smoothScrollBy().

Int

When holding DPAD, DPAD events are generated faster than the grid view can scroll.

Float

open Int

Returns the spacing in pixels between two child items vertically.

open Int

Returns the vertical spacing in pixels between two child items.

open Unit
getViewSelectedOffsets(view: View!, offsets: IntArray!)

Returns the x/y offsets to final position from current position if the view is selected.

open Int

Returns the method for focused item alignment in the view.

open Int

Returns the offset in pixels for window alignment key line.

open Float

Returns the offset percent for window alignment key line in addition to getWindowAlignmentOffset().

open Boolean

open Boolean

Returns true if the view at the given position has a same row sibling in front of it.

open Boolean

Returns true if an animation will run when a child changes size or when adding or removing a child.

open Boolean

Returns true if draws selected child at last, false otherwise.

Boolean

Returns true if focus search is disabled.

open Boolean

Returns true if applies padding to item alignment when getItemAlignmentOffsetPercent() is 0 or 100; returns false otherwise.

open Boolean

Returns true if scrolling is enabled, false otherwise.

open Boolean

Returns whether prefer key line over high edge when WINDOW_ALIGN_HIGH_EDGE is used.

open Boolean

Returns whether prefer key line over low edge when WINDOW_ALIGN_LOW_EDGE is used.

open Boolean
onRequestFocusInDescendants(direction: Int, previouslyFocusedRect: Rect!)

open Unit
onRtlPropertiesChanged(layoutDirection: Int)

Notify layout manager that layout directionality has been updated

open Unit

Remove the callback invoked when an item in BaseGridView has been selected.

Unit

Removes a callback to be invoked when the BaseGridView completes a full layout calculation.

open Unit
removeView(view: View!)

open Unit
removeViewAt(index: Int)

open Unit
scrollToPosition(position: Int)

open Unit
setAnimateChildLayout(animateChildLayout: Boolean)

Sets whether ItemAnimator should run when a child changes size or when adding or removing a child.

open Unit

Changes and overrides children's visibility.

open Unit

Enables or disables the default "focus draw at last" order rule.

Unit

Disables or enables focus search.

open Unit
setGravity(gravity: Int)

Sets the gravity used for child view positioning.

open Unit

open Unit

Sets the spacing in pixels between two child items horizontally.

open Unit

Sets the horizontal spacing in pixels between two child items.

open Unit

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

open Unit

Sets number of pixels to the end of low edge.

open Unit

Sets the offset percent for item alignment in addition to .

open Unit

Sets whether applies padding to item alignment when getItemAlignmentOffsetPercent() is 0 or 100.

open Unit

Sets the id of the view to align with.

open Unit
setItemMargin(margin: Int)

Sets the spacing in pixels between two child items.

open Unit
setItemSpacing(spacing: Int)

Sets the vertical and horizontal spacing in pixels between two child items.

open Unit
setLayoutEnabled(layoutEnabled: Boolean)

Enables or disables layout.

open Unit

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

open Unit

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

open Unit

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

open Unit

Sets the key intercept listener.

open Unit

Sets the generic motion intercept listener.

open Unit

Sets the touch intercept listener.

open Unit

Sets the unhandled key listener.

open Unit
setPruneChild(pruneChild: Boolean)

Enables or disables pruning of children.

Unit

Sets the limit number when getSaveChildrenPolicy() is SAVE_LIMITED_CHILD.

Unit

Sets the policy for saving children.

open Unit
setScrollEnabled(scrollEnabled: Boolean)

Enables or disables scrolling.

open Unit

Changes the selected item immediately without animation.

open Unit
setSelectedPosition(position: Int, scrollExtra: Int)

Changes the selected item immediately without animation, scrollExtra is applied in primary scroll direction.

open Unit

Perform a task on ViewHolder at given position after scroll to it.

open Unit

Changes the selected item and run an animation to scroll to the target position.

open Unit

Perform a task on ViewHolder at given position after smooth scrolling to it.

Unit

Set custom behavior for smoothScrollBy().

Unit

When holding DPAD, DPAD events are generated faster than the grid view can scroll.

Unit
setSmoothScrollSpeedFactor(smoothScrollSpeedFactor: Float)

Set factor of how slow the smoothScroller should run.

open Unit

Sets the spacing in pixels between two child items vertically.

open Unit

Sets the vertical spacing in pixels between two child items.

open Unit
setWindowAlignment(windowAlignment: Int)

Sets the method for focused item alignment in the view.

open Unit

Sets the offset in pixels for window alignment key line.

open Unit

Sets the offset percent for window alignment key line in addition to .

open Unit

Returns whether prefer key line over high edge when WINDOW_ALIGN_HIGH_EDGE is used.

open Unit

Sets whether prefer key line over low edge when WINDOW_ALIGN_LOW_EDGE is used.

open Unit
smoothScrollBy(dx: Int, dy: Int)

open Unit
smoothScrollBy(dx: Int, dy: Int, @Nullable interpolator: Interpolator?)

open Unit

Protected methods
open Boolean

open Unit
onFocusChanged(gainFocus: Boolean, direction: Int, previouslyFocusedRect: Rect?)

Inherited functions