public class VerticalGridView extends RecyclerView
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:
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.
Modifier and Type | Class and Description |
---|---|
static interface |
BaseGridView.OnKeyInterceptListener
Listener for intercepting key dispatch events.
|
static interface |
BaseGridView.OnMotionInterceptListener
Listener for intercepting generic motion dispatch events.
|
static interface |
BaseGridView.OnTouchInterceptListener
Listener for intercepting touch dispatch events.
|
static interface |
BaseGridView.OnUnhandledKeyListener |
RecyclerView.Adapter<VH extends RecyclerView.ViewHolder>, RecyclerView.AdapterDataObserver, RecyclerView.ChildDrawingOrderCallback, RecyclerView.ItemAnimator, RecyclerView.ItemDecoration, RecyclerView.LayoutManager, RecyclerView.LayoutParams, RecyclerView.OnChildAttachStateChangeListener, RecyclerView.OnFlingListener, RecyclerView.OnItemTouchListener, RecyclerView.OnScrollListener, RecyclerView.RecycledViewPool, RecyclerView.Recycler, RecyclerView.RecyclerListener, RecyclerView.SavedState, RecyclerView.SimpleOnItemTouchListener, RecyclerView.SmoothScroller, RecyclerView.State, RecyclerView.ViewCacheExtension, RecyclerView.ViewHolder
ViewGroup.MarginLayoutParams, ViewGroup.OnHierarchyChangeListener
View.AccessibilityDelegate, View.BaseSavedState, View.DragShadowBuilder, View.DrawingCacheQuality, View.FindViewFlags, View.FocusableMode, View.FocusDirection, View.FocusRealDirection, View.LayoutDir, View.MeasureSpec, View.OnApplyWindowInsetsListener, View.OnAttachStateChangeListener, View.OnClickListener, View.OnContextClickListener, View.OnCreateContextMenuListener, View.OnDragListener, View.OnFocusChangeListener, View.OnGenericMotionListener, View.OnHoverListener, View.OnKeyListener, View.OnLayoutChangeListener, View.OnLongClickListener, View.OnScrollChangeListener, View.OnSystemUiVisibilityChangeListener, View.OnTouchListener, View.ResolvedLayoutDir, View.ScrollBarStyle, View.ScrollIndicators, View.TextAlignment, View.Visibility
Modifier and Type | Field and Description |
---|---|
static int |
FOCUS_SCROLL_ALIGNED
Always keep focused item at a aligned position.
|
static int |
FOCUS_SCROLL_ITEM
Scroll to make the focused item inside client area.
|
static int |
FOCUS_SCROLL_PAGE
Scroll a page of items when focusing to item outside the client area.
|
static float |
ITEM_ALIGN_OFFSET_PERCENT_DISABLED
Value indicates that percent is not used.
|
static int |
SAVE_ALL_CHILD
Save on screen views plus save off screen child views without any limitation.
|
static int |
SAVE_LIMITED_CHILD
Save on screen views plus save off screen child views states up to
getSaveChildrenLimitNumber() . |
static int |
SAVE_NO_CHILD
Dont save states of any child views.
|
static int |
SAVE_ON_SCREEN_CHILD
Only save on screen child views, the states are lost when they become off screen.
|
static int |
WINDOW_ALIGN_BOTH_EDGE
The first item and last item are aligned with the two edges of the
viewport.
|
static int |
WINDOW_ALIGN_HIGH_EDGE
The last item is aligned with the high edge of the viewport when
navigating to the end of list.
|
static int |
WINDOW_ALIGN_LOW_EDGE
The first item is aligned with the low edge of the viewport.
|
static int |
WINDOW_ALIGN_NO_EDGE
The focused item always stays in a middle location.
|
static float |
WINDOW_ALIGN_OFFSET_PERCENT_DISABLED
Value indicates that percent is not used.
|
HORIZONTAL, INVALID_TYPE, NO_ID, NO_POSITION, SCROLL_STATE_DRAGGING, SCROLL_STATE_IDLE, SCROLL_STATE_SETTLING, TOUCH_SLOP_DEFAULT, TOUCH_SLOP_PAGING, VERTICAL
CLIP_TO_PADDING_MASK, DEBUG_DRAW, FLAG_DISALLOW_INTERCEPT, FLAG_SUPPORT_STATIC_TRANSFORMATIONS, FLAG_USE_CHILD_DRAWING_ORDER, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, LAYOUT_MODE_CLIP_BOUNDS, LAYOUT_MODE_DEFAULT, LAYOUT_MODE_OPTICAL_BOUNDS, mDisappearingChildren, mGroupFlags, mOnHierarchyChangeListener, mPersistentDrawingCache, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE
ACCESSIBILITY_CURSOR_POSITION_UNDEFINED, ACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, DEBUG_LAYOUT_PROPERTY, DRAG_FLAG_GLOBAL, DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION, DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION, DRAG_FLAG_GLOBAL_URI_READ, DRAG_FLAG_GLOBAL_URI_WRITE, DRAG_FLAG_OPAQUE, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_ACCESSIBILITY_NODE_PROVIDERS, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, LAYOUT_DIRECTION_UNDEFINED, mAttributes, mBottom, mCachingFailed, mContext, mCurrentAnimation, mDebugViewAttributes, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, mInputEventConsistencyVerifier, mLayoutParams, mLeft, mPaddingBottom, mPaddingLeft, mPaddingRight, mPaddingTop, mParent, mRight, mScrollX, mScrollY, mTag, mTop, mUserPaddingBottom, mUserPaddingLeft, mUserPaddingRight, NAVIGATION_BAR_TRANSIENT, NAVIGATION_BAR_TRANSLUCENT, NAVIGATION_BAR_TRANSPARENT, NAVIGATION_BAR_UNHIDE, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, PUBLIC_STATUS_BAR_VISIBILITY_MASK, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_NONE, SCROLL_AXIS_VERTICAL, SCROLL_INDICATOR_BOTTOM, SCROLL_INDICATOR_END, SCROLL_INDICATOR_LEFT, SCROLL_INDICATOR_RIGHT, SCROLL_INDICATOR_START, SCROLL_INDICATOR_TOP, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, sPreserveMarginParamsInLayoutParamConversion, STATUS_BAR_DISABLE_BACK, STATUS_BAR_DISABLE_CLOCK, STATUS_BAR_DISABLE_EXPAND, STATUS_BAR_DISABLE_HOME, STATUS_BAR_DISABLE_NOTIFICATION_ALERTS, STATUS_BAR_DISABLE_NOTIFICATION_ICONS, STATUS_BAR_DISABLE_NOTIFICATION_TICKER, STATUS_BAR_DISABLE_RECENT, STATUS_BAR_DISABLE_SEARCH, STATUS_BAR_DISABLE_SYSTEM_INFO, STATUS_BAR_HIDDEN, STATUS_BAR_TRANSIENT, STATUS_BAR_TRANSLUCENT, STATUS_BAR_TRANSPARENT, STATUS_BAR_UNHIDE, STATUS_BAR_VISIBLE, SYSTEM_UI_CLEARABLE_FLAGS, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LIGHT_STATUS_BAR, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, SYSTEM_UI_TRANSPARENT, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_FIRST_STRONG_LTR, TEXT_DIRECTION_FIRST_STRONG_RTL, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y, Z
Constructor and Description |
---|
VerticalGridView(Context context) |
VerticalGridView(Context context,
AttributeSet attrs) |
VerticalGridView(Context context,
AttributeSet attrs,
int defStyle) |
Modifier and Type | Method and Description |
---|---|
void |
addOnChildViewHolderSelectedListener(OnChildViewHolderSelectedListener listener)
Registers a callback to be invoked when an item in BaseGridView has
been selected.
|
boolean |
dispatchGenericFocusedEvent(MotionEvent event)
Dispatch a generic motion event to the currently focused view.
|
boolean |
dispatchKeyEvent(KeyEvent event)
Dispatch a key event to the next view on the focus path.
|
boolean |
dispatchTouchEvent(MotionEvent event)
Pass the touch screen motion event down to the target view, or this
view if it is the target.
|
View |
focusSearch(int direction)
Find the nearest view in the specified direction that can take focus.
|
int |
getChildDrawingOrder(int childCount,
int i)
Returns the index of the child to draw for this iteration.
|
int |
getExtraLayoutSpace()
Returns pixels of extra space for layout child in invisible area.
|
int |
getFocusScrollStrategy()
Returns the strategy used to scroll in response to item focus changing.
|
int |
getHorizontalMargin()
Returns the margin in pixels between two child items horizontally.
|
int |
getItemAlignmentOffset()
Returns the absolute offset in pixels for item alignment.
|
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 zero for the item view itself.
|
BaseGridView.OnUnhandledKeyListener |
getOnUnhandledKeyListener()
Returns the unhandled key listener.
|
int |
getSaveChildrenLimitNumber()
Returns the limit used when when
getSaveChildrenPolicy() is
SAVE_LIMITED_CHILD |
int |
getSaveChildrenPolicy()
Returns the policy for saving children.
|
int |
getSelectedPosition()
Returns the selected item position.
|
int |
getSelectedSubPosition()
Returns the sub selected item position started from zero.
|
int |
getVerticalMargin()
Returns the margin in pixels between two child items vertically.
|
void |
getViewSelectedOffsets(View view,
int[] offsets)
Returns the x/y offsets to final position from current position if the view
is selected.
|
int |
getWindowAlignment()
Returns the method for focused item alignment in the view.
|
int |
getWindowAlignmentOffset()
Returns the offset in pixels for window alignment.
|
float |
getWindowAlignmentOffsetPercent()
Returns the offset percent for window alignment in addition to
getWindowAlignmentOffset() . |
boolean |
hasOverlappingRendering()
Returns whether this View has content which overlaps.
|
boolean |
hasPreviousViewInSameRow(int position)
Returns true if the view at the given position has a same row sibling
in front of it.
|
protected void |
initAttributes(Context context,
AttributeSet attrs) |
protected void |
initBaseGridViewAttributes(Context context,
AttributeSet attrs) |
boolean |
isChildLayoutAnimated()
Returns true if an animation will run when a child changes size or when
adding or removing a child.
|
boolean |
isFocusDrawingOrderEnabled()
Returns true if default "focus draw at last" order rule is enabled.
|
boolean |
isFocusSearchDisabled()
Returns true if focus search is disabled.
|
boolean |
isItemAlignmentOffsetWithPadding()
Returns true if include padding in calculating item align offset.
|
boolean |
isScrollEnabled()
Returns true if scrolling is enabled.
|
protected void |
onFocusChanged(boolean gainFocus,
int direction,
Rect previouslyFocusedRect)
Called by the view system when the focus state of this view changes.
|
boolean |
onRequestFocusInDescendants(int direction,
Rect previouslyFocusedRect)
Look for a descendant to call
View.requestFocus() on. |
void |
onRtlPropertiesChanged(int layoutDirection)
Notify layout manager that layout directionality has been updated
|
void |
removeOnChildViewHolderSelectedListener(OnChildViewHolderSelectedListener listener)
Remove the callback invoked when an item in BaseGridView has been selected.
|
void |
setAnimateChildLayout(boolean animateChildLayout)
Sets whether an animation should run when a child changes size or when adding
or removing a child.
|
void |
setChildrenVisibility(int visibility)
Changes and overrides children's visibility.
|
void |
setColumnWidth(int width)
Sets the column width.
|
void |
setExtraLayoutSpace(int extraLayoutSpace)
Sets pixels of extra space for layout child in invisible area.
|
void |
setFocusDrawingOrderEnabled(boolean enabled)
Enables or disables the default "focus draw at last" order rule.
|
void |
setFocusScrollStrategy(int scrollStrategy)
Sets the strategy used to scroll in response to item focus changing:
FOCUS_SCROLL_ALIGNED (default)
FOCUS_SCROLL_ITEM
FOCUS_SCROLL_PAGE
|
void |
setFocusSearchDisabled(boolean disabled)
Disables or enables focus search.
|
void |
setGravity(int gravity)
Sets the gravity used for child view positioning.
|
void |
setHasOverlappingRendering(boolean hasOverlapping) |
void |
setHorizontalMargin(int margin)
Sets the margin in pixels between two child items horizontally.
|
void |
setItemAlignmentOffset(int offset)
Sets the absolute offset in pixels for item alignment.
|
void |
setItemAlignmentOffsetPercent(float offsetPercent)
Sets the offset percent for item alignment in addition to
getItemAlignmentOffset() . |
void |
setItemAlignmentOffsetWithPadding(boolean withPadding)
Set to true if include padding in calculating item align offset.
|
void |
setItemAlignmentViewId(int viewId)
Sets the id of the view to align with.
|
void |
setItemMargin(int margin)
Sets the margin in pixels between two child items.
|
void |
setLayoutEnabled(boolean layoutEnabled)
Enables or disables layout.
|
void |
setNumColumns(int numColumns)
Sets the number of columns.
|
void |
setOnChildLaidOutListener(OnChildLaidOutListener listener)
Registers a callback to be invoked when an item in BaseGridView has
been laid out.
|
void |
setOnChildSelectedListener(OnChildSelectedListener listener)
Registers a callback to be invoked when an item in BaseGridView has
been selected.
|
void |
setOnChildViewHolderSelectedListener(OnChildViewHolderSelectedListener listener)
Registers a callback to be invoked when an item in BaseGridView has
been selected.
|
void |
setOnKeyInterceptListener(BaseGridView.OnKeyInterceptListener listener)
Sets the key intercept listener.
|
void |
setOnMotionInterceptListener(BaseGridView.OnMotionInterceptListener listener)
Sets the generic motion intercept listener.
|
void |
setOnTouchInterceptListener(BaseGridView.OnTouchInterceptListener listener)
Sets the touch intercept listener.
|
void |
setOnUnhandledKeyListener(BaseGridView.OnUnhandledKeyListener listener)
Sets the unhandled key listener.
|
void |
setPruneChild(boolean pruneChild)
Enables or disables pruning of children.
|
void |
setRecyclerListener(RecyclerView.RecyclerListener listener)
Register a listener that will be notified whenever a child view is recycled.
|
void |
setSaveChildrenLimitNumber(int limitNumber)
Sets the limit number when
getSaveChildrenPolicy() is SAVE_LIMITED_CHILD . |
void |
setSaveChildrenPolicy(int savePolicy)
Sets the policy for saving children.
|
void |
setScrollEnabled(boolean scrollEnabled)
Enables or disables scrolling.
|
void |
setSelectedPosition(int position)
Changes the selected item immediately without animation.
|
void |
setSelectedPosition(int position,
int scrollExtra)
Changes the selected item immediately without animation, scrollExtra is
applied in primary scroll direction.
|
void |
setSelectedPosition(int position,
ViewHolderTask task)
Perform a task on ViewHolder at given position after scroll to it.
|
void |
setSelectedPositionSmooth(int position)
Changes the selected item and run an animation to scroll to the target
position.
|
void |
setSelectedPositionSmooth(int position,
ViewHolderTask task)
Perform a task on ViewHolder at given position after smooth scrolling to it.
|
void |
setSelectedPositionSmoothWithSub(int position,
int subposition)
Changes the selected item and/or subposition, runs an animation to scroll to the target
position.
|
void |
setSelectedPositionWithSub(int position,
int subposition)
Changes the selected item and/or subposition immediately without animation.
|
void |
setSelectedPositionWithSub(int position,
int subposition,
int scrollExtra)
Changes the selected item and/or subposition immediately without animation, scrollExtra is
applied in primary scroll direction.
|
void |
setVerticalMargin(int margin)
Sets the margin in pixels between two child items vertically.
|
void |
setWindowAlignment(int windowAlignment)
Sets the method for focused item alignment in the view.
|
void |
setWindowAlignmentOffset(int offset)
Sets the offset in pixels for window alignment.
|
void |
setWindowAlignmentOffsetPercent(float offsetPercent)
Sets the offset percent for window alignment in addition to
getWindowAlignmentOffset() . |
addFocusables, addItemDecoration, addItemDecoration, addOnChildAttachStateChangeListener, addOnItemTouchListener, addOnScrollListener, checkLayoutParams, clearOnChildAttachStateChangeListeners, clearOnScrollListeners, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPreScroll, dispatchNestedScroll, dispatchRestoreInstanceState, dispatchSaveInstanceState, draw, drawChild, findChildViewUnder, findContainingItemView, findContainingViewHolder, findViewHolderForAdapterPosition, findViewHolderForItemId, findViewHolderForLayoutPosition, findViewHolderForPosition, fling, focusSearch, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getAdapter, getBaseline, getChildAdapterPosition, getChildItemId, getChildLayoutPosition, getChildPosition, getChildViewHolder, getClipToPadding, getCompatAccessibilityDelegate, getDecoratedBoundsWithMargins, getItemAnimator, getLayoutManager, getMaxFlingVelocity, getMinFlingVelocity, getOnFlingListener, getPreserveFocusAfterLayout, getRecycledViewPool, getScrollState, hasFixedSize, hasNestedScrollingParent, hasPendingAdapterUpdates, invalidateItemDecorations, isAnimating, isAttachedToWindow, isComputingLayout, isLayoutFrozen, isNestedScrollingEnabled, offsetChildrenHorizontal, offsetChildrenVertical, onAttachedToWindow, onChildAttachedToWindow, onChildDetachedFromWindow, onDetachedFromWindow, onDraw, onGenericMotionEvent, onInterceptTouchEvent, onLayout, onMeasure, onRestoreInstanceState, onSaveInstanceState, onScrolled, onScrollStateChanged, onSizeChanged, onTouchEvent, removeDetachedView, removeItemDecoration, removeOnChildAttachStateChangeListener, removeOnItemTouchListener, removeOnScrollListener, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestLayout, scrollBy, scrollTo, scrollToPosition, sendAccessibilityEventUnchecked, setAccessibilityDelegateCompat, setAdapter, setChildDrawingOrderCallback, setClipToPadding, setHasFixedSize, setItemAnimator, setItemViewCacheSize, setLayoutFrozen, setLayoutManager, setNestedScrollingEnabled, setOnFlingListener, setOnScrollListener, setPreserveFocusAfterLayout, setRecycledViewPool, setScrollingTouchSlop, setViewCacheExtension, smoothScrollBy, smoothScrollToPosition, startNestedScroll, stopNestedScroll, stopScroll, swapAdapter
addChildrenForAccessibility, addStatesFromChildren, addTouchables, addTransientView, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, buildTouchDispatchChildList, canAnimate, captureTransitioningViews, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, createSnapshot, damageChild, damageChildDeferred, damageChildInParent, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchActivityResult, dispatchApplyWindowInsets, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchFreezeSelfOnly, dispatchGenericPointerEvent, dispatchGetDisplayList, dispatchHoverEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEventInternal, dispatchProvideStructure, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawableStateChanged, encodeProperties, endViewTransition, findFocus, findNamedViews, findViewByAccessibilityIdTraversal, findViewByPredicateTraversal, findViewsWithText, findViewTraversal, findViewWithTagTraversal, focusableViewAvailable, gatherTransparentRegion, getAccessibilityClassName, getChildAt, getChildCount, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getChildVisibleRect, getClipChildren, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getNestedScrollAxes, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, getTransientView, getTransientViewCount, getTransientViewIndex, hasFocus, hasFocusable, hasHoveredChild, hasTransientState, indexOfChild, internalSetPadding, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isLayoutSuppressed, isMotionEventSplittingEnabled, isShowingContextMenuWithCoords, isTransformedTouchPointInView, isTransitionGroup, jumpDrawablesToCurrentState, layout, makeOptionalFitsSystemWindows, measureChild, measureChildren, measureChildWithMargins, notifySubtreeAccessibilityStateChanged, offsetChildrenTopAndBottom, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onChildVisibilityChanged, onCreateDrawableState, onDebugDraw, onDebugDrawMargins, onInitializeAccessibilityNodeInfoInternal, onInterceptHoverEvent, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestSendAccessibilityEvent, onRequestSendAccessibilityEventInternal, onResolvePointerIcon, onSetLayoutParams, onStartNestedScroll, onStopNestedScroll, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeTransientView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestFocus, requestSendAccessibilityEvent, requestTransitionStart, requestTransparentRegion, resetResolvedDrawables, resetResolvedLayoutDirection, resetResolvedPadding, resetResolvedTextAlignment, resetResolvedTextDirection, resolveDrawables, resolveLayoutDirection, resolveLayoutParams, resolvePadding, resolveRtlPropertiesIfNeeded, resolveTextAlignment, resolveTextDirection, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, setTouchscreenBlocksFocus, setTransitionGroup, shouldDelayChildPressedState, showContextMenuForChild, showContextMenuForChild, startActionModeForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, suppressLayout, transformPointToViewLocal, updateViewLayout
addFocusables, addFrameMetricsListener, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, applyDrawableToTransparentRegion, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, canHaveDisplayList, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAccessibilityFocus, clearAnimation, combineMeasuredStates, computeFitSystemWindows, computeOpaqueFlags, computeScroll, computeSystemWindowInsets, createAccessibilityNodeInfo, createAccessibilityNodeInfoInternal, createContextMenu, damageInParent, debug, debugIndent, destroyDrawingCache, destroyHardwareResources, dispatchGenericMotionEvent, dispatchNestedPrePerformAccessibilityAction, dispatchPointerEvent, dispatchPopulateAccessibilityEvent, drawableHotspotChanged, encode, findViewById, findViewByPredicate, findViewByPredicateInsideOut, findViewWithTag, fitsSystemWindows, fitSystemWindows, forceHasOverlappingRendering, forceLayout, generateViewId, getAccessibilityDelegate, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilitySelectionEnd, getAccessibilitySelectionStart, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAccessibilityViewId, getAccessibilityWindowId, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBackgroundTintList, getBackgroundTintMode, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getBoundsOnScreen, getBoundsOnScreen, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getFadeHeight, getFadeTop, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHardwareRenderer, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getHorizontalScrollFactor, getHotspotBounds, getId, getImportantForAccessibility, getInverseMatrix, getIterableTextForAccessibility, getIteratorForGranularity, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInSurface, getLocationInWindow, getLocationOnScreen, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOpticalInsets, getOutlineProvider, getOutsets, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getRawLayoutDirection, getRawTextAlignment, getRawTextDirection, getResources, getRevealOnFocusHint, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getStateListAnimator, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTransitionAlpha, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getVerticalScrollFactor, getViewRootImpl, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowDisplayFrame, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, handleScrollBarDragging, hasOnClickListeners, hasOpaqueScrollbars, hasShadow, hasWindowFocus, includeForAccessibility, inflate, initializeFadingEdge, initializeFadingEdgeInternal, initializeScrollbars, initializeScrollbarsInternal, invalidate, invalidate, invalidate, invalidateDrawable, invalidateOutline, invalidateParentCaches, invalidateParentIfNeeded, invalidateParentIfNeededAndWasQuickRejected, isAccessibilityFocused, isAccessibilitySelectionExtendable, isActionableForAccessibility, isActivated, isAssistBlocked, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isForegroundInsidePadding, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isInEditMode, isInLayout, isInScrollingContainer, isInTouchMode, isLaidOut, isLayoutDirectionInherited, isLayoutDirectionResolved, isLayoutModeOptical, isLayoutRequested, isLayoutRtl, isLongClickable, isOpaque, isPaddingOffsetRequired, isPaddingRelative, isPressed, isRootNamespace, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentInherited, isTextAlignmentResolved, isTextDirectionInherited, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVerticalScrollBarHidden, isVisibleToUser, isVisibleToUser, measure, mergeDrawableStates, notifySubtreeAccessibilityStateChangedIfNeeded, notifyViewAccessibilityStateChangedIfNeeded, offsetLeftAndRight, offsetTopAndBottom, onActivityResult, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCheckIsTextEditor, onCloseSystemDialogs, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDetachedFromWindowInternal, onDisplayHint, onDragEvent, onDrawForeground, onDrawHorizontalScrollBar, onDrawScrollBars, onDrawVerticalScrollBar, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusLost, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityEventInternal, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onOverScrolled, onPopulateAccessibilityEvent, onPopulateAccessibilityEventInternal, onProvideStructure, onProvideVirtualStructure, onRenderNodeDetached, onResolveDrawables, onScreenStateChanged, onScrollChanged, onSetAlpha, onStartTemporaryDetach, onTrackballEvent, onVisibilityAggregated, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, outputDirtyFlags, overScrollBy, performAccessibilityAction, performAccessibilityActionInternal, performButtonActionOnTouchDown, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, performLongClick, playSoundEffect, pointInView, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, recomputePadding, refreshDrawableState, removeCallbacks, removeFrameMetricsListener, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestAccessibilityFocus, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestKeyboardShortcuts, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, resetPaddingToInitialValues, resetRtlProperties, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, sendAccessibilityEvent, sendAccessibilityEventInternal, sendAccessibilityEventUncheckedInternal, setAccessibilityDelegate, setAccessibilityLiveRegion, setAccessibilitySelection, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAlpha, setAnimation, setAnimationMatrix, setAssistBlocked, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentDescription, setContextClickable, setDisabledSystemUiVisibility, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setForeground, setForegroundGravity, setForegroundTintList, setForegroundTintMode, setFrame, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setIsRootNamespace, setKeepScreenOn, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLeftTopRightBottom, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOpticalInsets, setOutlineProvider, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPressed, setRevealClip, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setStateListAnimator, setSystemUiVisibility, setTag, setTag, setTagInternal, setTextAlignment, setTextDirection, setTop, setTouchDelegate, setTransitionAlpha, setTransitionName, setTransitionVisibility, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, showContextMenu, startActionMode, startActionMode, startActivityForResult, startAnimation, startDrag, startDragAndDrop, startMovingTask, toGlobalMotionEvent, toLocalMotionEvent, toString, transformFromViewToWindowSpace, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, unscheduleDrawable, updateDisplayListIfDirty, updateDragShadow, verifyDrawable, willNotCacheDrawing, willNotDraw
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, requestFitSystemWindows
public static final int FOCUS_SCROLL_ALIGNED
public static final int FOCUS_SCROLL_ITEM
public static final int FOCUS_SCROLL_PAGE
public static final int WINDOW_ALIGN_LOW_EDGE
For HorizontalGridView, low edge refers to left edge when RTL is false or right edge when RTL is true. For VerticalGridView, low edge refers to top edge.
The middle location is calculated by "windowAlignOffset" and "windowAlignOffsetPercent"; if neither of these two is defined, the default value is 1/2 of the size.
public static final int WINDOW_ALIGN_HIGH_EDGE
For HorizontalGridView, high edge refers to right edge when RTL is false or left edge when RTL is true. For VerticalGridView, high edge refers to bottom edge.
The middle location is calculated by "windowAlignOffset" and "windowAlignOffsetPercent"; if neither of these two is defined, the default value is 1/2 of the size.
public static final int WINDOW_ALIGN_BOTH_EDGE
The middle location is calculated by "windowAlignOffset" and "windowAlignOffsetPercent"; if neither of these two is defined, the default value is 1/2 of the size.
public static final int WINDOW_ALIGN_NO_EDGE
The middle location is calculated by "windowAlignOffset" and "windowAlignOffsetPercent"; if neither of these two is defined, the default value is 1/2 of the size.
public static final float WINDOW_ALIGN_OFFSET_PERCENT_DISABLED
public static final float ITEM_ALIGN_OFFSET_PERCENT_DISABLED
public static final int SAVE_NO_CHILD
public static final int SAVE_ON_SCREEN_CHILD
public static final int SAVE_LIMITED_CHILD
getSaveChildrenLimitNumber()
.public static final int SAVE_ALL_CHILD
public VerticalGridView(Context context)
public VerticalGridView(Context context, AttributeSet attrs)
public VerticalGridView(Context context, AttributeSet attrs, int defStyle)
protected void initAttributes(Context context, AttributeSet attrs)
public void setNumColumns(int numColumns)
public void setColumnWidth(int width)
width
- May be ViewGroup.LayoutParams.WRAP_CONTENT
, or a size
in pixels. If zero, column width will be fixed based on number of columns
and view width.protected void initBaseGridViewAttributes(Context context, AttributeSet attrs)
public void setFocusScrollStrategy(int scrollStrategy)
public int getFocusScrollStrategy()
public void setWindowAlignment(int windowAlignment)
windowAlignment
- WINDOW_ALIGN_BOTH_EDGE
,
WINDOW_ALIGN_LOW_EDGE
, WINDOW_ALIGN_HIGH_EDGE
or
WINDOW_ALIGN_NO_EDGE
.public int getWindowAlignment()
public void setWindowAlignmentOffset(int offset)
offset
- The number of pixels to offset. If the offset is positive,
it is distance from low edge (see WINDOW_ALIGN_LOW_EDGE
);
if the offset is negative, the absolute value is distance from high
edge (see WINDOW_ALIGN_HIGH_EDGE
).
Default value is 0.public int getWindowAlignmentOffset()
WINDOW_ALIGN_LOW_EDGE
);
if the offset is negative, the absolute value is distance from high
edge (see WINDOW_ALIGN_HIGH_EDGE
).
Default value is 0.public void setWindowAlignmentOffsetPercent(float offsetPercent)
getWindowAlignmentOffset()
.offsetPercent
- Percentage to offset. E.g., 40 means 40% of the
width from low edge. Use
WINDOW_ALIGN_OFFSET_PERCENT_DISABLED
to disable.
Default value is 50.public float getWindowAlignmentOffsetPercent()
getWindowAlignmentOffset()
.WINDOW_ALIGN_OFFSET_PERCENT_DISABLED
if
disabled. Default value is 50.public void setItemAlignmentOffset(int offset)
ItemAlignmentFacet
is provided by RecyclerView.ViewHolder
or FacetProviderAdapter
.offset
- The number of pixels to offset. Can be negative for
alignment from the high edge, or positive for alignment from the
low edge.public int getItemAlignmentOffset()
public void setItemAlignmentOffsetWithPadding(boolean withPadding)
ItemAlignmentFacet
is provided by RecyclerView.ViewHolder
or FacetProviderAdapter
.withPadding
- When it is true: we include left/top padding for positive
item offset, include right/bottom padding for negative item offset.public boolean isItemAlignmentOffsetWithPadding()
public void setItemAlignmentOffsetPercent(float offsetPercent)
getItemAlignmentOffset()
.
Item alignment settings are ignored for the child if ItemAlignmentFacet
is provided by RecyclerView.ViewHolder
or FacetProviderAdapter
.offsetPercent
- Percentage to offset. E.g., 40 means 40% of the
width from the low edge. Use
ITEM_ALIGN_OFFSET_PERCENT_DISABLED
to disable.public float getItemAlignmentOffsetPercent()
getItemAlignmentOffset()
.ITEM_ALIGN_OFFSET_PERCENT_DISABLED
if
disabled. Default value is 50.public void setItemAlignmentViewId(int viewId)
View.NO_ID
(default)
for the item view itself.
Item alignment settings are ignored for the child if ItemAlignmentFacet
is provided by RecyclerView.ViewHolder
or FacetProviderAdapter
.public int getItemAlignmentViewId()
public void setItemMargin(int margin)
public void setVerticalMargin(int margin)
public int getVerticalMargin()
public void setHorizontalMargin(int margin)
public int getHorizontalMargin()
public void setOnChildLaidOutListener(OnChildLaidOutListener listener)
listener
- The listener to be invoked.public void setOnChildSelectedListener(OnChildSelectedListener listener)
listener
- The listener to be invoked.public void setOnChildViewHolderSelectedListener(OnChildViewHolderSelectedListener listener)
addOnChildViewHolderSelectedListener(android.support.v17.leanback.widget.OnChildViewHolderSelectedListener)
.listener
- The listener to be invoked.public void addOnChildViewHolderSelectedListener(OnChildViewHolderSelectedListener listener)
listener
- The listener to be invoked.public void removeOnChildViewHolderSelectedListener(OnChildViewHolderSelectedListener listener)
listener
- The listener to be removed.public void setSelectedPosition(int position)
public void setSelectedPositionWithSub(int position, int subposition)
public void setSelectedPosition(int position, int scrollExtra)
setSelectedPosition(int)
or setSelectedPositionSmooth(int)
call.public void setSelectedPositionWithSub(int position, int subposition, int scrollExtra)
setSelectedPosition(int)
or setSelectedPositionSmooth(int)
call.public void setSelectedPositionSmooth(int position)
public void setSelectedPositionSmoothWithSub(int position, int subposition)
public void setSelectedPositionSmooth(int position, ViewHolderTask task)
position
- Position of item in adapter.task
- Task to executed on the ViewHolder at a given position.public void setSelectedPosition(int position, ViewHolderTask task)
position
- Position of item in adapter.task
- Task to executed on the ViewHolder at a given position.public int getSelectedPosition()
public int getSelectedSubPosition()
ItemAlignmentFacet
s provided by RecyclerView.ViewHolder
or FacetProviderAdapter
. Zero is returned when no ItemAlignmentFacet
is defined.public void setAnimateChildLayout(boolean animateChildLayout)
Unstable API, might change later.
public boolean isChildLayoutAnimated()
Unstable API, might change later.
public void setGravity(int gravity)
gravity
- See Gravity
public boolean onRequestFocusInDescendants(int direction, Rect previouslyFocusedRect)
ViewGroup
View.requestFocus()
on.
Called by ViewGroup.requestFocus(int, android.graphics.Rect)
when it wants to request focus within its children. Override this to
customize how your ViewGroup
requests focus within its children.onRequestFocusInDescendants
in class RecyclerView
direction
- One of FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, and FOCUS_RIGHTpreviouslyFocusedRect
- The rectangle (in this View's coordinate system)
to give a finer grained hint about where focus is coming from. May be null
if there is no hint.public void getViewSelectedOffsets(View view, int[] offsets)
view
- The view to get offsets.offsets
- offsets[0] holds offset of X, offsets[1] holds offset of Y.public int getChildDrawingOrder(int childCount, int i)
ViewGroup
NOTE: In order for this method to be called, you must enable child ordering
first by calling ViewGroup.setChildrenDrawingOrderEnabled(boolean)
.
getChildDrawingOrder
in class RecyclerView
i
- The current iteration.ViewGroup.setChildrenDrawingOrderEnabled(boolean)
,
ViewGroup.isChildrenDrawingOrderEnabled()
public View focusSearch(int direction)
View
focusSearch
in class View
direction
- One of FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, and FOCUS_RIGHTprotected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect)
View
onFocusChanged
in class View
gainFocus
- True if the View has focus; false otherwise.direction
- The direction focus has moved when requestFocus()
is called to give this view focus. Values are
View.FOCUS_UP
, View.FOCUS_DOWN
, View.FOCUS_LEFT
,
View.FOCUS_RIGHT
, View.FOCUS_FORWARD
, or View.FOCUS_BACKWARD
.
It may not always apply, in which case use the default.previouslyFocusedRect
- The rectangle, in this view's coordinate
system, of the previously focused view. If applicable, this will be
passed in as finer grained information about where the focus is coming
from (in addition to direction). Will be null
otherwise.public final void setFocusSearchDisabled(boolean disabled)
public final boolean isFocusSearchDisabled()
public void setLayoutEnabled(boolean layoutEnabled)
public void setChildrenVisibility(int visibility)
public void setPruneChild(boolean pruneChild)
public void setScrollEnabled(boolean scrollEnabled)
public boolean isScrollEnabled()
public boolean hasPreviousViewInSameRow(int position)
OnChildSelectedListener
and OnChildLaidOutListener
.position
- Position in adapter.public void setFocusDrawingOrderEnabled(boolean enabled)
public boolean isFocusDrawingOrderEnabled()
public void setOnTouchInterceptListener(BaseGridView.OnTouchInterceptListener listener)
public void setOnMotionInterceptListener(BaseGridView.OnMotionInterceptListener listener)
public void setOnKeyInterceptListener(BaseGridView.OnKeyInterceptListener listener)
public void setOnUnhandledKeyListener(BaseGridView.OnUnhandledKeyListener listener)
public BaseGridView.OnUnhandledKeyListener getOnUnhandledKeyListener()
public boolean dispatchKeyEvent(KeyEvent event)
View
dispatchKeyEvent
in class ViewGroup
event
- The key event to be dispatched.public boolean dispatchTouchEvent(MotionEvent event)
View
dispatchTouchEvent
in class ViewGroup
event
- The motion event to be dispatched.public boolean dispatchGenericFocusedEvent(MotionEvent event)
View
Do not call this method directly.
Call View.dispatchGenericMotionEvent(MotionEvent)
instead.
dispatchGenericFocusedEvent
in class ViewGroup
event
- The motion event to be dispatched.public final int getSaveChildrenPolicy()
SAVE_NO_CHILD
SAVE_ON_SCREEN_CHILD
SAVE_LIMITED_CHILD
SAVE_ALL_CHILD
.public final int getSaveChildrenLimitNumber()
getSaveChildrenPolicy()
is
SAVE_LIMITED_CHILD
public final void setSaveChildrenPolicy(int savePolicy)
savePolicy
- One of SAVE_NO_CHILD
SAVE_ON_SCREEN_CHILD
SAVE_LIMITED_CHILD
SAVE_ALL_CHILD
.public final void setSaveChildrenLimitNumber(int limitNumber)
getSaveChildrenPolicy()
is SAVE_LIMITED_CHILD
.public boolean hasOverlappingRendering()
View
This function, intended to be overridden by specific View types, is an optimization when alpha is set on a view. If rendering overlaps in a view with alpha < 1, that view is drawn to an offscreen buffer and then composited into place, which can be expensive. If the view has no overlapping rendering, the view can draw each primitive with the appropriate alpha value directly. An example of overlapping rendering is a TextView with a background image, such as a Button. An example of non-overlapping rendering is a TextView with no background, or an ImageView with only the foreground image. The default implementation returns true; subclasses should override if they have cases which can be optimized.
The current implementation of the saveLayer and saveLayerAlpha methods in Canvas
necessitates that a View return true if it uses the methods internally without passing the
Canvas.CLIP_TO_LAYER_SAVE_FLAG
.
Note: The return value of this method is ignored if View.forceHasOverlappingRendering(boolean)
has been called on this view.
hasOverlappingRendering
in class View
public void setHasOverlappingRendering(boolean hasOverlapping)
public void onRtlPropertiesChanged(int layoutDirection)
onRtlPropertiesChanged
in class View
layoutDirection
- the direction of the layoutView.LAYOUT_DIRECTION_LTR
,
View.LAYOUT_DIRECTION_RTL
public void setRecyclerListener(RecyclerView.RecyclerListener listener)
RecyclerView
This listener will be called when a LayoutManager or the RecyclerView decides that a child view is no longer needed. If an application associates expensive or heavyweight data with item views, this may be a good place to release or free those resources.
setRecyclerListener
in class RecyclerView
listener
- Listener to register, or null to clearpublic void setExtraLayoutSpace(int extraLayoutSpace)
extraLayoutSpace
- Pixels of extra space for layout invisible child.
Must be bigger or equals to 0.public int getExtraLayoutSpace()