public abstract class AbsListView extends AdapterView<ListAdapter> implements TextWatcher, ViewTreeObserver.OnGlobalLayoutListener, Filter.FilterListener, ViewTreeObserver.OnTouchModeChangeListener, RemoteViewsAdapter.RemoteAdapterConnectionCallback
Modifier and Type | Class and Description |
---|---|
static class |
AbsListView.LayoutParams
AbsListView extends LayoutParams to provide a place to hold the view type.
|
static interface |
AbsListView.MultiChoiceModeListener
A MultiChoiceModeListener receives events for
CHOICE_MODE_MULTIPLE_MODAL . |
static interface |
AbsListView.OnScrollListener
Interface definition for a callback to be invoked when the list or grid
has been scrolled.
|
static interface |
AbsListView.RecyclerListener
A RecyclerListener is used to receive a notification whenever a View is placed
inside the RecycleBin's scrap heap.
|
static interface |
AbsListView.SelectionBoundsAdjuster
The top-level view of a list item can implement this interface to allow
itself to modify the bounds of the selection shown for that item.
|
AdapterView.AdapterContextMenuInfo, AdapterView.OnItemClickListener, AdapterView.OnItemLongClickListener, AdapterView.OnItemSelectedListener
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
NoCopySpan.Concrete
Modifier and Type | Field and Description |
---|---|
static int |
CHOICE_MODE_MULTIPLE
The list allows multiple choices
|
static int |
CHOICE_MODE_MULTIPLE_MODAL
The list allows multiple choices in a modal selection mode
|
static int |
CHOICE_MODE_NONE
Normal list that does not indicate choices
|
static int |
CHOICE_MODE_SINGLE
The list allows up to one choice
|
static int |
TRANSCRIPT_MODE_ALWAYS_SCROLL
The list will automatically scroll to the bottom, no matter what items
are currently visible.
|
static int |
TRANSCRIPT_MODE_DISABLED
Disables the transcript mode.
|
static int |
TRANSCRIPT_MODE_NORMAL
The list will automatically scroll to the bottom when a data set change
notification is received and only if the last item is already visible
on screen.
|
INVALID_POSITION, INVALID_ROW_ID, ITEM_VIEW_TYPE_HEADER_OR_FOOTER, ITEM_VIEW_TYPE_IGNORE
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 |
---|
AbsListView(Context context) |
AbsListView(Context context,
AttributeSet attrs) |
AbsListView(Context context,
AttributeSet attrs,
int defStyle) |
Modifier and Type | Method and Description |
---|---|
void |
addTouchables(ArrayList<View> views)
Add any touchable views that are descendants of this view (possibly
including this view if it is touchable itself) to views.
|
void |
afterTextChanged(Editable s)
For our text watcher that is associated with the text filter.
|
void |
beforeTextChanged(CharSequence s,
int start,
int count,
int after)
For our text watcher that is associated with the text filter.
|
boolean |
checkInputConnectionProxy(View view)
For filtering we proxy an input connection to an internal text editor,
and this allows the proxying to happen.
|
protected boolean |
checkLayoutParams(ViewGroup.LayoutParams p) |
void |
clearChoices()
Clear any choices previously set
|
void |
clearTextFilter()
Clear the text filter.
|
protected int |
computeVerticalScrollExtent()
Compute the vertical extent of the horizontal scrollbar's thumb
within the vertical range.
|
protected int |
computeVerticalScrollOffset()
Compute the vertical offset of the vertical scrollbar's thumb
within the horizontal range.
|
protected int |
computeVerticalScrollRange()
Compute the vertical range that the vertical scrollbar represents.
|
void |
deferNotifyDataSetChanged()
This defers a notifyDataSetChanged on the pending RemoteViewsAdapter if it has not
connected yet.
|
protected void |
dispatchDraw(Canvas canvas)
Called by draw to draw the child views.
|
protected void |
dispatchSetPressed(boolean pressed)
Dispatch setPressed to all of this View's children.
|
void |
draw(Canvas canvas)
Manually render this view (and all of its children) to the given Canvas.
|
protected void |
drawableStateChanged()
This function is called whenever the state of the view changes in such
a way that it impacts the state of drawables being shown.
|
protected ViewGroup.LayoutParams |
generateDefaultLayoutParams()
Returns a set of default layout parameters.
|
AbsListView.LayoutParams |
generateLayoutParams(AttributeSet attrs)
Returns a new set of layout parameters based on the supplied attributes set.
|
protected ViewGroup.LayoutParams |
generateLayoutParams(ViewGroup.LayoutParams p)
Returns a safe set of layout parameters based on the supplied layout params.
|
protected float |
getBottomFadingEdgeStrength()
Returns the strength, or intensity, of the bottom faded edge.
|
protected int |
getBottomPaddingOffset()
Amount by which to extend the bottom fading region.
|
int |
getCacheColorHint()
When set to a non-zero value, the cache color hint indicates that this list is always drawn
on top of a solid, single-color, opaque background
|
int |
getCheckedItemCount()
Returns the number of items currently selected.
|
long[] |
getCheckedItemIds()
Returns the set of checked items ids.
|
int |
getCheckedItemPosition()
Returns the currently checked item.
|
SparseBooleanArray |
getCheckedItemPositions()
Returns the set of checked items in the list.
|
int |
getChoiceMode() |
protected ContextMenu.ContextMenuInfo |
getContextMenuInfo()
Views should implement this if they have extra information to associate
with the context menu.
|
void |
getFocusedRect(Rect r)
When a view has focus and the user navigates away from it, the next view is searched for
starting from the rectangle filled in by this method.
|
protected int |
getLeftPaddingOffset()
Amount by which to extend the left fading region.
|
int |
getListPaddingBottom()
List padding is the maximum of the normal view's padding and the padding of the selector.
|
int |
getListPaddingLeft()
List padding is the maximum of the normal view's padding and the padding of the selector.
|
int |
getListPaddingRight()
List padding is the maximum of the normal view's padding and the padding of the selector.
|
int |
getListPaddingTop()
List padding is the maximum of the normal view's padding and the padding of the selector.
|
protected int |
getRightPaddingOffset()
Amount by which to extend the right fading region.
|
View |
getSelectedView() |
Drawable |
getSelector()
Returns the selector
Drawable that is used to draw the
selection in the list. |
int |
getSolidColor()
Override this if your view is known to always be drawn on top of a solid color background,
and needs to draw fading edges.
|
CharSequence |
getTextFilter()
Returns the list's text filter, if available.
|
protected float |
getTopFadingEdgeStrength()
Returns the strength, or intensity, of the top faded edge.
|
protected int |
getTopPaddingOffset()
Amount by which to extend the top fading region.
|
int |
getTranscriptMode()
Returns the current transcript mode.
|
int |
getVerticalScrollbarWidth()
Returns the width of the vertical scrollbar.
|
protected void |
handleDataChanged() |
boolean |
hasTextFilter()
Returns if the ListView currently has a text filter.
|
void |
invalidateViews()
Causes all the views to be rebuilt and redrawn.
|
boolean |
isFastScrollAlwaysVisible()
Returns true if the fast scroller is set to always show on this view rather than
fade out when not in use.
|
boolean |
isFastScrollEnabled()
Returns the current state of the fast scroll feature.
|
protected boolean |
isInFilterMode()
Indicates whether this view is in filter mode.
|
boolean |
isItemChecked(int position)
Returns the checked state of the specified position.
|
protected boolean |
isPaddingOffsetRequired()
If the View draws content inside its padding and enables fading edges,
it needs to support padding offsets.
|
boolean |
isScrollingCacheEnabled()
Indicates whether the children's drawing cache is used during a scroll.
|
boolean |
isSmoothScrollbarEnabled()
Returns the current state of the fast scroll feature.
|
boolean |
isStackFromBottom()
Indicates whether the content of this view is pinned to, or stacked from,
the bottom edge.
|
boolean |
isTextFilterEnabled()
Indicates whether type filtering is enabled for this view
|
protected boolean |
isVerticalScrollBarHidden()
If fast scroll is visible, then don't draw the vertical scrollbar.
|
void |
jumpDrawablesToCurrentState()
Call
Drawable.jumpToCurrentState()
on all Drawable objects associated with this view. |
protected void |
layoutChildren()
Subclasses must override this method to layout their children.
|
protected void |
onAttachedToWindow()
This is called when the view is attached to a window.
|
protected int[] |
onCreateDrawableState(int extraSpace)
Generate the new
Drawable state for
this view. |
InputConnection |
onCreateInputConnection(EditorInfo outAttrs)
Return an InputConnection for editing of the filter text.
|
protected void |
onDetachedFromWindow()
This is called when the view is detached from a window.
|
protected void |
onDisplayHint(int hint)
Gives this view a hint about whether is displayed or not.
|
void |
onFilterComplete(int count)
Notifies the end of a filtering operation.
|
protected void |
onFocusChanged(boolean gainFocus,
int direction,
Rect previouslyFocusedRect)
Called by the view system when the focus state of this view changes.
|
boolean |
onGenericMotionEvent(MotionEvent event)
Implement this method to handle generic motion events.
|
void |
onGlobalLayout()
Callback method to be invoked when the global layout state or the visibility of views
within the view tree changes
|
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. |
boolean |
onInterceptTouchEvent(MotionEvent ev)
Implement this method to intercept all touch screen motion events.
|
boolean |
onKeyDown(int keyCode,
KeyEvent event)
Default implementation of
KeyEvent.Callback.onKeyDown() : perform press of the view
when KeyEvent.KEYCODE_DPAD_CENTER or KeyEvent.KEYCODE_ENTER
is released, if the view is enabled and clickable. |
boolean |
onKeyUp(int keyCode,
KeyEvent event)
Default implementation of
KeyEvent.Callback.onKeyUp() : perform clicking of the view
when KeyEvent.KEYCODE_DPAD_CENTER or
KeyEvent.KEYCODE_ENTER is released. |
protected void |
onLayout(boolean changed,
int l,
int t,
int r,
int b)
Subclasses should NOT override this method but
layoutChildren() instead. |
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
Measure the view and its content to determine the measured width and the
measured height.
|
protected void |
onOverScrolled(int scrollX,
int scrollY,
boolean clampedX,
boolean clampedY)
Called by
View.overScrollBy(int, int, int, int, int, int, int, int, boolean) to
respond to the results of an over-scroll operation. |
boolean |
onRemoteAdapterConnected()
Called back when the adapter connects to the RemoteViewsService.
|
void |
onRemoteAdapterDisconnected()
Called back when the adapter disconnects from the RemoteViewsService.
|
void |
onRestoreInstanceState(Parcelable state)
Hook allowing a view to re-apply a representation of its internal state that had previously
been generated by
View.onSaveInstanceState() . |
Parcelable |
onSaveInstanceState()
Hook allowing a view to generate a representation of its internal state
that can later be used to create a new instance with that same state.
|
protected void |
onSizeChanged(int w,
int h,
int oldw,
int oldh)
This is called during layout when the size of this view has changed.
|
void |
onTextChanged(CharSequence s,
int start,
int before,
int count)
For our text watcher that is associated with the text filter.
|
boolean |
onTouchEvent(MotionEvent ev)
Implement this method to handle touch screen motion events.
|
void |
onTouchModeChanged(boolean isInTouchMode)
Callback method to be invoked when the touch mode changes.
|
void |
onWindowFocusChanged(boolean hasWindowFocus)
Called when the window containing this view gains or loses focus.
|
boolean |
performAccessibilityAction(int action,
Bundle arguments)
Performs the specified accessibility action on the view.
|
boolean |
performItemClick(View view,
int position,
long id)
Call the OnItemClickListener, if it is defined.
|
int |
pointToPosition(int x,
int y)
Maps a point to a position in the list.
|
long |
pointToRowId(int x,
int y)
Maps a point to a the rowId of the item which intersects that point.
|
void |
reclaimViews(List<View> views)
Move all views (excluding headers and footers) held by this AbsListView into the supplied
List.
|
void |
requestDisallowInterceptTouchEvent(boolean disallowIntercept)
Called when a child does not want this parent and its ancestors to
intercept touch events with
ViewGroup.onInterceptTouchEvent(MotionEvent) . |
void |
requestLayout()
Call this when something has changed which has invalidated the
layout of this view.
|
void |
sendAccessibilityEvent(int eventType)
Sends an accessibility event of the given type.
|
void |
setAdapter(ListAdapter adapter)
Sets the adapter that provides the data and the views to represent the data
in this widget.
|
void |
setCacheColorHint(int color)
When set to a non-zero value, the cache color hint indicates that this list is always drawn
on top of a solid, single-color, opaque background.
|
void |
setChoiceMode(int choiceMode)
Defines the choice behavior for the List.
|
void |
setDrawSelectorOnTop(boolean onTop)
Controls whether the selection highlight drawable should be drawn on top of the item or
behind it.
|
void |
setFastScrollAlwaysVisible(boolean alwaysShow)
Set whether or not the fast scroller should always be shown in place of the
standard scrollbars.
|
void |
setFastScrollEnabled(boolean enabled)
Enables fast scrolling by letting the user quickly scroll through lists by
dragging the fast scroll thumb.
|
void |
setFilterText(String filterText)
Sets the initial value for the text filter.
|
protected boolean |
setFrame(int left,
int top,
int right,
int bottom)
Assign a size and position to this view.
|
void |
setFriction(float friction)
The amount of friction applied to flings.
|
void |
setItemChecked(int position,
boolean value)
Sets the checked state of the specified position.
|
void |
setMultiChoiceModeListener(AbsListView.MultiChoiceModeListener listener)
Set a
AbsListView.MultiChoiceModeListener that will manage the lifecycle of the
selection ActionMode . |
void |
setOnScrollListener(AbsListView.OnScrollListener l)
Set the listener that will receive notifications every time the list scrolls.
|
void |
setOverScrollEffectPadding(int leftPadding,
int rightPadding) |
void |
setOverScrollMode(int mode)
Set the over-scroll mode for this view.
|
void |
setRecyclerListener(AbsListView.RecyclerListener listener)
Sets the recycler listener to be notified whenever a View is set aside in
the recycler for later reuse.
|
void |
setRemoteViewsAdapter(Intent intent)
Sets up this AbsListView to use a remote views adapter which connects to a RemoteViewsService
through the specified intent.
|
void |
setRemoteViewsOnClickHandler(RemoteViews.OnClickHandler handler)
Sets up the onClickHandler to be used by the RemoteViewsAdapter when inflating RemoteViews
|
void |
setScrollIndicators(View up,
View down) |
void |
setScrollingCacheEnabled(boolean enabled)
Enables or disables the children's drawing cache during a scroll.
|
void |
setSelector(Drawable sel) |
void |
setSelector(int resID)
Set a Drawable that should be used to highlight the currently selected item.
|
void |
setSmoothScrollbarEnabled(boolean enabled)
When smooth scrollbar is enabled, the position and size of the scrollbar thumb
is computed based on the number of visible pixels in the visible items.
|
void |
setStackFromBottom(boolean stackFromBottom)
When stack from bottom is set to true, the list fills its content starting from
the bottom of the view.
|
void |
setTextFilterEnabled(boolean textFilterEnabled)
Enables or disables the type filter window.
|
void |
setTranscriptMode(int mode)
Puts the list or grid into transcript mode.
|
void |
setVelocityScale(float scale)
Sets a scale factor for the fling velocity.
|
void |
setVerticalScrollbarPosition(int position)
Set the position of the vertical scroll bar.
|
boolean |
showContextMenu(float x,
float y,
int metaState)
Bring up the context menu for this view, referring to the item under the specified point.
|
boolean |
showContextMenuForChild(View originalView)
Bring up a context menu for the specified view or its ancestors.
|
void |
smoothScrollBy(int distance,
int duration)
Smoothly scroll by distance pixels over duration milliseconds.
|
void |
smoothScrollToPosition(int position)
Smoothly scroll to the specified adapter position.
|
void |
smoothScrollToPosition(int position,
int boundPosition)
Smoothly scroll to the specified adapter position.
|
void |
smoothScrollToPositionFromTop(int position,
int offset)
Smoothly scroll to the specified adapter position.
|
void |
smoothScrollToPositionFromTop(int position,
int offset,
int duration)
Smoothly scroll to the specified adapter position.
|
boolean |
verifyDrawable(Drawable dr)
If your view subclass is displaying its own Drawable objects, it should
override this function and return true for any Drawable it is
displaying.
|
addView, addView, addView, addView, canAnimate, dispatchPopulateAccessibilityEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, getAdapter, getCount, getEmptyView, getFirstVisiblePosition, getItemAtPosition, getItemIdAtPosition, getLastVisiblePosition, getOnItemClickListener, getOnItemLongClickListener, getOnItemSelectedListener, getPositionForView, getSelectedItem, getSelectedItemId, getSelectedItemPosition, onRequestSendAccessibilityEvent, removeAllViews, removeView, removeViewAt, setEmptyView, setFocusable, setFocusableInTouchMode, setOnClickListener, setOnItemClickListener, setOnItemLongClickListener, setOnItemSelectedListener, setSelection
addChildrenForAccessibility, addFocusables, addStatesFromChildren, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, childAccessibilityStateChanged, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchFinishTemporaryDetach, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchGetDisplayList, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchSetActivated, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawChild, endViewTransition, findFocus, findViewByPredicateTraversal, findViewsWithText, findViewTraversal, findViewWithTagTraversal, fitSystemWindows, focusableViewAvailable, focusSearch, gatherTransparentRegion, 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, layout, makeOptionalFitsSystemWindows, measureChild, measureChildren, measureChildWithMargins, offsetChildrenTopAndBottom, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAnimationEnd, onAnimationStart, onChildVisibilityChanged, onDebugDraw, onDebugDrawMargins, onInterceptHoverEvent, onRequestFocusInDescendants, onSetLayoutParams, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViewsInLayout, removeDetachedView, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, 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, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayout
addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, applyDrawableToTransparentRegion, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, canHaveDisplayList, canResolveLayoutDirection, canScrollHorizontally, canScrollVertically, clearAccessibilityFocus, clearAnimation, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeOpaqueFlags, computeScroll, createAccessibilityNodeInfo, createContextMenu, debug, debugIndent, destroyDrawingCache, destroyHardwareResources, dispatchGenericMotionEvent, dispatchPointerEvent, findViewById, findViewByPredicate, findViewByPredicateInsideOut, findViewWithTag, fitsSystemWindows, focusSearch, forceLayout, generateViewId, getAccessibilityCursorPosition, getAccessibilityDelegate, getAccessibilityNodeProvider, getAccessibilityViewId, getAccessibilityWindowId, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getCameraDistance, getContentDescription, getContext, getDefaultSize, getDisplay, getDisplayList, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFadeHeight, getFadeTop, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHardwareRenderer, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getHorizontalScrollFactor, getId, getImportantForAccessibility, getIterableTextForAccessibility, getIteratorForGranularity, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, 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, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollX, getScrollY, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTop, getTouchables, getTouchDelegate, getTranslationX, getTranslationY, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, 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, isPaddingRelative, isPressed, isRootNamespace, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTextAlignmentInherited, isTextDirectionInherited, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUser, isVisibleToUser, measure, mergeDrawableStates, notifyAccessibilityStateChanged, offsetLeftAndRight, offsetTopAndBottom, onCheckIsTextEditor, onCloseSystemDialogs, onConfigurationChanged, onCreateContextMenu, onDragEvent, onDraw, onDrawHorizontalScrollBar, onDrawScrollBars, onDrawVerticalScrollBar, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusLost, onHoverChanged, onHoverEvent, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onPopulateAccessibilityEvent, onResolveDrawables, onRtlPropertiesChanged, onScreenStateChanged, onScrollChanged, onSetAlpha, onStartTemporaryDetach, onTrackballEvent, onVisibilityChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, outputDirtyFlags, overScrollBy, 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, requestRectangleOnScreen, requestRectangleOnScreen, resetPaddingToInitialValues, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEventUnchecked, setAccessibilityCursorPosition, setAccessibilityDelegate, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBottom, setCameraDistance, setClickable, setContentDescription, setDisabledSystemUiVisibility, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, 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, 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, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, showContextMenu, startActionMode, startAnimation, startDrag, toString, unscheduleDrawable, unscheduleDrawable, willNotCacheDrawing, willNotDraw
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createContextMenu, getParent, getParentForAccessibility, isLayoutRequested, requestFitSystemWindows
public static final int TRANSCRIPT_MODE_DISABLED
setTranscriptMode(int)
,
Constant Field Valuespublic static final int TRANSCRIPT_MODE_NORMAL
setTranscriptMode(int)
,
Constant Field Valuespublic static final int TRANSCRIPT_MODE_ALWAYS_SCROLL
setTranscriptMode(int)
,
Constant Field Valuespublic static final int CHOICE_MODE_NONE
public static final int CHOICE_MODE_SINGLE
public static final int CHOICE_MODE_MULTIPLE
public static final int CHOICE_MODE_MULTIPLE_MODAL
public AbsListView(Context context)
public AbsListView(Context context, AttributeSet attrs)
public AbsListView(Context context, AttributeSet attrs, int defStyle)
public void setOverScrollMode(int mode)
View
View.OVER_SCROLL_ALWAYS
(default), View.OVER_SCROLL_IF_CONTENT_SCROLLS
(allow over-scrolling only if the view content is larger than the container),
or View.OVER_SCROLL_NEVER
.
Setting the over-scroll mode of a view will have an effect only if the
view is capable of scrolling.setOverScrollMode
in class View
mode
- The new over-scroll mode for this view.public void setAdapter(ListAdapter adapter)
setAdapter
in class AdapterView<ListAdapter>
adapter
- The adapter to use to create this view's content.public int getCheckedItemCount()
CHOICE_MODE_NONE
(default).
To determine the specific items that are currently selected, use one of
the getChecked*
methods.
getCheckedItemPosition()
,
getCheckedItemPositions()
,
getCheckedItemIds()
public boolean isItemChecked(int position)
CHOICE_MODE_SINGLE
or CHOICE_MODE_MULTIPLE
.position
- The item whose checked state to returnfalse
if choice mode
is invalidsetChoiceMode(int)
public int getCheckedItemPosition()
CHOICE_MODE_SINGLE
.AdapterView.INVALID_POSITION
if nothing is selectedsetChoiceMode(int)
public SparseBooleanArray getCheckedItemPositions()
CHOICE_MODE_NONE
.null
if the choice mode is set to
CHOICE_MODE_NONE
.public long[] getCheckedItemIds()
CHOICE_MODE_NONE
and the adapter
has stable IDs. (Adapter.hasStableIds()
== true
)public void clearChoices()
public void setItemChecked(int position, boolean value)
CHOICE_MODE_SINGLE
or
CHOICE_MODE_MULTIPLE
.position
- The item whose checked state is to be checkedvalue
- The new checked state for the itempublic boolean performItemClick(View view, int position, long id)
AdapterView
performItemClick
in class AdapterView<ListAdapter>
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 int getChoiceMode()
setChoiceMode(int)
public void setChoiceMode(int choiceMode)
CHOICE_MODE_NONE
). By setting the choiceMode to CHOICE_MODE_SINGLE
, the
List allows up to one item to be in a chosen state. By setting the choiceMode to
CHOICE_MODE_MULTIPLE
, the list allows any number of items to be chosen.choiceMode
- One of CHOICE_MODE_NONE
, CHOICE_MODE_SINGLE
, or
CHOICE_MODE_MULTIPLE
public void setMultiChoiceModeListener(AbsListView.MultiChoiceModeListener listener)
AbsListView.MultiChoiceModeListener
that will manage the lifecycle of the
selection ActionMode
. Only used when the choice mode is set to
CHOICE_MODE_MULTIPLE_MODAL
.listener
- Listener that will manage the selection modesetChoiceMode(int)
public void setFastScrollEnabled(boolean enabled)
SectionIndexer
if it wishes to display alphabet preview and
jump between sections of the list.enabled
- whether or not to enable fast scrollingSectionIndexer
,
isFastScrollEnabled()
public void setFastScrollAlwaysVisible(boolean alwaysShow)
alwaysShow
- true if the fast scroller should always be displayed.View.setScrollBarStyle(int)
,
setFastScrollEnabled(boolean)
public boolean isFastScrollAlwaysVisible()
setFastScrollAlwaysVisible(boolean)
public int getVerticalScrollbarWidth()
View
getVerticalScrollbarWidth
in class View
public boolean isFastScrollEnabled()
setFastScrollEnabled(boolean)
public void setVerticalScrollbarPosition(int position)
View
View.SCROLLBAR_POSITION_DEFAULT
, View.SCROLLBAR_POSITION_LEFT
or
View.SCROLLBAR_POSITION_RIGHT
.setVerticalScrollbarPosition
in class View
position
- Where the vertical scroll bar should be positioned.protected boolean isVerticalScrollBarHidden()
isVerticalScrollBarHidden
in class View
public void setSmoothScrollbarEnabled(boolean enabled)
enabled
- Whether or not to enable smooth scrollbar.setSmoothScrollbarEnabled(boolean)
public boolean isSmoothScrollbarEnabled()
setSmoothScrollbarEnabled(boolean)
public void setOnScrollListener(AbsListView.OnScrollListener l)
l
- the scroll listenerpublic void sendAccessibilityEvent(int eventType)
View
View.onInitializeAccessibilityEvent(AccessibilityEvent)
first
to populate information about the event source (this View), then calls
View.dispatchPopulateAccessibilityEvent(AccessibilityEvent)
to
populate the text content of the event source including its descendants,
and last calls
ViewParent.requestSendAccessibilityEvent(View, AccessibilityEvent)
on its parent to resuest sending of the event to interested parties.
If an View.AccessibilityDelegate
has been specified via calling
View.setAccessibilityDelegate(AccessibilityDelegate)
its
View.AccessibilityDelegate.sendAccessibilityEvent(View, int)
is
responsible for handling this call.
sendAccessibilityEvent
in interface AccessibilityEventSource
sendAccessibilityEvent
in class View
eventType
- The type of the event to send, as defined by several types from
AccessibilityEvent
, such as
AccessibilityEvent.TYPE_VIEW_CLICKED
or
AccessibilityEvent.TYPE_VIEW_HOVER_ENTER
.View.onInitializeAccessibilityEvent(AccessibilityEvent)
,
View.dispatchPopulateAccessibilityEvent(AccessibilityEvent)
,
ViewParent.requestSendAccessibilityEvent(View, AccessibilityEvent)
,
View.AccessibilityDelegate
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 AdapterView<ListAdapter>
event
- The event to initialize.View.sendAccessibilityEvent(int)
,
View.dispatchPopulateAccessibilityEvent(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 AdapterView<ListAdapter>
info
- The instance to initialize.public boolean performAccessibilityAction(int action, Bundle arguments)
View
AccessibilityNodeInfo
.
If an View.AccessibilityDelegate
has been specified via calling
View.setAccessibilityDelegate(AccessibilityDelegate)
its
View.AccessibilityDelegate.performAccessibilityAction(View, int, Bundle)
is responsible for handling this call.
performAccessibilityAction
in class View
action
- The action to perform.arguments
- Optional action arguments.public boolean isScrollingCacheEnabled()
setScrollingCacheEnabled(boolean)
,
View.setDrawingCacheEnabled(boolean)
public void setScrollingCacheEnabled(boolean enabled)
ViewGroup.setChildrenDrawingCacheEnabled(boolean)
.enabled
- true to enable the scroll cache, false otherwiseisScrollingCacheEnabled()
,
View.setDrawingCacheEnabled(boolean)
public void setTextFilterEnabled(boolean textFilterEnabled)
Adapter
used by this view must implement the
Filterable
interface.textFilterEnabled
- true to enable type filtering, false otherwiseFilterable
public boolean isTextFilterEnabled()
setTextFilterEnabled(boolean)
,
Filterable
public void getFocusedRect(Rect r)
View
View.getDrawingRect(android.graphics.Rect)
)
of the view. However, if your view maintains some idea of internal selection,
such as a cursor, or a selected row or column, you should override this method and
fill in a more specific rectangle.getFocusedRect
in class View
r
- The rectangle to fill in, in this view's coordinates.public boolean isStackFromBottom()
public void setStackFromBottom(boolean stackFromBottom)
stackFromBottom
- true to pin the view's content to the bottom edge,
false to pin the view's content to the top edgepublic Parcelable onSaveInstanceState()
View
Some examples of things you may store here: the current cursor position in a text view (but usually not the text itself since that is stored in a content provider or other persistent storage), the currently selected item in a list view.
onSaveInstanceState
in class View
View.onRestoreInstanceState(android.os.Parcelable)
,
View.saveHierarchyState(android.util.SparseArray)
,
View.dispatchSaveInstanceState(android.util.SparseArray)
,
View.setSaveEnabled(boolean)
public void onRestoreInstanceState(Parcelable state)
View
View.onSaveInstanceState()
. This function will never be called with a
null state.onRestoreInstanceState
in class View
state
- The frozen state that had previously been returned by
View.onSaveInstanceState()
.View.onSaveInstanceState()
,
View.restoreHierarchyState(android.util.SparseArray)
,
View.dispatchRestoreInstanceState(android.util.SparseArray)
public void setFilterText(String filterText)
filterText
- The text to use for the filter.setTextFilterEnabled(boolean)
public CharSequence getTextFilter()
protected 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 void requestLayout()
View
requestLayout
in interface ViewParent
requestLayout
in class View
protected int computeVerticalScrollExtent()
View
Compute the vertical extent of the horizontal scrollbar's thumb within the vertical range. This value is used to compute the length of the thumb within the scrollbar's track.
The range is expressed in arbitrary units that must be the same as the
units used by View.computeVerticalScrollRange()
and
View.computeVerticalScrollOffset()
.
The default extent is the drawing height of this view.
computeVerticalScrollExtent
in class View
View.computeVerticalScrollRange()
,
View.computeVerticalScrollOffset()
,
ScrollBarDrawable
protected int computeVerticalScrollOffset()
View
Compute the vertical offset of the vertical scrollbar's thumb within the horizontal range. This value is used to compute the position of the thumb within the scrollbar's track.
The range is expressed in arbitrary units that must be the same as the
units used by View.computeVerticalScrollRange()
and
View.computeVerticalScrollExtent()
.
The default offset is the scroll offset of this view.
computeVerticalScrollOffset
in class View
View.computeVerticalScrollRange()
,
View.computeVerticalScrollExtent()
,
ScrollBarDrawable
protected int computeVerticalScrollRange()
View
Compute the vertical range that the vertical scrollbar represents.
The range is expressed in arbitrary units that must be the same as the
units used by View.computeVerticalScrollExtent()
and
View.computeVerticalScrollOffset()
.
computeVerticalScrollRange
in class View
The default range is the drawing height of this view.
View.computeVerticalScrollExtent()
,
View.computeVerticalScrollOffset()
,
ScrollBarDrawable
protected float getTopFadingEdgeStrength()
View
getTopFadingEdgeStrength
in class View
protected float getBottomFadingEdgeStrength()
View
getBottomFadingEdgeStrength
in class View
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
View
Measure the view and its content to determine the measured width and the
measured height. This method is invoked by View.measure(int, int)
and
should be overriden by subclasses to provide accurate and efficient
measurement of their contents.
CONTRACT: When overriding this method, you
must call View.setMeasuredDimension(int, int)
to store the
measured width and height of this view. Failure to do so will trigger an
IllegalStateException
, thrown by
View.measure(int, int)
. Calling the superclass'
View.onMeasure(int, int)
is a valid use.
The base class implementation of measure defaults to the background size,
unless a larger size is allowed by the MeasureSpec. Subclasses should
override View.onMeasure(int, int)
to provide better measurements of
their content.
If this method is overridden, it is the subclass's responsibility to make
sure the measured height and width are at least the view's minimum height
and width (View.getSuggestedMinimumHeight()
and
View.getSuggestedMinimumWidth()
).
onMeasure
in class View
widthMeasureSpec
- horizontal space requirements as imposed by the parent.
The requirements are encoded with
View.MeasureSpec
.heightMeasureSpec
- vertical space requirements as imposed by the parent.
The requirements are encoded with
View.MeasureSpec
.View.getMeasuredWidth()
,
View.getMeasuredHeight()
,
View.setMeasuredDimension(int, int)
,
View.getSuggestedMinimumHeight()
,
View.getSuggestedMinimumWidth()
,
View.MeasureSpec.getMode(int)
,
View.MeasureSpec.getSize(int)
protected void onLayout(boolean changed, int l, int t, int r, int b)
layoutChildren()
instead.onLayout
in class AdapterView<ListAdapter>
changed
- This is a new size or position for this viewl
- Left position, relative to parentt
- Top position, relative to parentr
- Right position, relative to parentb
- Bottom position, relative to parentprotected boolean setFrame(int left, int top, int right, int bottom)
View
protected void layoutChildren()
public View getSelectedView()
getSelectedView
in class AdapterView<ListAdapter>
public int getListPaddingTop()
View.getPaddingTop()
,
getSelector()
public int getListPaddingBottom()
View.getPaddingBottom()
,
getSelector()
public int getListPaddingLeft()
View.getPaddingLeft()
,
getSelector()
public int getListPaddingRight()
View.getPaddingRight()
,
getSelector()
protected void dispatchDraw(Canvas canvas)
ViewGroup
dispatchDraw
in class ViewGroup
canvas
- the canvas on which to draw the viewprotected boolean isPaddingOffsetRequired()
View
isPaddingOffsetRequired
in class View
View.getLeftPaddingOffset()
,
View.getRightPaddingOffset()
,
View.getTopPaddingOffset()
,
View.getBottomPaddingOffset()
protected int getLeftPaddingOffset()
View
View.isPaddingOffsetRequired()
returns true.getLeftPaddingOffset
in class View
View.isPaddingOffsetRequired()
protected int getTopPaddingOffset()
View
View.isPaddingOffsetRequired()
returns true.getTopPaddingOffset
in class View
View.isPaddingOffsetRequired()
protected int getRightPaddingOffset()
View
View.isPaddingOffsetRequired()
returns true.getRightPaddingOffset
in class View
View.isPaddingOffsetRequired()
protected int getBottomPaddingOffset()
View
View.isPaddingOffsetRequired()
returns true.getBottomPaddingOffset
in class View
View.isPaddingOffsetRequired()
protected void onSizeChanged(int w, int h, int oldw, int oldh)
View
onSizeChanged
in class View
w
- Current width of this view.h
- Current height of this view.oldw
- Old width of this view.oldh
- Old height of this view.public void setDrawSelectorOnTop(boolean onTop)
onTop
- If true, the selector will be drawn on the item it is highlighting. The default
is false.public void setSelector(int resID)
resID
- A Drawable resource to use as the selection highlight.public void setSelector(Drawable sel)
public Drawable getSelector()
Drawable
that is used to draw the
selection in the list.protected void drawableStateChanged()
View
Be sure to call through to the superclass when overriding this function.
drawableStateChanged
in class ViewGroup
Drawable.setState(int[])
protected int[] onCreateDrawableState(int extraSpace)
View
Drawable
state for
this view. This is called by the view
system when the cached Drawable state is determined to be invalid. To
retrieve the current state, you should use View.getDrawableState()
.onCreateDrawableState
in class ViewGroup
extraSpace
- if non-zero, this is the number of extra entries you
would like in the returned array in which you can place your own
states.Drawable
state of
the view.View.mergeDrawableStates(int[], int[])
public boolean verifyDrawable(Drawable dr)
View
Be sure to call through to the super class when overriding this function.
verifyDrawable
in class View
dr
- The Drawable to verify. Return true if it is one you are
displaying, else return the result of calling through to the
super class.View.unscheduleDrawable(android.graphics.drawable.Drawable)
,
View.drawableStateChanged()
public void jumpDrawablesToCurrentState()
View
Drawable.jumpToCurrentState()
on all Drawable objects associated with this view.jumpDrawablesToCurrentState
in class ViewGroup
protected void onAttachedToWindow()
View
View.onDraw(android.graphics.Canvas)
,
however it may be called any time before the first onDraw -- including
before or after View.onMeasure(int, int)
.onAttachedToWindow
in class View
View.onDetachedFromWindow()
protected void onDetachedFromWindow()
View
onDetachedFromWindow
in class AdapterView<ListAdapter>
View.onAttachedToWindow()
public void onWindowFocusChanged(boolean hasWindowFocus)
View
onWindowFocusChanged
in class View
hasWindowFocus
- True if the window containing this view now has
focus, false otherwise.protected ContextMenu.ContextMenuInfo getContextMenuInfo()
View
OnCreateContextMenuListener#onCreateContextMenu(ContextMenu, View, ContextMenuInfo)
callback.getContextMenuInfo
in class View
public boolean showContextMenu(float x, float y, int metaState)
View
showContextMenu
in class View
x
- The referenced x coordinate.y
- The referenced y coordinate.metaState
- The keyboard modifiers that were pressed.public boolean showContextMenuForChild(View originalView)
ViewGroup
In most cases, a subclass does not need to override this. However, if
the subclass is added directly to the window manager (for example,
ViewManager.addView(View, android.view.ViewGroup.LayoutParams)
)
then it should override this and show the context menu.
showContextMenuForChild
in interface ViewParent
showContextMenuForChild
in class ViewGroup
originalView
- The source view where the context menu was first invokedpublic boolean onKeyDown(int keyCode, KeyEvent event)
View
KeyEvent.Callback.onKeyDown()
: perform press of the view
when KeyEvent.KEYCODE_DPAD_CENTER
or KeyEvent.KEYCODE_ENTER
is released, if the view is enabled and clickable.
Key presses in software keyboards will generally NOT trigger this listener, although some may elect to do so in some situations. Do not rely on this to catch software key presses.
onKeyDown
in interface KeyEvent.Callback
onKeyDown
in class View
keyCode
- A key code that represents the button pressed, from
KeyEvent
.event
- The KeyEvent object that defines the button action.public boolean onKeyUp(int keyCode, KeyEvent event)
View
KeyEvent.Callback.onKeyUp()
: perform clicking of the view
when KeyEvent.KEYCODE_DPAD_CENTER
or
KeyEvent.KEYCODE_ENTER
is released.
Key presses in software keyboards will generally NOT trigger this listener, although some may elect to do so in some situations. Do not rely on this to catch software key presses.
onKeyUp
in interface KeyEvent.Callback
onKeyUp
in class View
keyCode
- A key code that represents the button pressed, from
KeyEvent
.event
- The KeyEvent object that defines the button action.protected void dispatchSetPressed(boolean pressed)
View
dispatchSetPressed
in class ViewGroup
pressed
- The new pressed stateView.setPressed(boolean)
public int pointToPosition(int x, int y)
x
- X in local coordinatey
- Y in local coordinateAdapterView.INVALID_POSITION
if the point does not intersect an item.public long pointToRowId(int x, int y)
x
- X in local coordinatey
- Y in local coordinateAdapterView.INVALID_ROW_ID
if the point does not intersect an item.public void onTouchModeChanged(boolean isInTouchMode)
ViewTreeObserver.OnTouchModeChangeListener
onTouchModeChanged
in interface ViewTreeObserver.OnTouchModeChangeListener
isInTouchMode
- True if the view hierarchy is now in touch mode, false otherwise.public boolean onTouchEvent(MotionEvent ev)
View
onTouchEvent
in class View
ev
- The motion event.protected void onOverScrolled(int scrollX, int scrollY, boolean clampedX, boolean clampedY)
View
View.overScrollBy(int, int, int, int, int, int, int, int, boolean)
to
respond to the results of an over-scroll operation.onOverScrolled
in class View
scrollX
- New X scroll value in pixelsscrollY
- New Y scroll value in pixelsclampedX
- True if scrollX was clamped to an over-scroll boundaryclampedY
- True if scrollY was clamped to an over-scroll boundarypublic boolean onGenericMotionEvent(MotionEvent event)
View
Generic motion events describe joystick movements, mouse hovers, track pad
touches, scroll wheel movements and other input events. The
source
of the motion event specifies
the class of input that was received. Implementations of this method
must examine the bits in the source before processing the event.
The following code example shows how this is done.
Generic motion events with source class InputDevice.SOURCE_CLASS_POINTER
are delivered to the view under the pointer. All other generic motion events are
delivered to the focused view.
public boolean onGenericMotionEvent(MotionEvent event) { if ((event.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) { if (event.getAction() == MotionEvent.ACTION_MOVE) { // process the joystick movement... return true; } } if ((event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != 0) { switch (event.getAction()) { case MotionEvent.ACTION_HOVER_MOVE: // process the mouse hover movement... return true; case MotionEvent.ACTION_SCROLL: // process the scroll wheel movement... return true; } } return super.onGenericMotionEvent(event); }
onGenericMotionEvent
in class View
event
- The generic motion event being processed.public void draw(Canvas canvas)
View
View.onDraw(android.graphics.Canvas)
instead of overriding this method.
If you do need to override this method, call the superclass version.public void setOverScrollEffectPadding(int leftPadding, int rightPadding)
public void requestDisallowInterceptTouchEvent(boolean disallowIntercept)
ViewGroup
ViewGroup.onInterceptTouchEvent(MotionEvent)
.
This parent should pass this call onto its parents. This parent must obey this request for the duration of the touch (that is, only clear the flag after this parent has received an up or a cancel.
requestDisallowInterceptTouchEvent
in interface ViewParent
requestDisallowInterceptTouchEvent
in class ViewGroup
disallowIntercept
- True if the child does not want the parent to
intercept touch events.public boolean onInterceptTouchEvent(MotionEvent ev)
ViewGroup
Using this function takes some care, as it has a fairly complicated
interaction with View.onTouchEvent(MotionEvent)
, and using it requires implementing
that method as well as this one in the correct way. Events will be
received in the following order:
MotionEvent.ACTION_CANCEL
, and all further
events will be delivered to your onTouchEvent() method and no longer
appear here.
onInterceptTouchEvent
in class ViewGroup
ev
- The motion event being dispatched down the hierarchy.public void addTouchables(ArrayList<View> views)
addTouchables
in class ViewGroup
views
- Touchable views found so farpublic void setFriction(float friction)
ViewConfiguration.getScrollFriction()
.public void setVelocityScale(float scale)
scale
- The scale factor to multiply the velocity by.public void smoothScrollToPosition(int position)
position
- Scroll to this adapter position.public void smoothScrollToPositionFromTop(int position, int offset, int duration)
offset
pixels from
the top edge of the view. If this is impossible, (e.g. the offset would scroll
the first or last item beyond the boundaries of the list) it will get as close
as possible. The scroll will take duration
milliseconds to complete.position
- Position to scroll tooffset
- Desired distance in pixels of position
from the top
of the view when scrolling is finishedduration
- Number of milliseconds to use for the scrollpublic void smoothScrollToPositionFromTop(int position, int offset)
offset
pixels from
the top edge of the view. If this is impossible, (e.g. the offset would scroll
the first or last item beyond the boundaries of the list) it will get as close
as possible.position
- Position to scroll tooffset
- Desired distance in pixels of position
from the top
of the view when scrolling is finishedpublic void smoothScrollToPosition(int position, int boundPosition)
position
- Scroll to this adapter position.boundPosition
- Do not scroll if it would move this adapter
position out of view.public void smoothScrollBy(int distance, int duration)
distance
- Distance to scroll in pixels.duration
- Duration of the scroll animation in milliseconds.public void invalidateViews()
protected void handleDataChanged()
protected void onDisplayHint(int hint)
View
onDisplayHint
in class View
hint
- A hint about whether or not this view is displayed:
View.VISIBLE
or View.INVISIBLE
.protected boolean isInFilterMode()
AdapterView
public InputConnection onCreateInputConnection(EditorInfo outAttrs)
onCreateInputConnection
in class View
outAttrs
- Fill in with attribute information about the connection.public boolean checkInputConnectionProxy(View view)
checkInputConnectionProxy
in class View
view
- The View that is making the InputMethodManager call.public void clearTextFilter()
public boolean hasTextFilter()
public void onGlobalLayout()
ViewTreeObserver.OnGlobalLayoutListener
onGlobalLayout
in interface ViewTreeObserver.OnGlobalLayoutListener
public void beforeTextChanged(CharSequence s, int start, int count, int after)
beforeTextChanged
in interface TextWatcher
public void onTextChanged(CharSequence s, int start, int before, int count)
onTextChanged
in interface TextWatcher
public void afterTextChanged(Editable s)
afterTextChanged
in interface TextWatcher
public void onFilterComplete(int count)
Filter.FilterListener
Notifies the end of a filtering operation.
onFilterComplete
in interface Filter.FilterListener
count
- the number of values computed by the filterprotected ViewGroup.LayoutParams generateDefaultLayoutParams()
ViewGroup
ViewGroup.addView(View)
has no layout parameters
already set. If null is returned, an exception is thrown from addView.generateDefaultLayoutParams
in class ViewGroup
protected ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams p)
ViewGroup
ViewGroup.checkLayoutParams(android.view.ViewGroup.LayoutParams)
, this method
is invoked. This method should return a new set of layout params suitable for
this ViewGroup, possibly by copying the appropriate attributes from the
specified set of layout params.generateLayoutParams
in class ViewGroup
p
- The layout parameters to convert into a suitable set of layout parameters
for this ViewGroup.ViewGroup.LayoutParams
or one
of its descendantspublic AbsListView.LayoutParams generateLayoutParams(AttributeSet attrs)
ViewGroup
generateLayoutParams
in class ViewGroup
attrs
- the attributes to build the layout parameters fromViewGroup.LayoutParams
or one
of its descendantsprotected boolean checkLayoutParams(ViewGroup.LayoutParams p)
ViewGroup
checkLayoutParams
in class ViewGroup
public void setTranscriptMode(int mode)
mode
- the transcript mode to setTRANSCRIPT_MODE_DISABLED
,
TRANSCRIPT_MODE_NORMAL
,
TRANSCRIPT_MODE_ALWAYS_SCROLL
public int getTranscriptMode()
public int getSolidColor()
View
getSolidColor
in class View
View.setVerticalFadingEdgeEnabled(boolean)
,
View.setHorizontalFadingEdgeEnabled(boolean)
public void setCacheColorHint(int color)
View.setBackgroundDrawable(Drawable)
).color
- The background colorpublic int getCacheColorHint()
public void reclaimViews(List<View> views)
views
- A list into which to put the reclaimed viewspublic void setRemoteViewsAdapter(Intent intent)
intent
- the intent used to identify the RemoteViewsService for the adapter to connect to.public void setRemoteViewsOnClickHandler(RemoteViews.OnClickHandler handler)
handler
- The OnClickHandler to use when inflating RemoteViews.public void deferNotifyDataSetChanged()
deferNotifyDataSetChanged
in interface RemoteViewsAdapter.RemoteAdapterConnectionCallback
public boolean onRemoteAdapterConnected()
onRemoteAdapterConnected
in interface RemoteViewsAdapter.RemoteAdapterConnectionCallback
public void onRemoteAdapterDisconnected()
onRemoteAdapterDisconnected
in interface RemoteViewsAdapter.RemoteAdapterConnectionCallback
public void setRecyclerListener(AbsListView.RecyclerListener listener)
listener
- The recycler listener to be notified of views set aside
in the recycler.AbsListView.RecycleBin
,
AbsListView.RecyclerListener