public abstract class AdapterView<T extends Adapter> extends ViewGroup
Modifier and Type | Class and Description |
---|---|
static class |
AdapterView.AdapterContextMenuInfo
Extra menu information provided to the
android.view.View.OnCreateContextMenuListener#onCreateContextMenu(ContextMenu, View, ContextMenuInfo)
callback when a context menu is brought up for this AdapterView. |
static interface |
AdapterView.OnItemClickListener
Interface definition for a callback to be invoked when an item in this
AdapterView has been clicked.
|
static interface |
AdapterView.OnItemLongClickListener
Interface definition for a callback to be invoked when an item in this
view has been clicked and held.
|
static interface |
AdapterView.OnItemSelectedListener
Interface definition for a callback to be invoked when
an item in this view has been selected.
|
ViewGroup.LayoutParams, ViewGroup.MarginLayoutParams, ViewGroup.OnHierarchyChangeListener
View.AccessibilityDelegate, View.BaseSavedState, View.DragShadowBuilder, View.MeasureSpec, View.OnAttachStateChangeListener, View.OnClickListener, View.OnCreateContextMenuListener, View.OnDragListener, View.OnFocusChangeListener, View.OnGenericMotionListener, View.OnHoverListener, View.OnKeyListener, View.OnLayoutChangeListener, View.OnLongClickListener, View.OnSystemUiVisibilityChangeListener, View.OnTouchListener
Modifier and Type | Field and Description |
---|---|
static int |
INVALID_POSITION
Represents an invalid position.
|
static long |
INVALID_ROW_ID
Represents an empty or invalid row id
|
static int |
ITEM_VIEW_TYPE_HEADER_OR_FOOTER
The item view type returned by
Adapter.getItemViewType(int) when
the item is a header or footer. |
static int |
ITEM_VIEW_TYPE_IGNORE
The item view type returned by
Adapter.getItemViewType(int) when
the adapter does not want the item's view recycled. |
CLIP_BOUNDS, CLIP_TO_PADDING_MASK, FLAG_DISALLOW_INTERCEPT, FLAG_SUPPORT_STATIC_TRANSFORMATIONS, FLAG_USE_CHILD_DRAWING_ORDER, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, mDisappearingChildren, mGroupFlags, mOnHierarchyChangeListener, mPersistentDrawingCache, OPTICAL_BOUNDS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE
ALPHA, DEBUG_LAYOUT_PROPERTY, DRAG_FLAG_GLOBAL, 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_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, mBottom, mCachingFailed, mContext, mCurrentAnimation, 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, NO_ID, 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, 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, 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_VISIBLE, SYSTEM_UI_CLEARABLE_FLAGS, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, 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_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y
Constructor and Description |
---|
AdapterView(Context context) |
AdapterView(Context context,
AttributeSet attrs) |
AdapterView(Context context,
AttributeSet attrs,
int defStyle) |
Modifier and Type | Method and Description |
---|---|
void |
addView(View child)
This method is not supported and throws an UnsupportedOperationException when called.
|
void |
addView(View child,
int index)
This method is not supported and throws an UnsupportedOperationException when called.
|
void |
addView(View child,
int index,
ViewGroup.LayoutParams params)
This method is not supported and throws an UnsupportedOperationException when called.
|
void |
addView(View child,
ViewGroup.LayoutParams params)
This method is not supported and throws an UnsupportedOperationException when called.
|
protected boolean |
canAnimate()
Indicates whether the view group has the ability to animate its children
after the first layout.
|
boolean |
dispatchPopulateAccessibilityEvent(AccessibilityEvent event)
Dispatches an
AccessibilityEvent to the View first and then
to its children for adding their text content to the event. |
protected void |
dispatchRestoreInstanceState(SparseArray<Parcelable> container)
Override to prevent thawing of any views created by the adapter.
|
protected void |
dispatchSaveInstanceState(SparseArray<Parcelable> container)
Override to prevent freezing of any views created by the adapter.
|
abstract T |
getAdapter()
Returns the adapter currently associated with this widget.
|
int |
getCount() |
View |
getEmptyView()
When the current adapter is empty, the AdapterView can display a special view
call the empty view.
|
int |
getFirstVisiblePosition()
Returns the position within the adapter's data set for the first item
displayed on screen.
|
Object |
getItemAtPosition(int position)
Gets the data associated with the specified position in the list.
|
long |
getItemIdAtPosition(int position) |
int |
getLastVisiblePosition()
Returns the position within the adapter's data set for the last item
displayed on screen.
|
AdapterView.OnItemClickListener |
getOnItemClickListener() |
AdapterView.OnItemLongClickListener |
getOnItemLongClickListener() |
AdapterView.OnItemSelectedListener |
getOnItemSelectedListener() |
int |
getPositionForView(View view)
Get the position within the adapter's data set for the view, where view is a an adapter item
or a descendant of an adapter item.
|
Object |
getSelectedItem() |
long |
getSelectedItemId() |
int |
getSelectedItemPosition()
Return the position of the currently selected item within the adapter's data set
|
abstract View |
getSelectedView() |
protected void |
onDetachedFromWindow()
This is called when the view is detached from a window.
|
void |
onInitializeAccessibilityEvent(AccessibilityEvent event)
Initializes an
AccessibilityEvent with information about
this View which is the event source. |
void |
onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info)
Initializes an
AccessibilityNodeInfo with information about this view. |
protected void |
onLayout(boolean changed,
int left,
int top,
int right,
int bottom)
Called from layout when this view should
assign a size and position to each of its children.
|
boolean |
onRequestSendAccessibilityEvent(View child,
AccessibilityEvent event)
Called when a child has requested sending an
AccessibilityEvent and
gives an opportunity to its parent to augment the event. |
boolean |
performItemClick(View view,
int position,
long id)
Call the OnItemClickListener, if it is defined.
|
void |
removeAllViews()
This method is not supported and throws an UnsupportedOperationException when called.
|
void |
removeView(View child)
This method is not supported and throws an UnsupportedOperationException when called.
|
void |
removeViewAt(int index)
This method is not supported and throws an UnsupportedOperationException when called.
|
abstract void |
setAdapter(T adapter)
Sets the adapter that provides the data and the views to represent the data
in this widget.
|
void |
setEmptyView(View emptyView)
Sets the view to show if the adapter is empty
|
void |
setFocusable(boolean focusable)
Set whether this view can receive the focus.
|
void |
setFocusableInTouchMode(boolean focusable)
Set whether this view can receive focus while in touch mode.
|
void |
setOnClickListener(View.OnClickListener l)
Register a callback to be invoked when this view is clicked.
|
void |
setOnItemClickListener(AdapterView.OnItemClickListener listener)
Register a callback to be invoked when an item in this AdapterView has
been clicked.
|
void |
setOnItemLongClickListener(AdapterView.OnItemLongClickListener listener)
Register a callback to be invoked when an item in this AdapterView has
been clicked and held
|
void |
setOnItemSelectedListener(AdapterView.OnItemSelectedListener listener)
Register a callback to be invoked when an item in this AdapterView has
been selected.
|
abstract void |
setSelection(int position)
Sets the currently selected item.
|
addChildrenForAccessibility, addFocusables, addStatesFromChildren, addTouchables, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, checkLayoutParams, childAccessibilityStateChanged, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchFinishTemporaryDetach, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchGetDisplayList, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawableStateChanged, drawChild, endViewTransition, findFocus, findViewByPredicateTraversal, findViewsWithText, findViewTraversal, findViewWithTagTraversal, fitSystemWindows, focusableViewAvailable, focusSearch, gatherTransparentRegion, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getPersistentDrawingCache, hasFocus, hasFocusable, hasHoveredChild, hasTransientState, indexOfChild, internalSetPadding, invalidateChild, invalidateChildFast, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isMotionEventSplittingEnabled, isTransformedTouchPointInView, jumpDrawablesToCurrentState, layout, makeOptionalFitsSystemWindows, measureChild, measureChildren, measureChildWithMargins, offsetChildrenTopAndBottom, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAnimationEnd, onAnimationStart, onChildVisibilityChanged, onCreateDrawableState, onDebugDraw, onDebugDrawMargins, onInterceptHoverEvent, onInterceptTouchEvent, onRequestFocusInDescendants, onSetLayoutParams, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViewsInLayout, removeDetachedView, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransitionStart, requestTransparentRegion, resetAccessibilityStateChanged, resetResolvedDrawables, resetResolvedLayoutDirection, resetResolvedPadding, resetResolvedTextAlignment, resetResolvedTextDirection, resetRtlProperties, resolveDrawables, resolveLayoutDirection, resolveLayoutParams, resolvePadding, resolveRtlPropertiesIfNeeded, resolveTextAlignment, resolveTextDirection, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, shouldDelayChildPressedState, showContextMenuForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayout
addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, applyDrawableToTransparentRegion, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, canHaveDisplayList, canResolveLayoutDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAccessibilityFocus, clearAnimation, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeOpaqueFlags, computeScroll, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, debug, debugIndent, destroyDrawingCache, destroyHardwareResources, dispatchGenericMotionEvent, dispatchPointerEvent, draw, findViewById, findViewByPredicate, findViewByPredicateInsideOut, findViewWithTag, fitsSystemWindows, focusSearch, forceLayout, generateViewId, getAccessibilityCursorPosition, getAccessibilityDelegate, getAccessibilityNodeProvider, getAccessibilityViewId, getAccessibilityWindowId, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDisplay, getDisplayList, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFadeHeight, getFadeTop, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHardwareRenderer, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getHorizontalScrollFactor, getId, getImportantForAccessibility, getIterableTextForAccessibility, getIteratorForGranularity, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOpticalInsets, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getRawLayoutDirection, getRawTextAlignment, getRawTextDirection, getResources, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTranslationX, getTranslationY, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getVerticalScrollFactor, getViewRootImpl, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, hackTurnOffWindowResizeAnim, hasOnClickListeners, hasOpaqueScrollbars, hasOverlappingRendering, hasWindowFocus, includeForAccessibility, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, invalidateDrawable, invalidateParentCaches, invalidateParentIfNeeded, isActionableForAccessibility, isActivated, isClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isInEditMode, isInScrollingContainer, isInTouchMode, isLayoutDirectionInherited, isLayoutRequested, isLayoutRtl, isLongClickable, isOpaque, isPaddingOffsetRequired, isPaddingRelative, isPressed, isRootNamespace, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTextAlignmentInherited, isTextDirectionInherited, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVerticalScrollBarHidden, isVisibleToUser, isVisibleToUser, measure, mergeDrawableStates, notifyAccessibilityStateChanged, offsetLeftAndRight, offsetTopAndBottom, onAttachedToWindow, onCheckIsTextEditor, onCloseSystemDialogs, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDraw, onDrawHorizontalScrollBar, onDrawScrollBars, onDrawVerticalScrollBar, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onFocusLost, onGenericMotionEvent, onHoverChanged, onHoverEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onMeasure, onOverScrolled, onPopulateAccessibilityEvent, onResolveDrawables, onRestoreInstanceState, onRtlPropertiesChanged, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, outputDirtyFlags, overScrollBy, performAccessibilityAction, performButtonActionOnTouchDown, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, recomputePadding, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestAccessibilityFocus, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, resetPaddingToInitialValues, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityCursorPosition, setAccessibilityDelegate, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBottom, setCameraDistance, setClickable, setContentDescription, setDisabledSystemUiVisibility, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFrame, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setIsRootNamespace, setKeepScreenOn, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutInsets, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setSystemUiVisibility, setTag, setTag, setTagInternal, setTextAlignment, setTextDirection, setTop, setTouchDelegate, setTranslationX, setTranslationY, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, showContextMenu, showContextMenu, startActionMode, startAnimation, startDrag, toString, unscheduleDrawable, unscheduleDrawable, verifyDrawable, willNotCacheDrawing, willNotDraw
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createContextMenu, getParent, getParentForAccessibility, isLayoutRequested, requestFitSystemWindows, requestLayout
public static final int ITEM_VIEW_TYPE_IGNORE
Adapter.getItemViewType(int)
when
the adapter does not want the item's view recycled.public static final int ITEM_VIEW_TYPE_HEADER_OR_FOOTER
Adapter.getItemViewType(int)
when
the item is a header or footer.public static final int INVALID_POSITION
public static final long INVALID_ROW_ID
public AdapterView(Context context)
public AdapterView(Context context, AttributeSet attrs)
public AdapterView(Context context, AttributeSet attrs, int defStyle)
public void setOnItemClickListener(AdapterView.OnItemClickListener listener)
listener
- The callback that will be invoked.public final AdapterView.OnItemClickListener getOnItemClickListener()
public boolean performItemClick(View view, int position, long id)
view
- The view within the AdapterView that was clicked.position
- The position of the view in the adapter.id
- The row id of the item that was clicked.public void setOnItemLongClickListener(AdapterView.OnItemLongClickListener listener)
listener
- The callback that will runpublic final AdapterView.OnItemLongClickListener getOnItemLongClickListener()
public void setOnItemSelectedListener(AdapterView.OnItemSelectedListener listener)
listener
- The callback that will runpublic final AdapterView.OnItemSelectedListener getOnItemSelectedListener()
public abstract T getAdapter()
public abstract void setAdapter(T adapter)
adapter
- The adapter to use to create this view's content.public void addView(View child)
addView
in class ViewGroup
child
- Ignored.UnsupportedOperationException
- Every time this method is invoked.ViewGroup.generateDefaultLayoutParams()
public void addView(View child, int index)
addView
in class ViewGroup
child
- Ignored.index
- Ignored.UnsupportedOperationException
- Every time this method is invoked.ViewGroup.generateDefaultLayoutParams()
public void addView(View child, ViewGroup.LayoutParams params)
addView
in interface ViewManager
addView
in class ViewGroup
child
- Ignored.params
- Ignored.UnsupportedOperationException
- Every time this method is invoked.public void addView(View child, int index, ViewGroup.LayoutParams params)
addView
in class ViewGroup
child
- Ignored.index
- Ignored.params
- Ignored.UnsupportedOperationException
- Every time this method is invoked.public void removeView(View child)
removeView
in interface ViewManager
removeView
in class ViewGroup
child
- Ignored.UnsupportedOperationException
- Every time this method is invoked.public void removeViewAt(int index)
removeViewAt
in class ViewGroup
index
- Ignored.UnsupportedOperationException
- Every time this method is invoked.public void removeAllViews()
removeAllViews
in class ViewGroup
UnsupportedOperationException
- Every time this method is invoked.protected void onLayout(boolean changed, int left, int top, int right, int bottom)
ViewGroup
public int getSelectedItemPosition()
INVALID_POSITION
if there is nothing selected.public long getSelectedItemId()
INVALID_ROW_ID
if nothing is selected.public abstract View getSelectedView()
public Object getSelectedItem()
public int getCount()
public int getPositionForView(View view)
view
- an adapter item, or a descendant of an adapter item. This must be visible in this
AdapterView at the time of the call.INVALID_POSITION
if the view does not correspond to a list item (or it is not currently visible).public int getFirstVisiblePosition()
public int getLastVisiblePosition()
public abstract void setSelection(int position)
position
- Index (starting at 0) of the data item to be selected.public void setEmptyView(View emptyView)
public View getEmptyView()
public void setFocusable(boolean focusable)
View
setFocusable
in class View
focusable
- If true, this view can receive the focus.View.setFocusableInTouchMode(boolean)
public void setFocusableInTouchMode(boolean focusable)
View
setFocusableInTouchMode
in class View
focusable
- If true, this view can receive the focus while
in touch mode.View.setFocusable(boolean)
public Object getItemAtPosition(int position)
position
- Which data to getpublic long getItemIdAtPosition(int position)
public void setOnClickListener(View.OnClickListener l)
View
setOnClickListener
in class View
l
- The callback that will runView.setClickable(boolean)
protected void dispatchSaveInstanceState(SparseArray<Parcelable> container)
dispatchSaveInstanceState
in class ViewGroup
container
- The SparseArray in which to save the view's state.View.dispatchRestoreInstanceState(android.util.SparseArray)
,
View.saveHierarchyState(android.util.SparseArray)
,
View.onSaveInstanceState()
protected void dispatchRestoreInstanceState(SparseArray<Parcelable> container)
dispatchRestoreInstanceState
in class ViewGroup
container
- The SparseArray which holds previously saved state.View.dispatchSaveInstanceState(android.util.SparseArray)
,
View.restoreHierarchyState(android.util.SparseArray)
,
View.onRestoreInstanceState(android.os.Parcelable)
protected void onDetachedFromWindow()
View
onDetachedFromWindow
in class View
View.onAttachedToWindow()
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event)
View
AccessibilityEvent
to the View
first and then
to its children for adding their text content to the event. Note that the
event text is populated in a separate dispatch path since we add to the
event not only the text of the source but also the text of all its descendants.
A typical implementation will call
View.onPopulateAccessibilityEvent(AccessibilityEvent)
on the this view
and then call the View.dispatchPopulateAccessibilityEvent(AccessibilityEvent)
on each child. Override this method if custom population of the event text
content is required.
If an View.AccessibilityDelegate
has been specified via calling
View.setAccessibilityDelegate(AccessibilityDelegate)
its
View.AccessibilityDelegate.dispatchPopulateAccessibilityEvent(View, AccessibilityEvent)
is responsible for handling this call.
Note: Accessibility events of certain types are not dispatched for
populating the event text via this method. For details refer to AccessibilityEvent
.
dispatchPopulateAccessibilityEvent
in class View
event
- The event.public boolean onRequestSendAccessibilityEvent(View child, AccessibilityEvent event)
ViewGroup
AccessibilityEvent
and
gives an opportunity to its parent to augment the event.
If an View.AccessibilityDelegate
has been specified via calling
View.setAccessibilityDelegate(android.view.View.AccessibilityDelegate)
its
View.AccessibilityDelegate.onRequestSendAccessibilityEvent(ViewGroup, View, AccessibilityEvent)
is responsible for handling this call.
onRequestSendAccessibilityEvent
in class ViewGroup
child
- The child which requests sending the event.event
- The event to be sent.ViewGroup.requestSendAccessibilityEvent(View, AccessibilityEvent)
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info)
View
AccessibilityNodeInfo
with information about this view.
The base implementation sets:
AccessibilityNodeInfo.setParent(View)
,AccessibilityNodeInfo.setBoundsInParent(Rect)
,AccessibilityNodeInfo.setBoundsInScreen(Rect)
,AccessibilityNodeInfo.setPackageName(CharSequence)
,AccessibilityNodeInfo.setClassName(CharSequence)
,AccessibilityNodeInfo.setContentDescription(CharSequence)
,AccessibilityNodeInfo.setEnabled(boolean)
,AccessibilityNodeInfo.setClickable(boolean)
,AccessibilityNodeInfo.setFocusable(boolean)
,AccessibilityNodeInfo.setFocused(boolean)
,AccessibilityNodeInfo.setLongClickable(boolean)
,AccessibilityNodeInfo.setSelected(boolean)
,Subclasses should override this method, call the super implementation, and set additional attributes.
If an View.AccessibilityDelegate
has been specified via calling
View.setAccessibilityDelegate(AccessibilityDelegate)
its
View.AccessibilityDelegate.onInitializeAccessibilityNodeInfo(View, AccessibilityNodeInfo)
is responsible for handling this call.
onInitializeAccessibilityNodeInfo
in class View
info
- The instance to initialize.public void onInitializeAccessibilityEvent(AccessibilityEvent event)
View
AccessibilityEvent
with information about
this View which is the event source. In other words, the source of
an accessibility event is the view whose state change triggered firing
the event.
Example: Setting the password property of an event in addition to properties set by the super implementation:
public void onInitializeAccessibilityEvent(AccessibilityEvent event) { super.onInitializeAccessibilityEvent(event); event.setPassword(true); }
If an View.AccessibilityDelegate
has been specified via calling
View.setAccessibilityDelegate(AccessibilityDelegate)
its
View.AccessibilityDelegate.onInitializeAccessibilityEvent(View, AccessibilityEvent)
is responsible for handling this call.
Note: Always call the super implementation before adding information to the event, in case the default implementation has basic information to add.
onInitializeAccessibilityEvent
in class View
event
- The event to initialize.View.sendAccessibilityEvent(int)
,
View.dispatchPopulateAccessibilityEvent(AccessibilityEvent)
protected boolean canAnimate()
ViewGroup
canAnimate
in class ViewGroup