|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.view.View
android.view.ViewGroup
android.widget.AdapterView<SpinnerAdapter>
android.widget.AbsSpinner
public abstract class AbsSpinner
An abstract base class for spinner widgets. SDK users will probably not need to use this class.
| Nested Class Summary | |
|---|---|
(package private) class |
AbsSpinner.RecycleBin
|
(package private) static class |
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 | |
|---|---|
(package private) SpinnerAdapter |
mAdapter
|
(package private) boolean |
mBlockLayoutRequests
|
(package private) int |
mHeightMeasureSpec
|
(package private) Interpolator |
mInterpolator
|
(package private) AbsSpinner.RecycleBin |
mRecycler
|
(package private) View |
mSelectedView
|
(package private) int |
mSelectionBottomPadding
|
(package private) int |
mSelectionLeftPadding
|
(package private) int |
mSelectionRightPadding
|
(package private) int |
mSelectionTopPadding
|
(package private) Rect |
mSpinnerPadding
|
(package private) int |
mWidthMeasureSpec
|
| Constructor Summary | |
|---|---|
AbsSpinner(Context context)
|
|
AbsSpinner(Context context,
AttributeSet attrs)
|
|
AbsSpinner(Context context,
AttributeSet attrs,
int defStyle)
|
|
| Method Summary | |
|---|---|
protected ViewGroup.LayoutParams |
generateDefaultLayoutParams()
Returns a set of default layout parameters. |
SpinnerAdapter |
getAdapter()
Returns the adapter currently associated with this widget. |
(package private) int |
getChildHeight(View child)
|
(package private) int |
getChildWidth(View child)
|
int |
getCount()
|
View |
getSelectedView()
|
(package private) void |
handleDataChanged()
|
(package private) abstract void |
layout(int delta,
boolean animate)
|
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. |
int |
pointToPosition(int x,
int y)
Maps a point to a position in the list. |
(package private) void |
recycleAllViews()
|
void |
requestLayout()
Override to prevent spamming ourselves with layout requests as we place views |
(package private) void |
resetList()
Clear out all children from the list |
void |
setAdapter(SpinnerAdapter adapter)
The Adapter is used to provide the data which backs this Spinner. |
void |
setSelection(int position)
Sets the currently selected item |
void |
setSelection(int position,
boolean animate)
Jump directly to a specific item in the adapter data. |
(package private) void |
setSelectionInt(int position,
boolean animate)
Makes the item at the supplied position selected. |
| 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 |
|---|
SpinnerAdapter mAdapter
int mHeightMeasureSpec
int mWidthMeasureSpec
boolean mBlockLayoutRequests
int mSelectionLeftPadding
int mSelectionTopPadding
int mSelectionRightPadding
int mSelectionBottomPadding
Rect mSpinnerPadding
View mSelectedView
Interpolator mInterpolator
AbsSpinner.RecycleBin mRecycler
| Constructor Detail |
|---|
public AbsSpinner(Context context)
public AbsSpinner(Context context,
AttributeSet attrs)
public AbsSpinner(Context context,
AttributeSet attrs,
int defStyle)
| Method Detail |
|---|
public void setAdapter(SpinnerAdapter adapter)
setAdapter in class AdapterView<SpinnerAdapter>adapter - The SpinnerAdapter to use for this Spinnervoid resetList()
protected void onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
View
Measure the view and its content to determine the measured width and the
measured height. This method is invoked by View.measure(int, int) and
should be overriden by subclasses to provide accurate and efficient
measurement of their contents.
CONTRACT: When overriding this method, you
must call View.setMeasuredDimension(int, int) to store the
measured width and height of this view. Failure to do so will trigger an
IllegalStateException, thrown by
View.measure(int, int). Calling the superclass'
View.onMeasure(int, int) is a valid use.
The base class implementation of measure defaults to the background size,
unless a larger size is allowed by the MeasureSpec. Subclasses should
override View.onMeasure(int, int) to provide better measurements of
their content.
If this method is overridden, it is the subclass's responsibility to make
sure the measured height and width are at least the view's minimum height
and width (View.getSuggestedMinimumHeight() and
View.getSuggestedMinimumWidth()).
onMeasure in class ViewwidthMeasureSpec - 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.Figure out the dimensions of this Spinner. The width comes from
the widthMeasureSpec as Spinnners can't have their width set to
UNSPECIFIED. The height is based on the height of the selected item
plus padding.int getChildHeight(View child)
int getChildWidth(View child)
protected ViewGroup.LayoutParams generateDefaultLayoutParams()
ViewGroupViewGroup.addView(View) has no layout parameters
already set. If null is returned, an exception is thrown from addView.
generateDefaultLayoutParams in class ViewGroupvoid recycleAllViews()
void handleDataChanged()
handleDataChanged in class AdapterView<SpinnerAdapter>
public void setSelection(int position,
boolean animate)
public void setSelection(int position)
AdapterView
setSelection in class AdapterView<SpinnerAdapter>position - Index (starting at 0) of the data item to be selected.
void setSelectionInt(int position,
boolean animate)
position - Position to selectanimate - Should the transition be animated
abstract void layout(int delta,
boolean animate)
public View getSelectedView()
getSelectedView in class AdapterView<SpinnerAdapter>public void requestLayout()
requestLayout in interface ViewParentrequestLayout in class ViewView.requestLayout()public SpinnerAdapter getAdapter()
AdapterView
getAdapter in class AdapterView<SpinnerAdapter>public int getCount()
getCount in class AdapterView<SpinnerAdapter>
public int pointToPosition(int x,
int y)
x - X in local coordinatey - Y in local coordinate
AdapterView.INVALID_POSITION if the point does not intersect an item.public Parcelable onSaveInstanceState()
ViewSome examples of things you may store here: the current cursor position in a text view (but usually not the text itself since that is stored in a content provider or other persistent storage), the currently selected item in a list view.
onSaveInstanceState in class ViewView.onRestoreInstanceState(android.os.Parcelable),
View.saveHierarchyState(android.util.SparseArray) ,
View.dispatchSaveInstanceState(android.util.SparseArray) ,
View.setSaveEnabled(boolean)public void onRestoreInstanceState(Parcelable state)
ViewView.onSaveInstanceState(). This function will never be called with a
null state.
onRestoreInstanceState in class Viewstate - The frozen state that had previously been returned by
View.onSaveInstanceState().View.onSaveInstanceState(),
View.restoreHierarchyState(android.util.SparseArray) ,
View.dispatchRestoreInstanceState(android.util.SparseArray)
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||