com.actionbarsherlock.internal.widget
Class IcsAdapterView<T extends android.widget.Adapter>

java.lang.Object
  extended by android.view.View
      extended by android.view.ViewGroup
          extended by com.actionbarsherlock.internal.widget.IcsAdapterView<T>
All Implemented Interfaces:
android.graphics.drawable.Drawable.Callback, android.view.accessibility.AccessibilityEventSource, android.view.KeyEvent.Callback, android.view.ViewManager, android.view.ViewParent
Direct Known Subclasses:
IcsAbsSpinner

public abstract class IcsAdapterView<T extends android.widget.Adapter>
extends android.view.ViewGroup

An AdapterView is a view whose children are determined by an Adapter.

See ListView, GridView, Spinner and Gallery for commonly used subclasses of AdapterView.

Developer Guides

For more information about using AdapterView, read the Binding to Data with AdapterView developer guide.


Nested Class Summary
static class IcsAdapterView.AdapterContextMenuInfo
          Extra menu information provided to the android.view.View.OnCreateContextMenuListener#onCreateContextMenu(ContextMenu, View, ContextMenuInfo) callback when a context menu is brought up for this AdapterView.
static interface IcsAdapterView.OnItemLongClickListener
          Interface definition for a callback to be invoked when an item in this view has been clicked and held.
static interface IcsAdapterView.OnItemSelectedListener
          Interface definition for a callback to be invoked when an item in this view has been selected.
 
Nested classes/interfaces inherited from class android.view.ViewGroup
android.view.ViewGroup.LayoutParams, android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListener
 
Nested classes/interfaces inherited from class android.view.View
android.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnAttachStateChangeListener, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener
 
Field Summary
static int INVALID_POSITION
          Represents an invalid position.
static long INVALID_ROW_ID
          Represents an empty or invalid row id
static int ITEM_VIEW_TYPE_HEADER_OR_FOOTER
          The item view type returned by Adapter.getItemViewType(int) when the item is a header or footer.
static int ITEM_VIEW_TYPE_IGNORE
          The item view type returned by Adapter.getItemViewType(int) when the adapter does not want the item's view recycled.
 
Fields inherited from class android.view.ViewGroup
CLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE
 
Fields inherited from class android.view.View
ALPHA, 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_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, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, 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_WINDOW_FOCUSED_STATE_SET, 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_HIDDEN, STATUS_BAR_VISIBLE, 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_INHERIT, TEXT_ALIGNMENT_RESOLVED_DEFAULT, TRANSLATION_X, TRANSLATION_Y, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y
 
Constructor Summary
IcsAdapterView(android.content.Context context)
           
IcsAdapterView(android.content.Context context, android.util.AttributeSet attrs)
           
IcsAdapterView(android.content.Context context, android.util.AttributeSet attrs, int defStyle)
           
 
Method Summary
 void addView(android.view.View child)
          This method is not supported and throws an UnsupportedOperationException when called.
 void addView(android.view.View child, int index)
          This method is not supported and throws an UnsupportedOperationException when called.
 void addView(android.view.View child, int index, android.view.ViewGroup.LayoutParams params)
          This method is not supported and throws an UnsupportedOperationException when called.
 void addView(android.view.View child, android.view.ViewGroup.LayoutParams params)
          This method is not supported and throws an UnsupportedOperationException when called.
protected  boolean canAnimate()
           
 boolean dispatchPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent event)
           
protected  void dispatchRestoreInstanceState(android.util.SparseArray<android.os.Parcelable> container)
          Override to prevent thawing of any views created by the adapter.
protected  void dispatchSaveInstanceState(android.util.SparseArray<android.os.Parcelable> container)
          Override to prevent freezing of any views created by the adapter.
abstract  T getAdapter()
          Returns the adapter currently associated with this widget.
 int getCount()
           
 android.view.View getEmptyView()
          When the current adapter is empty, the AdapterView can display a special view call the empty view.
 int getFirstVisiblePosition()
          Returns the position within the adapter's data set for the first item displayed on screen.
 Object getItemAtPosition(int position)
          Gets the data associated with the specified position in the list.
 long getItemIdAtPosition(int position)
           
 int getLastVisiblePosition()
          Returns the position within the adapter's data set for the last item displayed on screen.
 android.widget.AdapterView.OnItemClickListener getOnItemClickListener()
           
 IcsAdapterView.OnItemLongClickListener getOnItemLongClickListener()
           
 IcsAdapterView.OnItemSelectedListener getOnItemSelectedListener()
           
 int getPositionForView(android.view.View view)
          Get the position within the adapter's data set for the view, where view is a an adapter item or a descendant of an adapter item.
 Object getSelectedItem()
           
 long getSelectedItemId()
           
 int getSelectedItemPosition()
          Return the position of the currently selected item within the adapter's data set
abstract  android.view.View getSelectedView()
           
protected  void onDetachedFromWindow()
           
 void onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent event)
           
 void onInitializeAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo info)
           
protected  void onLayout(boolean changed, int left, int top, int right, int bottom)
           
 boolean onRequestSendAccessibilityEvent(android.view.View child, android.view.accessibility.AccessibilityEvent event)
           
 boolean performItemClick(android.view.View view, int position, long id)
          Call the OnItemClickListener, if it is defined.
 void removeAllViews()
          This method is not supported and throws an UnsupportedOperationException when called.
 void removeView(android.view.View child)
          This method is not supported and throws an UnsupportedOperationException when called.
 void removeViewAt(int index)
          This method is not supported and throws an UnsupportedOperationException when called.
abstract  void setAdapter(T adapter)
          Sets the adapter that provides the data and the views to represent the data in this widget.
 void setEmptyView(android.view.View emptyView)
          Sets the view to show if the adapter is empty
 void setFocusable(boolean focusable)
           
 void setFocusableInTouchMode(boolean focusable)
           
 void setOnClickListener(android.view.View.OnClickListener l)
           
 void setOnItemClickListener(android.widget.AdapterView.OnItemClickListener listener)
          Register a callback to be invoked when an item in this AdapterView has been clicked.
 void setOnItemLongClickListener(IcsAdapterView.OnItemLongClickListener listener)
          Register a callback to be invoked when an item in this AdapterView has been clicked and held
 void setOnItemSelectedListener(IcsAdapterView.OnItemSelectedListener listener)
          Register a callback to be invoked when an item in this AdapterView has been selected.
abstract  void setSelection(int position)
          Sets the currently selected item.
 
Methods inherited from class android.view.ViewGroup
addChildrenForAccessibility, addFocusables, addStatesFromChildren, addTouchables, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, checkLayoutParams, childDrawableStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawableStateChanged, drawChild, endViewTransition, findFocus, findViewsWithText, fitSystemWindows, focusableViewAvailable, focusSearch, gatherTransparentRegion, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutTransition, getPersistentDrawingCache, hasFocus, hasFocusable, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isMotionEventSplittingEnabled, jumpDrawablesToCurrentState, layout, measureChild, measureChildren, measureChildWithMargins, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAnimationEnd, onAnimationStart, onCreateDrawableState, onInterceptHoverEvent, onInterceptTouchEvent, onRequestFocusInDescendants, recomputeViewAttributes, removeAllViewsInLayout, removeDetachedView, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPadding, setPersistentDrawingCache, setStaticTransformationsEnabled, shouldDelayChildPressedState, showContextMenuForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayout
 
Methods inherited from class android.view.View
addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, draw, findViewById, findViewWithTag, focusSearch, forceLayout, getAccessibilityNodeProvider, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getKeepScreenOn, getKeyDispatcherState, getLayerType, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOverScrollMode, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getResources, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTranslationX, getTranslationY, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, hasOnClickListeners, hasOverlappingRendering, hasTransientState, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, invalidateDrawable, isActivated, isClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isInEditMode, isInTouchMode, isLayoutRequested, isLongClickable, isOpaque, isPaddingOffsetRequired, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAttachedToWindow, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDraw, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onMeasure, onOverScrolled, onPopulateAccessibilityEvent, onRestoreInstanceState, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBottom, setCameraDistance, setClickable, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setKeepScreenOn, setLayerType, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOverScrollMode, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setSystemUiVisibility, setTag, setTag, setTop, setTouchDelegate, setTranslationX, setTranslationY, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, showContextMenu, startActionMode, startAnimation, startDrag, unscheduleDrawable, unscheduleDrawable, verifyDrawable, willNotCacheDrawing, willNotDraw
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface android.view.ViewParent
createContextMenu, getParent, getParentForAccessibility, isLayoutRequested, requestFitSystemWindows, requestLayout
 

Field Detail

ITEM_VIEW_TYPE_IGNORE

public static final int ITEM_VIEW_TYPE_IGNORE
The item view type returned by Adapter.getItemViewType(int) when the adapter does not want the item's view recycled.

See Also:
Constant Field Values

ITEM_VIEW_TYPE_HEADER_OR_FOOTER

public static final int ITEM_VIEW_TYPE_HEADER_OR_FOOTER
The item view type returned by Adapter.getItemViewType(int) when the item is a header or footer.

See Also:
Constant Field Values

INVALID_POSITION

public static final int INVALID_POSITION
Represents an invalid position. All valid positions are in the range 0 to 1 less than the number of items in the current adapter.

See Also:
Constant Field Values

INVALID_ROW_ID

public static final long INVALID_ROW_ID
Represents an empty or invalid row id

See Also:
Constant Field Values
Constructor Detail

IcsAdapterView

public IcsAdapterView(android.content.Context context)

IcsAdapterView

public IcsAdapterView(android.content.Context context,
                      android.util.AttributeSet attrs)

IcsAdapterView

public IcsAdapterView(android.content.Context context,
                      android.util.AttributeSet attrs,
                      int defStyle)
Method Detail

setOnItemClickListener

public void setOnItemClickListener(android.widget.AdapterView.OnItemClickListener listener)
Register a callback to be invoked when an item in this AdapterView has been clicked.

Parameters:
listener - The callback that will be invoked.

getOnItemClickListener

public final android.widget.AdapterView.OnItemClickListener getOnItemClickListener()
Returns:
The callback to be invoked with an item in this AdapterView has been clicked, or null id no callback has been set.

performItemClick

public boolean performItemClick(android.view.View view,
                                int position,
                                long id)
Call the OnItemClickListener, if it is defined.

Parameters:
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.
Returns:
True if there was an assigned OnItemClickListener that was called, false otherwise is returned.

setOnItemLongClickListener

public void setOnItemLongClickListener(IcsAdapterView.OnItemLongClickListener listener)
Register a callback to be invoked when an item in this AdapterView has been clicked and held

Parameters:
listener - The callback that will run

getOnItemLongClickListener

public final IcsAdapterView.OnItemLongClickListener getOnItemLongClickListener()
Returns:
The callback to be invoked with an item in this AdapterView has been clicked and held, or null id no callback as been set.

setOnItemSelectedListener

public void setOnItemSelectedListener(IcsAdapterView.OnItemSelectedListener listener)
Register a callback to be invoked when an item in this AdapterView has been selected.

Parameters:
listener - The callback that will run

getOnItemSelectedListener

public final IcsAdapterView.OnItemSelectedListener getOnItemSelectedListener()

getAdapter

public abstract T getAdapter()
Returns the adapter currently associated with this widget.

Returns:
The adapter used to provide this view's content.

setAdapter

public abstract void setAdapter(T adapter)
Sets the adapter that provides the data and the views to represent the data in this widget.

Parameters:
adapter - The adapter to use to create this view's content.

addView

public void addView(android.view.View child)
This method is not supported and throws an UnsupportedOperationException when called.

Overrides:
addView in class android.view.ViewGroup
Parameters:
child - Ignored.
Throws:
UnsupportedOperationException - Every time this method is invoked.

addView

public void addView(android.view.View child,
                    int index)
This method is not supported and throws an UnsupportedOperationException when called.

Overrides:
addView in class android.view.ViewGroup
Parameters:
child - Ignored.
index - Ignored.
Throws:
UnsupportedOperationException - Every time this method is invoked.

addView

public void addView(android.view.View child,
                    android.view.ViewGroup.LayoutParams params)
This method is not supported and throws an UnsupportedOperationException when called.

Specified by:
addView in interface android.view.ViewManager
Overrides:
addView in class android.view.ViewGroup
Parameters:
child - Ignored.
params - Ignored.
Throws:
UnsupportedOperationException - Every time this method is invoked.

addView

public void addView(android.view.View child,
                    int index,
                    android.view.ViewGroup.LayoutParams params)
This method is not supported and throws an UnsupportedOperationException when called.

Overrides:
addView in class android.view.ViewGroup
Parameters:
child - Ignored.
index - Ignored.
params - Ignored.
Throws:
UnsupportedOperationException - Every time this method is invoked.

removeView

public void removeView(android.view.View child)
This method is not supported and throws an UnsupportedOperationException when called.

Specified by:
removeView in interface android.view.ViewManager
Overrides:
removeView in class android.view.ViewGroup
Parameters:
child - Ignored.
Throws:
UnsupportedOperationException - Every time this method is invoked.

removeViewAt

public void removeViewAt(int index)
This method is not supported and throws an UnsupportedOperationException when called.

Overrides:
removeViewAt in class android.view.ViewGroup
Parameters:
index - Ignored.
Throws:
UnsupportedOperationException - Every time this method is invoked.

removeAllViews

public void removeAllViews()
This method is not supported and throws an UnsupportedOperationException when called.

Overrides:
removeAllViews in class android.view.ViewGroup
Throws:
UnsupportedOperationException - Every time this method is invoked.

onLayout

protected void onLayout(boolean changed,
                        int left,
                        int top,
                        int right,
                        int bottom)
Specified by:
onLayout in class android.view.ViewGroup

getSelectedItemPosition

public int getSelectedItemPosition()
Return the position of the currently selected item within the adapter's data set

Returns:
int Position (starting at 0), or INVALID_POSITION if there is nothing selected.

getSelectedItemId

public long getSelectedItemId()
Returns:
The id corresponding to the currently selected item, or INVALID_ROW_ID if nothing is selected.

getSelectedView

public abstract android.view.View getSelectedView()
Returns:
The view corresponding to the currently selected item, or null if nothing is selected

getSelectedItem

public Object getSelectedItem()
Returns:
The data corresponding to the currently selected item, or null if there is nothing selected.

getCount

public int getCount()
Returns:
The number of items owned by the Adapter associated with this AdapterView. (This is the number of data items, which may be larger than the number of visible views.)

getPositionForView

public int getPositionForView(android.view.View view)
Get the position within the adapter's data set for the view, where view is a an adapter item or a descendant of an adapter item.

Parameters:
view - an adapter item, or a descendant of an adapter item. This must be visible in this AdapterView at the time of the call.
Returns:
the position within the adapter's data set of the view, or INVALID_POSITION if the view does not correspond to a list item (or it is not currently visible).

getFirstVisiblePosition

public int getFirstVisiblePosition()
Returns the position within the adapter's data set for the first item displayed on screen.

Returns:
The position within the adapter's data set

getLastVisiblePosition

public int getLastVisiblePosition()
Returns the position within the adapter's data set for the last item displayed on screen.

Returns:
The position within the adapter's data set

setSelection

public abstract void setSelection(int position)
Sets the currently selected item. To support accessibility subclasses that override this method must invoke the overriden super method first.

Parameters:
position - Index (starting at 0) of the data item to be selected.

setEmptyView

public void setEmptyView(android.view.View emptyView)
Sets the view to show if the adapter is empty


getEmptyView

public android.view.View getEmptyView()
When the current adapter is empty, the AdapterView can display a special view call the empty view. The empty view is used to provide feedback to the user that no data is available in this AdapterView.

Returns:
The view to show if the adapter is empty.

setFocusable

public void setFocusable(boolean focusable)
Overrides:
setFocusable in class android.view.View

setFocusableInTouchMode

public void setFocusableInTouchMode(boolean focusable)
Overrides:
setFocusableInTouchMode in class android.view.View

getItemAtPosition

public Object getItemAtPosition(int position)
Gets the data associated with the specified position in the list.

Parameters:
position - Which data to get
Returns:
The data associated with the specified position in the list

getItemIdAtPosition

public long getItemIdAtPosition(int position)

setOnClickListener

public void setOnClickListener(android.view.View.OnClickListener l)
Overrides:
setOnClickListener in class android.view.View

dispatchSaveInstanceState

protected void dispatchSaveInstanceState(android.util.SparseArray<android.os.Parcelable> container)
Override to prevent freezing of any views created by the adapter.

Overrides:
dispatchSaveInstanceState in class android.view.ViewGroup

dispatchRestoreInstanceState

protected void dispatchRestoreInstanceState(android.util.SparseArray<android.os.Parcelable> container)
Override to prevent thawing of any views created by the adapter.

Overrides:
dispatchRestoreInstanceState in class android.view.ViewGroup

onDetachedFromWindow

protected void onDetachedFromWindow()
Overrides:
onDetachedFromWindow in class android.view.View

dispatchPopulateAccessibilityEvent

public boolean dispatchPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent event)
Overrides:
dispatchPopulateAccessibilityEvent in class android.view.View

onRequestSendAccessibilityEvent

public boolean onRequestSendAccessibilityEvent(android.view.View child,
                                               android.view.accessibility.AccessibilityEvent event)
Overrides:
onRequestSendAccessibilityEvent in class android.view.ViewGroup

onInitializeAccessibilityNodeInfo

public void onInitializeAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo info)
Overrides:
onInitializeAccessibilityNodeInfo in class android.view.View

onInitializeAccessibilityEvent

public void onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent event)
Overrides:
onInitializeAccessibilityEvent in class android.view.View

canAnimate

protected boolean canAnimate()
Overrides:
canAnimate in class android.view.ViewGroup


Copyright © 2012-2013. All Rights Reserved.