Build 1.0_r1(from source)

android.widget
Class AbsListView

java.lang.Object
  extended by android.view.View
      extended by android.view.ViewGroup
          extended by android.widget.AdapterView<ListAdapter>
              extended by android.widget.AbsListView
All Implemented Interfaces:
Drawable.Callback, TextWatcher, KeyEvent.Callback, ViewManager, ViewParent, ViewTreeObserver.OnGlobalLayoutListener, ViewTreeObserver.OnTouchModeChangeListener, Filter.FilterListener
Direct Known Subclasses:
GridView, ListView

public abstract class AbsListView
extends AdapterView<ListAdapter>
implements TextWatcher, ViewTreeObserver.OnGlobalLayoutListener, Filter.FilterListener, ViewTreeObserver.OnTouchModeChangeListener

Common code shared between ListView and GridView


Nested Class Summary
(package private)  class AbsListView.CheckForTap
           
static class AbsListView.LayoutParams
          AbsListView extends LayoutParams to provide a place to hold the view type.
static interface AbsListView.OnScrollListener
          Interface definition for a callback to be invoked when the list or grid has been scrolled.
(package private)  class AbsListView.RecycleBin
          The RecycleBin facilitates reuse of views across layouts.
static interface AbsListView.RecyclerListener
          A RecyclerListener is used to receive a notification whenever a View is placed inside the RecycleBin's scrap heap.
(package private) static class AbsListView.SavedState
           
 
Nested classes/interfaces inherited from class android.widget.AdapterView
AdapterView.AdapterContextMenuInfo, AdapterView.AdapterDataSetObserver, AdapterView.OnItemClickListener, AdapterView.OnItemLongClickListener, AdapterView.OnItemSelectedListener
 
Nested classes/interfaces inherited from class android.view.ViewGroup
ViewGroup.MarginLayoutParams, ViewGroup.OnHierarchyChangeListener
 
Nested classes/interfaces inherited from class android.view.View
View.BaseSavedState, View.MeasureSpec, View.OnClickListener, View.OnCreateContextMenuListener, View.OnFocusChangeListener, View.OnKeyListener, View.OnLongClickListener, View.OnTouchListener
 
Field Summary
(package private) static int LAYOUT_FORCE_BOTTOM
          Show the last item
(package private) static int LAYOUT_FORCE_TOP
          Show the first item
(package private) static int LAYOUT_MOVE_SELECTION
          Layout as a result of using the navigation keys
(package private) static int LAYOUT_NORMAL
          Regular layout - usually an unsolicited layout from the view system
(package private) static int LAYOUT_SET_SELECTION
          Force the selected item to be on somewhere on the screen
(package private) static int LAYOUT_SPECIFIC
          Make a mSelectedItem appear in a specific location and build the rest of the views from there.
(package private) static int LAYOUT_SYNC
          Layout to sync as a result of a data change.
(package private)  ListAdapter mAdapter
          The adapter containing the data to be displayed by this view
(package private)  boolean mCachingStarted
          When the view is scrolling, this flag is set to true to indicate subclasses that the drawing cache was enabled on the children
(package private)  AdapterView.AdapterDataSetObserver mDataSetObserver
          Should be used by subclasses to listen to changes in the dataset
(package private)  boolean mDrawSelectorOnTop
          Indicates whether the list selector should be drawn on top of the children or behind
(package private)  int mLastY
          Y value from on the previous motion event (if any)
(package private)  int mLayoutMode
          Controls how the next layout will happen
(package private)  Rect mListPadding
          This view's padding
(package private)  int mMotionCorrection
          How far the finger moved before we started scrolling
(package private)  int mMotionPosition
          The position of the view that received the down motion event
(package private)  int mMotionViewNewTop
          The desired offset to the top of the mMotionPosition view after a scroll
(package private)  int mMotionViewOriginalTop
          The offset to the top of the mMotionPosition view when the down motion event was received
(package private)  int mMotionX
          The X value associated with the the down motion event
(package private)  int mMotionY
          The Y value associated with the the down motion event
(package private)  PopupWindow mPopup
          Keeps track of our accessory window
(package private)  AbsListView.RecycleBin mRecycler
          The data set used to store unused views that should be reused during the next layout to avoid creating new ones
(package private)  int mResurrectToPosition
          The position to resurrect the selected position to.
(package private)  View mScrollDown
          The down scroll indicator
(package private)  boolean mScrollingCacheEnabled
          When set to true, the list automatically discards the children's bitmap cache after scrolling.
(package private)  View mScrollUp
          The top scroll indicator
(package private)  int mSelectedTop
          The offset in pixels form the top of the AdapterView to the top of the currently selected view.
(package private)  int mSelectionBottomPadding
          The selection's bottom padding
(package private)  int mSelectionLeftPadding
          The selection's left padding
(package private)  int mSelectionRightPadding
          The selection's right padding
(package private)  int mSelectionTopPadding
          The selection's top padding
(package private)  Drawable mSelector
          The drawable used to draw the selector
(package private)  Rect mSelectorRect
          Defines the selector's location and dimension at drawing time
(package private)  boolean mStackFromBottom
          Indicates whether the list is stacked from the bottom edge or the top edge.
(package private)  EditText mTextFilter
          Used with type filter window
(package private)  int mTouchMode
          One of TOUCH_MODE_REST, TOUCH_MODE_DOWN, TOUCH_MODE_TAP, TOUCH_MODE_SCROLL, or TOUCH_MODE_DONE_WAITING
(package private)  int mWidthMeasureSpec
          Subclasses must retain their measure spec from onMeasure() into this member
(package private) static int TOUCH_MODE_DONE_WAITING
          Indicates we have waited for everything we can wait for, but the user's finger is still down
(package private) static int TOUCH_MODE_DOWN
          Indicates we just received the touch event and we are waiting to see if the it is a tap or a scroll gesture.
(package private) static int TOUCH_MODE_FLING
          Indicates the view is in the process of being flung
(package private) static int TOUCH_MODE_REST
          Indicates that we are not in the middle of a touch gesture
(package private) static int TOUCH_MODE_SCROLL
          Indicates the touch gesture is a scroll
(package private) static int TOUCH_MODE_TAP
          Indicates the touch has been recognized as a tap and we are now waiting to see if the touch is a longpress
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.
 
Fields inherited from class android.widget.AdapterView
INVALID_POSITION, INVALID_ROW_ID, ITEM_VIEW_TYPE_HEADER_OR_FOOTER, ITEM_VIEW_TYPE_IGNORE, mBlockLayoutRequests, mDataChanged, mEmptyView, mFirstPosition, mInLayout, mItemCount, mNeedSync, mNextSelectedPosition, mNextSelectedRowId, mOldItemCount, mOldSelectedPosition, mOldSelectedRowId, mOnItemClickListener, mOnItemLongClickListener, mOnItemSelectedListener, mSelectedPosition, mSelectedRowId, mSpecificTop, mSyncHeight, mSyncMode, mSyncPosition, mSyncRowId, SYNC_FIRST_POSITION, SYNC_MAX_DURATION_MILLIS, SYNC_SELECTED_POSITION
 
Fields inherited from class android.view.ViewGroup
CLIP_TO_PADDING_MASK, FLAG_SUPPORT_STATIC_TRANSFORMATIONS, FLAG_USE_CHILD_DRAWING_ORDER, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, mDisappearingChildren, mGroupFlags, mOnHierarchyChangeListener, mPersistentDrawingCache, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE
 
Fields inherited from class android.view.View
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, FIRST_STATE_SET, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, INVISIBLE, KEEP_SCREEN_ON, LAST_STATE_SET, mBottom, mContext, mCurrentAnimation, MIDDLE_STATE_SET, mLayoutParams, mLeft, mLocation, mMeasuredHeight, mMeasuredWidth, mOnClickListener, mOnCreateContextMenuListener, mOnFocusChangeListener, mOnLongClickListener, mPaddingBottom, mPaddingLeft, mPaddingRight, mPaddingTop, mParent, mRight, mScrollX, mScrollY, mTag, mTop, NO_ID, 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_FIRST_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_LAST_STATE_SET, PRESSED_MIDDLE_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_SINGLE_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SINGLE_STATE_SET, SOUND_EFFECTS_ENABLED, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET
 
Constructor Summary
AbsListView(Context context)
           
AbsListView(Context context, AttributeSet attrs)
           
AbsListView(Context context, AttributeSet attrs, int defStyle)
           
 
Method Summary
 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 associated with the text filter
 void beforeTextChanged(CharSequence s, int start, int count, int after)
          For our text watcher that associated with the text filter
protected  boolean checkLayoutParams(ViewGroup.LayoutParams p)
          
 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.
(package private)  ContextMenu.ContextMenuInfo createContextMenuInfo(View view, int position, long id)
          Creates the ContextMenuInfo returned from getContextMenuInfo().
(package private)  void dismissPopup()
          Removes the filter window
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.
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.
(package private) abstract  void fillGap(boolean down)
          Fills the gap left open by a touch-scroll.
(package private) abstract  int findMotionRow(int y)
          Find the row closest to y.
 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.
 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
protected  ContextMenu.ContextMenuInfo getContextMenuInfo()
          Views should implement this if they have extra information to associate with the context menu.
(package private) static int getDistance(Rect source, Rect dest, int direction)
          What is the distance between the source and destination rectangles given the direction of focus navigation between them? The direction basically helps figure out more quickly what is self evident by the relationship between the rects...
 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.
(package private)  int getFooterViewsCount()
          Returns the number of footer views in the list.
(package private)  int getHeaderViewsCount()
          Returns the number of header views in the list.
 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.
 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.
protected  float getTopFadingEdgeStrength()
          Returns the strength, or intensity, of the top faded edge.
 int getTranscriptMode()
          Returns the current transcript mode.
protected  void handleDataChanged()
           
 boolean hasTextFilter()
          Returns if the ListView currently has a text filter.
(package private)  void hideSelector()
           
 void invalidateViews()
          Causes all the views to be rebuilt and redrawn.
(package private)  void invokeOnItemScrollListener()
          Notify our scroll listener (if there is one) of a change in scroll state
protected  boolean isInFilterMode()
          Indicates whether this view is in filter mode.
 boolean isScrollingCacheEnabled()
          Indicates whether the children's drawing cache is used during a scroll.
 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
(package private)  void keyPressed()
          Sets the selector state to "pressed" and posts a CheckForKeyLongPress to see if this is a long press.
protected  void layoutChildren()
           
(package private)  View obtainView(int position)
          Get a view and have it show the data associated with the specified position.
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.
protected  void onDetachedFromWindow()
          This is called when the view is detached from a window.
 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.
 void onGlobalLayout()
          Callback method to be invoked when the global layout state or the visibility of views within the view tree changes
 boolean onInterceptTouchEvent(MotionEvent ev)
          Implement this method to intercept all touch screen motion events.
 boolean onKeyUp(int keyCode, KeyEvent event)
          Default implementation of KeyEvent.Callback.onKeyMultiple(): 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)
          Called from layout when this view should assign a size and position to each of its children.
protected  void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
           Measure the view and its content to determine the measured width and the measured height.
 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 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.
 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.
(package private)  void positionSelector(View sel)
           
 void reclaimViews(List<View> views)
          Move all views (excluding headers and footers) held by this AbsListView into the supplied List.
(package private)  int reconcileSelectedPosition()
           
 void requestLayout()
          Call this when something has changed which has invalidated the layout of this view.
(package private)  void requestLayoutIfNecessary()
           
(package private)  void resetList()
          The list is empty.
(package private)  boolean resurrectSelection()
          Attempt to bring the selection back if the user is switching from touch to trackball mode
(package private)  boolean sendToTextFilter(int keyCode, int count, KeyEvent event)
          Sends a key to the text filter window
 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 setDrawSelectorOnTop(boolean onTop)
          Controls whether the selection highlight drawable should be drawn on top of the item or behind it.
 void setFilterText(String filterText)
          Sets the initial value for the text filter.
 void setOnScrollListener(AbsListView.OnScrollListener l)
          Set the listener that will receive notifications every time the list scrolls.
 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 setScrollIndicators(View up, View down)
           
 void setScrollingCacheEnabled(boolean enabled)
          Enables or disables the children's drawing cache during a scroll.
(package private) abstract  void setSelectionInt(int position)
          Makes the item at the supplied position selected.
 void setSelector(Drawable sel)
           
 void setSelector(int resID)
          Set a Drawable that should be used to highlight the currently selected item.
 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.
(package private)  boolean shouldShowSelector()
          Indicates whether this view is in a state where the selector should be drawn.
 boolean showContextMenuForChild(View originalView)
          Bring up a context menu for the specified view or its ancestors.
(package private)  boolean touchModeDrawsInPressedState()
           
(package private)  void trackMotionScroll(int deltaY, int incrementalDeltaY)
          Track a motion scroll
(package private)  void updateScrollIndicators()
           
 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.
 
Methods inherited from class android.widget.AdapterView
addView, addView, addView, addView, canAnimate, checkFocus, checkSelectionChanged, dispatchRestoreInstanceState, dispatchSaveInstanceState, findSyncPosition, getAdapter, getCount, getEmptyView, getFirstVisiblePosition, getItemAtPosition, getItemIdAtPosition, getLastVisiblePosition, getOnItemClickListener, getOnItemLongClickListener, getOnItemSelectedListener, getPositionForView, getSelectedItem, getSelectedItemId, getSelectedItemPosition, lookForSelectablePosition, performItemClick, rememberSyncState, removeAllViews, removeView, removeViewAt, selectionChanged, setAdapter, setEmptyView, setFocusable, setFocusableInTouchMode, setNextSelectedPositionInt, setOnClickListener, setOnItemClickListener, setOnItemLongClickListener, setOnItemSelectedListener, setSelectedPositionInt, setSelection
 
Methods inherited from class android.view.ViewGroup
addFocusables, addStatesFromChildren, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, childDrawableStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchFreezeSelfOnly, dispatchKeyEvent, dispatchSetSelected, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowVisibilityChanged, drawChild, findFocus, findViewTraversal, findViewWithTagTraversal, fitSystemWindows, focusableViewAvailable, focusSearch, gatherTransparentRegion, generateDefaultLayoutParams, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getPersistentDrawingCache, hasFocus, hasFocusable, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawnWithCacheEnabled, measureChild, measureChildren, measureChildWithMargins, offsetChildrenTopAndBottom, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAnimationEnd, onAnimationStart, onRequestFocusInDescendants, recomputeViewAttributes, removeAllViewsInLayout, removeDetachedView, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestTransparentRegion, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setOnHierarchyChangeListener, setPadding, setPersistentDrawingCache, startLayoutAnimation, updateViewLayout
 
Methods inherited from class android.view.View
applyDrawableToTransparentRegion, bringToFront, buildDrawingCache, cancelLongPress, clearAnimation, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, createContextMenu, debug, debugIndent, destroyDrawingCache, dispatchKeyShortcutEvent, draw, finalize, findViewById, findViewWithTag, focusSearch, forceLayout, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getContext, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFocusables, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getKeepScreenOn, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMeasuredHeight, getMeasuredWidth, getNextFocusDownId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getResources, getRight, getRightFadingEdgeStrength, getRootView, getScrollBarStyle, getScrollX, getScrollY, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getTag, getTop, getTouchables, getTouchDelegate, getVerticalFadingEdgeLength, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowToken, getWindowVisibility, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, invalidateDrawable, isClickable, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isInTouchMode, isLayoutRequested, isLongClickable, isPressed, isRootNamespace, isSaveEnabled, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, layout, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onCreateContextMenu, onDraw, onFinishInflate, onKeyDown, onKeyMultiple, onKeyShortcut, onScrollChanged, onSetAlpha, onTrackballEvent, onWindowVisibilityChanged, performClick, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, refreshDrawableState, removeCallbacks, requestFocus, requestFocus, requestFocusFromTouch, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, setAnimation, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setClickable, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFrame, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setId, setIsRootNamespace, setKeepScreenOn, setLayoutParams, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnCreateContextMenuListener, setOnFocusChangeListener, setOnKeyListener, setOnLongClickListener, setOnTouchListener, setPressed, setSaveEnabled, setScrollBarStyle, setSelected, setSoundEffectsEnabled, setTag, setTouchDelegate, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVisibility, setWillNotCacheDrawing, setWillNotDraw, showContextMenu, startAnimation, unscheduleDrawable, unscheduleDrawable, willNotCacheDrawing, willNotDraw
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface android.view.ViewParent
createContextMenu, getParent, isLayoutRequested
 

Field Detail

TRANSCRIPT_MODE_DISABLED

public static final int TRANSCRIPT_MODE_DISABLED
Disables the transcript mode.

See Also:
setTranscriptMode(int), Constant Field Values

TRANSCRIPT_MODE_NORMAL

public static final 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.

See Also:
setTranscriptMode(int), Constant Field Values

TRANSCRIPT_MODE_ALWAYS_SCROLL

public static final int TRANSCRIPT_MODE_ALWAYS_SCROLL
The list will automatically scroll to the bottom, no matter what items are currently visible.

See Also:
setTranscriptMode(int), Constant Field Values

TOUCH_MODE_REST

static final int TOUCH_MODE_REST
Indicates that we are not in the middle of a touch gesture

See Also:
Constant Field Values

TOUCH_MODE_DOWN

static final int TOUCH_MODE_DOWN
Indicates we just received the touch event and we are waiting to see if the it is a tap or a scroll gesture.

See Also:
Constant Field Values

TOUCH_MODE_TAP

static final int TOUCH_MODE_TAP
Indicates the touch has been recognized as a tap and we are now waiting to see if the touch is a longpress

See Also:
Constant Field Values

TOUCH_MODE_DONE_WAITING

static final int TOUCH_MODE_DONE_WAITING
Indicates we have waited for everything we can wait for, but the user's finger is still down

See Also:
Constant Field Values

TOUCH_MODE_SCROLL

static final int TOUCH_MODE_SCROLL
Indicates the touch gesture is a scroll

See Also:
Constant Field Values

TOUCH_MODE_FLING

static final int TOUCH_MODE_FLING
Indicates the view is in the process of being flung

See Also:
Constant Field Values

LAYOUT_NORMAL

static final int LAYOUT_NORMAL
Regular layout - usually an unsolicited layout from the view system

See Also:
Constant Field Values

LAYOUT_FORCE_TOP

static final int LAYOUT_FORCE_TOP
Show the first item

See Also:
Constant Field Values

LAYOUT_SET_SELECTION

static final int LAYOUT_SET_SELECTION
Force the selected item to be on somewhere on the screen

See Also:
Constant Field Values

LAYOUT_FORCE_BOTTOM

static final int LAYOUT_FORCE_BOTTOM
Show the last item

See Also:
Constant Field Values

LAYOUT_SPECIFIC

static final int LAYOUT_SPECIFIC
Make a mSelectedItem appear in a specific location and build the rest of the views from there. The top is specified by mSpecificTop.

See Also:
Constant Field Values

LAYOUT_SYNC

static final int LAYOUT_SYNC
Layout to sync as a result of a data change. Restore mSyncPosition to have its top at mSpecificTop

See Also:
Constant Field Values

LAYOUT_MOVE_SELECTION

static final int LAYOUT_MOVE_SELECTION
Layout as a result of using the navigation keys

See Also:
Constant Field Values

mLayoutMode

int mLayoutMode
Controls how the next layout will happen


mDataSetObserver

AdapterView.AdapterDataSetObserver mDataSetObserver
Should be used by subclasses to listen to changes in the dataset


mAdapter

ListAdapter mAdapter
The adapter containing the data to be displayed by this view


mDrawSelectorOnTop

boolean mDrawSelectorOnTop
Indicates whether the list selector should be drawn on top of the children or behind


mSelector

Drawable mSelector
The drawable used to draw the selector


mSelectorRect

Rect mSelectorRect
Defines the selector's location and dimension at drawing time


mRecycler

final AbsListView.RecycleBin mRecycler
The data set used to store unused views that should be reused during the next layout to avoid creating new ones


mSelectionLeftPadding

int mSelectionLeftPadding
The selection's left padding


mSelectionTopPadding

int mSelectionTopPadding
The selection's top padding


mSelectionRightPadding

int mSelectionRightPadding
The selection's right padding


mSelectionBottomPadding

int mSelectionBottomPadding
The selection's bottom padding


mListPadding

Rect mListPadding
This view's padding


mWidthMeasureSpec

int mWidthMeasureSpec
Subclasses must retain their measure spec from onMeasure() into this member


mScrollUp

View mScrollUp
The top scroll indicator


mScrollDown

View mScrollDown
The down scroll indicator


mCachingStarted

boolean mCachingStarted
When the view is scrolling, this flag is set to true to indicate subclasses that the drawing cache was enabled on the children


mMotionPosition

int mMotionPosition
The position of the view that received the down motion event


mMotionViewOriginalTop

int mMotionViewOriginalTop
The offset to the top of the mMotionPosition view when the down motion event was received


mMotionViewNewTop

int mMotionViewNewTop
The desired offset to the top of the mMotionPosition view after a scroll


mMotionX

int mMotionX
The X value associated with the the down motion event


mMotionY

int mMotionY
The Y value associated with the the down motion event


mTouchMode

int mTouchMode
One of TOUCH_MODE_REST, TOUCH_MODE_DOWN, TOUCH_MODE_TAP, TOUCH_MODE_SCROLL, or TOUCH_MODE_DONE_WAITING


mLastY

int mLastY
Y value from on the previous motion event (if any)


mMotionCorrection

int mMotionCorrection
How far the finger moved before we started scrolling


mSelectedTop

int mSelectedTop
The offset in pixels form the top of the AdapterView to the top of the currently selected view. Used to save and restore state.


mStackFromBottom

boolean mStackFromBottom
Indicates whether the list is stacked from the bottom edge or the top edge.


mScrollingCacheEnabled

boolean mScrollingCacheEnabled
When set to true, the list automatically discards the children's bitmap cache after scrolling.


mPopup

PopupWindow mPopup
Keeps track of our accessory window


mTextFilter

EditText mTextFilter
Used with type filter window


mResurrectToPosition

int mResurrectToPosition
The position to resurrect the selected position to.

Constructor Detail

AbsListView

public AbsListView(Context context)

AbsListView

public AbsListView(Context context,
                   AttributeSet attrs)

AbsListView

public AbsListView(Context context,
                   AttributeSet attrs,
                   int defStyle)
Method Detail

setOnScrollListener

public void setOnScrollListener(AbsListView.OnScrollListener l)
Set the listener that will receive notifications every time the list scrolls.

Parameters:
l - the scroll listener

invokeOnItemScrollListener

void invokeOnItemScrollListener()
Notify our scroll listener (if there is one) of a change in scroll state


isScrollingCacheEnabled

public boolean isScrollingCacheEnabled()
Indicates whether the children's drawing cache is used during a scroll. By default, the drawing cache is enabled but this will consume more memory.

Returns:
true if the scrolling cache is enabled, false otherwise
See Also:
setScrollingCacheEnabled(boolean), View.setDrawingCacheEnabled(boolean)

setScrollingCacheEnabled

public void setScrollingCacheEnabled(boolean enabled)
Enables or disables the children's drawing cache during a scroll. By default, the drawing cache is enabled but this will use more memory. When the scrolling cache is enabled, the caches are kept after the first scrolling. You can manually clear the cache by calling ViewGroup.setChildrenDrawingCacheEnabled(boolean).

Parameters:
enabled - true to enable the scroll cache, false otherwise
See Also:
isScrollingCacheEnabled(), View.setDrawingCacheEnabled(boolean)

setTextFilterEnabled

public void setTextFilterEnabled(boolean textFilterEnabled)
Enables or disables the type filter window. If enabled, typing when this view has focus will filter the children to match the users input. Note that the Adapter used by this view must implement the Filterable interface.

Parameters:
textFilterEnabled - true to enable type filtering, false otherwise
See Also:
Filterable

isTextFilterEnabled

public boolean isTextFilterEnabled()
Indicates whether type filtering is enabled for this view

Returns:
true if type filtering is enabled, false otherwise
See Also:
setTextFilterEnabled(boolean), Filterable

getFocusedRect

public void getFocusedRect(Rect r)
Description copied from class: View
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. By default, the rectange is the 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.

Overrides:
getFocusedRect in class View
Parameters:
r - The rectangle to fill in, in this view's coordinates.

isStackFromBottom

public boolean isStackFromBottom()
Indicates whether the content of this view is pinned to, or stacked from, the bottom edge.

Returns:
true if the content is stacked from the bottom edge, false otherwise

setStackFromBottom

public void setStackFromBottom(boolean stackFromBottom)
When stack from bottom is set to true, the list fills its content starting from the bottom of the view.

Parameters:
stackFromBottom - true to pin the view's content to the bottom edge, false to pin the view's content to the top edge

requestLayoutIfNecessary

void requestLayoutIfNecessary()

onSaveInstanceState

public Parcelable onSaveInstanceState()
Description copied from class: View
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. This state should only contain information that is not persistent or can not be reconstructed later. For example, you will never store your current position on screen because that will be computed again when a new instance of the view is placed in its view hierarchy.

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.

Overrides:
onSaveInstanceState in class View
Returns:
Returns a Parcelable object containing the view's current dynamic state, or null if there is nothing interesting to save. The default implementation returns null.
See Also:
View.onRestoreInstanceState(android.os.Parcelable), View.saveHierarchyState(android.util.SparseArray), View.dispatchSaveInstanceState(android.util.SparseArray), View.setSaveEnabled(boolean)

onRestoreInstanceState

public void onRestoreInstanceState(Parcelable state)
Description copied from class: View
Hook allowing a view to re-apply a representation of its internal state that had previously been generated by View.onSaveInstanceState(). This function will never be called with a null state.

Overrides:
onRestoreInstanceState in class View
Parameters:
state - The frozen state that had previously been returned by View.onSaveInstanceState().
See Also:
View.onSaveInstanceState(), View.restoreHierarchyState(android.util.SparseArray), View.dispatchRestoreInstanceState(android.util.SparseArray)

setFilterText

public void setFilterText(String filterText)
Sets the initial value for the text filter.

Parameters:
filterText - The text to use for the filter.
See Also:
setTextFilterEnabled(boolean)

onFocusChanged

protected void onFocusChanged(boolean gainFocus,
                              int direction,
                              Rect previouslyFocusedRect)
Description copied from class: View
Called by the view system when the focus state of this view changes. When the focus change event is caused by directional navigation, direction and previouslyFocusedRect provide insight into where the focus is coming from.

Overrides:
onFocusChanged in class View
Parameters:
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 or View.FOCUS_RIGHT. 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.

requestLayout

public void requestLayout()
Description copied from class: View
Call this when something has changed which has invalidated the layout of this view. This will schedule a layout pass of the view tree.

Specified by:
requestLayout in interface ViewParent
Overrides:
requestLayout in class View

resetList

void resetList()
The list is empty. Clear everything out.


computeVerticalScrollExtent

protected int computeVerticalScrollExtent()
Description copied from class: 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.computeHorizontalScrollRange() and View.computeVerticalScrollOffset().

The default extent is the drawing height of this view.

Overrides:
computeVerticalScrollExtent in class View
Returns:
the vertical extent of the scrollbar's thumb
See Also:
View.computeVerticalScrollRange(), View.computeVerticalScrollOffset(), ScrollBarDrawable

computeVerticalScrollOffset

protected int computeVerticalScrollOffset()
Description copied from class: 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.

Overrides:
computeVerticalScrollOffset in class View
Returns:
the vertical offset of the scrollbar's thumb
See Also:
View.computeVerticalScrollRange(), View.computeVerticalScrollExtent(), ScrollBarDrawable

computeVerticalScrollRange

protected int computeVerticalScrollRange()
Description copied from class: 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().

Overrides:
computeVerticalScrollRange in class View
Returns:
the total vertical range represented by the vertical scrollbar

The default range is the drawing height of this view.

See Also:
View.computeVerticalScrollExtent(), View.computeVerticalScrollOffset(), ScrollBarDrawable

getTopFadingEdgeStrength

protected float getTopFadingEdgeStrength()
Description copied from class: View
Returns the strength, or intensity, of the top faded edge. The strength is a value between 0.0 (no fade) and 1.0 (full fade). The default implementation returns 0.0 or 1.0 but no value in between. Subclasses should override this method to provide a smoother fade transition when scrolling occurs.

Overrides:
getTopFadingEdgeStrength in class View
Returns:
the intensity of the top fade as a float between 0.0f and 1.0f

getBottomFadingEdgeStrength

protected float getBottomFadingEdgeStrength()
Description copied from class: View
Returns the strength, or intensity, of the bottom faded edge. The strength is a value between 0.0 (no fade) and 1.0 (full fade). The default implementation returns 0.0 or 1.0 but no value in between. Subclasses should override this method to provide a smoother fade transition when scrolling occurs.

Overrides:
getBottomFadingEdgeStrength in class View
Returns:
the intensity of the bottom fade as a float between 0.0f and 1.0f

onMeasure

protected void onMeasure(int widthMeasureSpec,
                         int heightMeasureSpec)
Description copied from class: 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()).

Overrides:
onMeasure in class View
Parameters:
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.
See Also:
View.getMeasuredWidth(), View.getMeasuredHeight(), View.setMeasuredDimension(int, int), View.getSuggestedMinimumHeight(), View.getSuggestedMinimumWidth(), View.MeasureSpec.getMode(int), View.MeasureSpec.getSize(int)

onLayout

protected void onLayout(boolean changed,
                        int l,
                        int t,
                        int r,
                        int b)
Description copied from class: ViewGroup
Called from layout when this view should assign a size and position to each of its children. Derived classes with children should override this method and call layout on each of their their children.

Overrides:
onLayout in class AdapterView<ListAdapter>
Parameters:
changed - This is a new size or position for this view
l - Left position, relative to parent
t - Top position, relative to parent
r - Right position, relative to parent
b - Bottom position, relative to parent

layoutChildren

protected void layoutChildren()

updateScrollIndicators

void updateScrollIndicators()

getSelectedView

public View getSelectedView()
Specified by:
getSelectedView in class AdapterView<ListAdapter>
Returns:
The view corresponding to the currently selected item, or null if nothing is selected

getListPaddingTop

public int getListPaddingTop()
List padding is the maximum of the normal view's padding and the padding of the selector.

Returns:
The top list padding.
See Also:
View.getPaddingTop(), getSelector()

getListPaddingBottom

public int getListPaddingBottom()
List padding is the maximum of the normal view's padding and the padding of the selector.

Returns:
The bottom list padding.
See Also:
View.getPaddingBottom(), getSelector()

getListPaddingLeft

public int getListPaddingLeft()
List padding is the maximum of the normal view's padding and the padding of the selector.

Returns:
The left list padding.
See Also:
View.getPaddingLeft(), getSelector()

getListPaddingRight

public int getListPaddingRight()
List padding is the maximum of the normal view's padding and the padding of the selector.

Returns:
The right list padding.
See Also:
View.getPaddingRight(), getSelector()

obtainView

View obtainView(int position)
Get a view and have it show the data associated with the specified position. This is called when we have already discovered that the view is not available for reuse in the recycle bin. The only choices left are converting an old view or making a new one.

Parameters:
position - The position to display
Returns:
A view displaying the data associated with the specified position

positionSelector

void positionSelector(View sel)

dispatchDraw

protected void dispatchDraw(Canvas canvas)
Description copied from class: ViewGroup
Called by draw to draw the child views. This may be overridden by derived classes to gain control just before its children are drawn (but after its own view has been drawn).

Overrides:
dispatchDraw in class ViewGroup
Parameters:
canvas - the canvas on which to draw the view

onSizeChanged

protected void onSizeChanged(int w,
                             int h,
                             int oldw,
                             int oldh)
Description copied from class: View
This is called during layout when the size of this view has changed. If you were just added to the view hierarchy, you're called with the old values of 0.

Overrides:
onSizeChanged in class View
Parameters:
w - Current width of this view.
h - Current height of this view.
oldw - Old width of this view.
oldh - Old height of this view.

touchModeDrawsInPressedState

boolean touchModeDrawsInPressedState()
Returns:
True if the current touch mode requires that we draw the selector in the pressed state.

shouldShowSelector

boolean shouldShowSelector()
Indicates whether this view is in a state where the selector should be drawn. This will happen if we have focus but are not in touch mode, or we are in the middle of displaying the pressed state for an item.

Returns:
True if the selector should be shown

setDrawSelectorOnTop

public void setDrawSelectorOnTop(boolean onTop)
Controls whether the selection highlight drawable should be drawn on top of the item or behind it.

Parameters:
onTop - If true, the selector will be drawn on the item it is highlighting. The default is false.

setSelector

public void setSelector(int resID)
Set a Drawable that should be used to highlight the currently selected item.

Parameters:
resID - A Drawable resource to use as the selection highlight.

setSelector

public void setSelector(Drawable sel)

getSelector

public Drawable getSelector()
Returns the selector Drawable that is used to draw the selection in the list.

Returns:
the drawable used to display the selector

keyPressed

void keyPressed()
Sets the selector state to "pressed" and posts a CheckForKeyLongPress to see if this is a long press.


setScrollIndicators

public void setScrollIndicators(View up,
                                View down)

drawableStateChanged

protected void drawableStateChanged()
Description copied from class: View
This function is called whenever the state of the view changes in such a way that it impacts the state of drawables being shown.

Be sure to call through to the superclass when overriding this function.

Overrides:
drawableStateChanged in class ViewGroup
See Also:
Drawable.setState(int[])

onCreateDrawableState

protected int[] onCreateDrawableState(int extraSpace)
Description copied from class: View
Generate the new 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().

Overrides:
onCreateDrawableState in class ViewGroup
Parameters:
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.
Returns:
Returns an array holding the current Drawable state of the view.
See Also:
View.mergeDrawableStates(int[], int[])

verifyDrawable

public boolean verifyDrawable(Drawable dr)
Description copied from class: View
If your view subclass is displaying its own Drawable objects, it should override this function and return true for any Drawable it is displaying. This allows animations for those drawables to be scheduled.

Be sure to call through to the super class when overriding this function.

Overrides:
verifyDrawable in class View
Parameters:
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.
Returns:
boolean If true than the Drawable is being displayed in the view; else false and it is not allowed to animate.
See Also:
View.unscheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable), View.drawableStateChanged()

onAttachedToWindow

protected void onAttachedToWindow()
Description copied from class: View
This is called when the view is attached to a window. At this point it has a Surface and will start drawing. Note that this function is guaranteed to be called before View.onDraw(android.graphics.Canvas), however it may be called any time before the first onDraw -- including before or after View.onMeasure(int, int).

Overrides:
onAttachedToWindow in class View
See Also:
View.onDetachedFromWindow()

onDetachedFromWindow

protected void onDetachedFromWindow()
Description copied from class: View
This is called when the view is detached from a window. At this point it no longer has a surface for drawing.

Overrides:
onDetachedFromWindow in class View
See Also:
View.onAttachedToWindow()

onWindowFocusChanged

public void onWindowFocusChanged(boolean hasWindowFocus)
Description copied from class: View
Called when the window containing this view gains or loses focus. Note that this is separate from view focus: to receive key events, both your view and its window must have focus. If a window is displayed on top of yours that takes input focus, then your own window will lose focus but the view focus will remain unchanged.

Overrides:
onWindowFocusChanged in class View
Parameters:
hasWindowFocus - True if the window containing this view now has focus, false otherwise.

createContextMenuInfo

ContextMenu.ContextMenuInfo createContextMenuInfo(View view,
                                                  int position,
                                                  long id)
Creates the ContextMenuInfo returned from getContextMenuInfo(). This methods knows the view, position and ID of the item that received the long press.

Parameters:
view - The view that received the long press.
position - The position of the item that received the long press.
id - The ID of the item that received the long press.
Returns:
The extra information that should be returned by getContextMenuInfo().

getContextMenuInfo

protected ContextMenu.ContextMenuInfo getContextMenuInfo()
Description copied from class: View
Views should implement this if they have extra information to associate with the context menu. The return result is supplied as a parameter to the OnCreateContextMenuListener#onCreateContextMenu(ContextMenu, View, ContextMenuInfo) callback.

Overrides:
getContextMenuInfo in class View
Returns:
Extra information about the item for which the context menu should be shown. This information will vary across different subclasses of View.

showContextMenuForChild

public boolean showContextMenuForChild(View originalView)
Description copied from class: ViewGroup
Bring up a context menu for the specified view or its ancestors.

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.

Specified by:
showContextMenuForChild in interface ViewParent
Overrides:
showContextMenuForChild in class ViewGroup
Parameters:
originalView - The source view where the context menu was first invoked
Returns:
true if a context menu was displayed

onKeyUp

public boolean onKeyUp(int keyCode,
                       KeyEvent event)
Description copied from class: View
Default implementation of KeyEvent.Callback.onKeyMultiple(): perform clicking of the view when KeyEvent.KEYCODE_DPAD_CENTER or KeyEvent.KEYCODE_ENTER is released.

Specified by:
onKeyUp in interface KeyEvent.Callback
Overrides:
onKeyUp in class View
Parameters:
keyCode - A key code that represents the button pressed, from KeyEvent.
event - The KeyEvent object that defines the button action.
Returns:
If you handled the event, return true. If you want to allow the event to be handled by the next receiver, return false.

dispatchSetPressed

protected void dispatchSetPressed(boolean pressed)
Description copied from class: View
Dispatch setPressed to all of this View's children.

Overrides:
dispatchSetPressed in class ViewGroup
Parameters:
pressed - The new pressed state
See Also:
View.setPressed(boolean)

pointToPosition

public int pointToPosition(int x,
                           int y)
Maps a point to a position in the list.

Parameters:
x - X in local coordinate
y - Y in local coordinate
Returns:
The position of the item which contains the specified point, or AdapterView.INVALID_POSITION if the point does not intersect an item.

pointToRowId

public long pointToRowId(int x,
                         int y)
Maps a point to a the rowId of the item which intersects that point.

Parameters:
x - X in local coordinate
y - Y in local coordinate
Returns:
The rowId of the item which contains the specified point, or AdapterView.INVALID_ROW_ID if the point does not intersect an item.

onTouchModeChanged

public void onTouchModeChanged(boolean isInTouchMode)
Description copied from interface: ViewTreeObserver.OnTouchModeChangeListener
Callback method to be invoked when the touch mode changes.

Specified by:
onTouchModeChanged in interface ViewTreeObserver.OnTouchModeChangeListener
Parameters:
isInTouchMode - True if the view hierarchy is now in touch mode, false otherwise.

onTouchEvent

public boolean onTouchEvent(MotionEvent ev)
Description copied from class: View
Implement this method to handle touch screen motion events.

Overrides:
onTouchEvent in class View
Parameters:
ev - The motion event.
Returns:
True if the event was handled, false otherwise.

onInterceptTouchEvent

public boolean onInterceptTouchEvent(MotionEvent ev)
Description copied from class: ViewGroup
Implement this method to intercept all touch screen motion events. This allows you to watch events as they are dispatched to your children, and take ownership of the current gesture at any point.

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:

  1. You will receive the down event here.
  2. The down event will be handled either by a child of this view group, or given to your own onTouchEvent() method to handle; this means you should implement onTouchEvent() to return true, so you will continue to see the rest of the gesture (instead of looking for a parent view to handle it). Also, by returning true from onTouchEvent(), you will not receive any following events in onInterceptTouchEvent() and all touch processing must happen in onTouchEvent() like normal.
  3. For as long as you return false from this function, each following event (up to and including the final up) will be delivered first here and then to the target's onTouchEvent().
  4. If you return true from here, you will not receive any following events: the target view will receive the same event but with the action MotionEvent.ACTION_CANCEL, and all further events will be delivered to your onTouchEvent() method and no longer appear here.

Overrides:
onInterceptTouchEvent in class ViewGroup
Parameters:
ev - The motion event being dispatched down the hierarchy.
Returns:
Return true to steal motion events from the children and have them dispatched to this ViewGroup through onTouchEvent(). The current target will receive an ACTION_CANCEL event, and no further messages will be delivered here.

addTouchables

public 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.

Overrides:
addTouchables in class ViewGroup
Parameters:
views - Touchable views found so far

trackMotionScroll

void trackMotionScroll(int deltaY,
                       int incrementalDeltaY)
Track a motion scroll

Parameters:
deltaY - Amount to offset mMotionView. This is the accumulated delta since the motion began. Positive numbers mean the user's finger is moving down the screen.
incrementalDeltaY - Change in deltaY from the previous event.

getHeaderViewsCount

int getHeaderViewsCount()
Returns the number of header views in the list. Header views are special views at the top of the list that should not be recycled during a layout.

Returns:
The number of header views, 0 in the default implementation.

getFooterViewsCount

int getFooterViewsCount()
Returns the number of footer views in the list. Footer views are special views at the bottom of the list that should not be recycled during a layout.

Returns:
The number of footer views, 0 in the default implementation.

fillGap

abstract void fillGap(boolean down)
Fills the gap left open by a touch-scroll. During a touch scroll, children that remain on screen are shifted and the other ones are discarded. The role of this method is to fill the gap thus created by performing a partial layout in the empty space.

Parameters:
down - true if the scroll is going down, false if it is going up

hideSelector

void hideSelector()

reconcileSelectedPosition

int reconcileSelectedPosition()
Returns:
A position to select. First we try mSelectedPosition. If that has been clobbered by entering touch mode, we then try mResurrectToPosition. Values are pinned to the range of items available in the adapter

findMotionRow

abstract int findMotionRow(int y)
Find the row closest to y. This row will be used as the motion row when scrolling

Parameters:
y - Where the user touched
Returns:
The position of the first (or only) item in the row closest to y

invalidateViews

public void invalidateViews()
Causes all the views to be rebuilt and redrawn.


setSelectionInt

abstract void setSelectionInt(int position)
Makes the item at the supplied position selected.

Parameters:
position - the position of the new selection

resurrectSelection

boolean resurrectSelection()
Attempt to bring the selection back if the user is switching from touch to trackball mode

Returns:
Whether selection was set to something.

handleDataChanged

protected void handleDataChanged()
Overrides:
handleDataChanged in class AdapterView<ListAdapter>

dismissPopup

void dismissPopup()
Removes the filter window


getDistance

static int getDistance(Rect source,
                       Rect dest,
                       int direction)
What is the distance between the source and destination rectangles given the direction of focus navigation between them? The direction basically helps figure out more quickly what is self evident by the relationship between the rects...

Parameters:
source - the source rectangle
dest - the destination rectangle
direction - the direction
Returns:
the distance between the rectangles

isInFilterMode

protected boolean isInFilterMode()
Description copied from class: AdapterView
Indicates whether this view is in filter mode. Filter mode can for instance be enabled by a user when typing on the keyboard.

Overrides:
isInFilterMode in class AdapterView<ListAdapter>
Returns:
True if the view is in filter mode, false otherwise.

sendToTextFilter

boolean sendToTextFilter(int keyCode,
                         int count,
                         KeyEvent event)
Sends a key to the text filter window

Parameters:
keyCode - The keycode for the event
event - The actual key event
Returns:
True if the text filter handled the event, false otherwise.

clearTextFilter

public void clearTextFilter()
Clear the text filter.


hasTextFilter

public boolean hasTextFilter()
Returns if the ListView currently has a text filter.


onGlobalLayout

public void onGlobalLayout()
Description copied from interface: ViewTreeObserver.OnGlobalLayoutListener
Callback method to be invoked when the global layout state or the visibility of views within the view tree changes

Specified by:
onGlobalLayout in interface ViewTreeObserver.OnGlobalLayoutListener

beforeTextChanged

public void beforeTextChanged(CharSequence s,
                              int start,
                              int count,
                              int after)
For our text watcher that associated with the text filter

Specified by:
beforeTextChanged in interface TextWatcher

onTextChanged

public void onTextChanged(CharSequence s,
                          int start,
                          int before,
                          int count)
For our text watcher that associated with the text filter. Performs the actual filtering as the text changes.

Specified by:
onTextChanged in interface TextWatcher

afterTextChanged

public void afterTextChanged(Editable s)
For our text watcher that associated with the text filter

Specified by:
afterTextChanged in interface TextWatcher

onFilterComplete

public void onFilterComplete(int count)
Description copied from interface: Filter.FilterListener

Notifies the end of a filtering operation.

Specified by:
onFilterComplete in interface Filter.FilterListener
Parameters:
count - the number of values computed by the filter

generateLayoutParams

protected ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams p)
Description copied from class: ViewGroup
Returns a safe set of layout parameters based on the supplied layout params. When a ViewGroup is passed a View whose layout params do not pass the test of 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.

Overrides:
generateLayoutParams in class ViewGroup
Parameters:
p - The layout parameters to convert into a suitable set of layout parameters for this ViewGroup.
Returns:
an instance of ViewGroup.LayoutParams or one of its descendants

generateLayoutParams

public AbsListView.LayoutParams generateLayoutParams(AttributeSet attrs)
Description copied from class: ViewGroup
Returns a new set of layout parameters based on the supplied attributes set.

Overrides:
generateLayoutParams in class ViewGroup
Parameters:
attrs - the attributes to build the layout parameters from
Returns:
an instance of ViewGroup.LayoutParams or one of its descendants

checkLayoutParams

protected boolean checkLayoutParams(ViewGroup.LayoutParams p)
Description copied from class: ViewGroup

Overrides:
checkLayoutParams in class ViewGroup

setTranscriptMode

public void setTranscriptMode(int mode)
Puts the list or grid into transcript mode. In this mode the list or grid will always scroll to the bottom to show new items.

Parameters:
mode - the transcript mode to set
See Also:
TRANSCRIPT_MODE_DISABLED, TRANSCRIPT_MODE_NORMAL, TRANSCRIPT_MODE_ALWAYS_SCROLL

getTranscriptMode

public int getTranscriptMode()
Returns the current transcript mode.

Returns:
TRANSCRIPT_MODE_DISABLED, TRANSCRIPT_MODE_NORMAL or TRANSCRIPT_MODE_ALWAYS_SCROLL

getSolidColor

public int getSolidColor()
Description copied from class: View
Override this if your view is known to always be drawn on top of a solid color background, and needs to draw fading edges. Returning a non-zero color enables the view system to optimize the drawing of the fading edges. If you do return a non-zero color, the alpha should be set to 0xFF.

Overrides:
getSolidColor in class View
Returns:
The known solid color background for this view, or 0 if the color may vary
See Also:
View.setVerticalFadingEdgeEnabled(boolean), View.setHorizontalFadingEdgeEnabled(boolean)

setCacheColorHint

public 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

Parameters:
color - The background color

getCacheColorHint

public 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

Returns:
The cache color hint

reclaimViews

public void reclaimViews(List<View> views)
Move all views (excluding headers and footers) held by this AbsListView into the supplied List. This includes views displayed on the screen as well as views stored in AbsListView's internal view recycler.

Parameters:
views - A list into which to put the reclaimed views

setRecyclerListener

public void setRecyclerListener(AbsListView.RecyclerListener listener)
Sets the recycler listener to be notified whenever a View is set aside in the recycler for later reuse. This listener can be used to free resources associated to the View.

Parameters:
listener - The recycler listener to be notified of views set aside in the recycler.
See Also:
AbsListView.RecycleBin, AbsListView.RecyclerListener

Build 1.0_r1(from source)

Please submit a feedback, bug or feature