Build 1.0_r1(from source)

android.widget
Class Spinner

java.lang.Object
  extended by android.view.View
      extended by android.view.ViewGroup
          extended by android.widget.AdapterView<SpinnerAdapter>
              extended by android.widget.AbsSpinner
                  extended by android.widget.Spinner
All Implemented Interfaces:
DialogInterface.OnClickListener, Drawable.Callback, KeyEvent.Callback, ViewManager, ViewParent

public class Spinner
extends AbsSpinner
implements DialogInterface.OnClickListener

A view that displays one child at a time and lets the user pick among them. The items in the Spinner come from the Adapter associated with this view.


Nested Class Summary
 
Nested classes/interfaces inherited from class android.widget.AbsSpinner
AbsSpinner.RecycleBin, AbsSpinner.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.LayoutParams, 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
 
Fields inherited from class android.widget.AbsSpinner
mAdapter, mBlockLayoutRequests, mHeightMeasureSpec, mInterpolator, mRecycler, mSelectedView, mSelectionBottomPadding, mSelectionLeftPadding, mSelectionRightPadding, mSelectionTopPadding, mSpinnerPadding, mWidthMeasureSpec
 
Fields inherited from class android.widget.AdapterView
INVALID_POSITION, INVALID_ROW_ID, ITEM_VIEW_TYPE_HEADER_OR_FOOTER, ITEM_VIEW_TYPE_IGNORE, 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
Spinner(Context context)
           
Spinner(Context context, AttributeSet attrs)
           
Spinner(Context context, AttributeSet attrs, int defStyle)
           
 
Method Summary
 int getBaseline()
          Return the offset of the widget's text baseline from the widget's top boundary.
 CharSequence getPrompt()
           
(package private)  void layout(int delta, boolean animate)
          Creates and positions all views for this Spinner.
 void onClick(DialogInterface dialog, int which)
          This method will be invoked when a button in the dialog is clicked.
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.
 boolean performClick()
          Call this view's OnClickListener, if it is defined.
 void setOnItemClickListener(AdapterView.OnItemClickListener l)
          A spinner does not support item click events.
 void setPrompt(CharSequence prompt)
          Sets the prompt to display when the dialog is shown.
 void setPromptId(int promptId)
          Sets the prompt to display when the dialog is shown.
 
Methods inherited from class android.widget.AbsSpinner
generateDefaultLayoutParams, getAdapter, getChildHeight, getChildWidth, getCount, getSelectedView, handleDataChanged, onMeasure, onRestoreInstanceState, onSaveInstanceState, pointToPosition, recycleAllViews, requestLayout, resetList, setAdapter, setSelection, setSelection, setSelectionInt
 
Methods inherited from class android.widget.AdapterView
addView, addView, addView, addView, canAnimate, checkFocus, checkSelectionChanged, dispatchRestoreInstanceState, dispatchSaveInstanceState, findSyncPosition, getEmptyView, getFirstVisiblePosition, getItemAtPosition, getItemIdAtPosition, getLastVisiblePosition, getOnItemClickListener, getOnItemLongClickListener, getOnItemSelectedListener, getPositionForView, getSelectedItem, getSelectedItemId, getSelectedItemPosition, isInFilterMode, lookForSelectablePosition, performItemClick, rememberSyncState, removeAllViews, removeView, removeViewAt, selectionChanged, setEmptyView, setFocusable, setFocusableInTouchMode, setNextSelectedPositionInt, setOnClickListener, setOnItemLongClickListener, setOnItemSelectedListener, setSelectedPositionInt
 
Methods inherited from class android.view.ViewGroup
addFocusables, addStatesFromChildren, addTouchables, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, checkLayoutParams, childDrawableStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchDraw, dispatchFreezeSelfOnly, dispatchKeyEvent, dispatchSetPressed, dispatchSetSelected, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowVisibilityChanged, drawableStateChanged, drawChild, findFocus, findViewTraversal, findViewWithTagTraversal, fitSystemWindows, focusableViewAvailable, focusSearch, gatherTransparentRegion, generateLayoutParams, generateLayoutParams, 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, onCreateDrawableState, onInterceptTouchEvent, 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, showContextMenuForChild, startLayoutAnimation, updateViewLayout
 
Methods inherited from class android.view.View
applyDrawableToTransparentRegion, bringToFront, buildDrawingCache, cancelLongPress, clearAnimation, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createContextMenu, debug, debugIndent, destroyDrawingCache, dispatchKeyShortcutEvent, draw, finalize, findViewById, findViewWithTag, focusSearch, forceLayout, getAnimation, getApplicationWindowToken, getBackground, getBottom, getBottomFadingEdgeStrength, getContext, getContextMenuInfo, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFocusables, getFocusedRect, 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, getSolidColor, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getTag, getTop, getTopFadingEdgeStrength, 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, onAttachedToWindow, onCreateContextMenu, onDetachedFromWindow, onDraw, onFinishInflate, onFocusChanged, onKeyDown, onKeyMultiple, onKeyShortcut, onKeyUp, onScrollChanged, onSetAlpha, onSizeChanged, onTouchEvent, onTrackballEvent, onWindowFocusChanged, onWindowVisibilityChanged, 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, verifyDrawable, 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
 

Constructor Detail

Spinner

public Spinner(Context context)

Spinner

public Spinner(Context context,
               AttributeSet attrs)

Spinner

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

getBaseline

public int getBaseline()
Description copied from class: View

Return the offset of the widget's text baseline from the widget's top boundary. If this widget does not support baseline alignment, this method returns -1.

Overrides:
getBaseline in class View
Returns:
the offset of the baseline within the widget's bounds or -1 if baseline alignment is not supported

setOnItemClickListener

public void setOnItemClickListener(AdapterView.OnItemClickListener l)

A spinner does not support item click events. Calling this method will raise an exception.

Overrides:
setOnItemClickListener in class AdapterView<SpinnerAdapter>
Parameters:
l - this listener will be ignored

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<SpinnerAdapter>
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
See Also:
Creates and positions all views

layout

void layout(int delta,
            boolean animate)
Creates and positions all views for this Spinner.

Specified by:
layout in class AbsSpinner
Parameters:
delta - Change in the selected position. +1 moves selection is moving to the right, so views are scrolling to the left. -1 means selection is moving to the left.

performClick

public boolean performClick()
Description copied from class: View
Call this view's OnClickListener, if it is defined.

Overrides:
performClick in class View
Returns:
True there was an assigned OnClickListener that was called, false otherwise is returned.

onClick

public void onClick(DialogInterface dialog,
                    int which)
Description copied from interface: DialogInterface.OnClickListener
This method will be invoked when a button in the dialog is clicked.

Specified by:
onClick in interface DialogInterface.OnClickListener
Parameters:
dialog - The dialog that received the click.
which - The button that was clicked, i.e. BUTTON1 or BUTTON2 or the position of the item clicked.

setPrompt

public void setPrompt(CharSequence prompt)
Sets the prompt to display when the dialog is shown.

Parameters:
prompt - the prompt to set

setPromptId

public void setPromptId(int promptId)
Sets the prompt to display when the dialog is shown.

Parameters:
promptId - the resource ID of the prompt to display when the dialog is shown

getPrompt

public CharSequence getPrompt()
Returns:
The prompt to display when the dialog is shown

Build 1.0_r1(from source)

Please submit a feedback, bug or feature