|
||||||||||
| 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.LinearLayout
net.simonvt.numberpicker.NumberPicker
public class NumberPicker
A widget that enables the user to select a number form a predefined range. There are two flavors of this widget and which one is presented to the user depends on the current theme.
R.style.Theme the widget
presents the current value as an editable input field with an increment button
above and a decrement button below. Long pressing the buttons allows for a quick
change of the current value. Tapping on the input field allows to type in
a desired value.
R.style.Theme_Holo or
R.style.Theme_Holo_Light the widget presents the current
value as an editable input field with a lesser value above and a greater
value below. Tapping on the lesser or greater value selects it by animating
the number axis up or down to make the chosen value current. Flinging up
or down allows for multiple increments or decrements of the current value.
Long pressing on the lesser and greater values also allows for a quick change
of the current value. Tapping on the current value allows to type in a
desired value.
For an example of using this widget, see TimePicker.
| Nested Class Summary | |
|---|---|
static class |
NumberPicker.CustomEditText
|
static interface |
NumberPicker.Formatter
Interface used to format current value into a string for presentation. |
static interface |
NumberPicker.OnScrollListener
Interface to listen for the picker scroll state. |
static interface |
NumberPicker.OnValueChangeListener
Interface to listen for changes of the current value. |
| Nested classes/interfaces inherited from class android.widget.LinearLayout |
|---|
android.widget.LinearLayout.LayoutParams |
| Nested classes/interfaces inherited from class android.view.ViewGroup |
|---|
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 |
|---|
| Fields inherited from class android.widget.LinearLayout |
|---|
HORIZONTAL, SHOW_DIVIDER_BEGINNING, SHOW_DIVIDER_END, SHOW_DIVIDER_MIDDLE, SHOW_DIVIDER_NONE, VERTICAL |
| 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 | |
|---|---|
NumberPicker(android.content.Context context)
Create a new number picker. |
|
NumberPicker(android.content.Context context,
android.util.AttributeSet attrs)
Create a new number picker. |
|
NumberPicker(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
Create a new number picker |
|
| Method Summary | |
|---|---|
void |
computeScroll()
|
protected boolean |
dispatchHoverEvent(android.view.MotionEvent event)
|
boolean |
dispatchKeyEvent(android.view.KeyEvent event)
|
boolean |
dispatchTouchEvent(android.view.MotionEvent event)
|
boolean |
dispatchTrackballEvent(android.view.MotionEvent event)
|
android.view.accessibility.AccessibilityNodeProvider |
getAccessibilityNodeProvider()
|
protected float |
getBottomFadingEdgeStrength()
|
String[] |
getDisplayedValues()
Gets the values to be displayed instead of string values. |
int |
getMaxValue()
Returns the max value of the picker. |
int |
getMinValue()
Returns the min value of the picker. |
int |
getSolidColor()
|
protected float |
getTopFadingEdgeStrength()
|
static NumberPicker.Formatter |
getTwoDigitFormatter()
|
int |
getValue()
Returns the value of the picker. |
boolean |
getWrapSelectorWheel()
Gets whether the selector wheel wraps when reaching the min/max value. |
protected void |
onDetachedFromWindow()
|
protected void |
onDraw(android.graphics.Canvas canvas)
|
void |
onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent event)
|
boolean |
onInterceptTouchEvent(android.view.MotionEvent event)
|
protected void |
onLayout(boolean changed,
int left,
int top,
int right,
int bottom)
|
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
|
boolean |
onTouchEvent(android.view.MotionEvent event)
|
static int |
resolveSizeAndState(int size,
int measureSpec,
int childMeasuredState)
Utility to reconcile a desired size and state, with constraints imposed by a MeasureSpec. |
void |
scrollBy(int x,
int y)
|
void |
setDisplayedValues(String[] displayedValues)
Sets the values to be displayed. |
void |
setEnabled(boolean enabled)
|
void |
setFormatter(NumberPicker.Formatter formatter)
Set the formatter to be used for formatting the current value. |
void |
setMaxValue(int maxValue)
Sets the max value of the picker. |
void |
setMinValue(int minValue)
Sets the min value of the picker. |
void |
setOnLongPressUpdateInterval(long intervalMillis)
Sets the speed at which the numbers be incremented and decremented when the up and down buttons are long pressed respectively. |
void |
setOnScrollListener(NumberPicker.OnScrollListener onScrollListener)
Set listener to be notified for scroll state changes. |
void |
setOnValueChangedListener(NumberPicker.OnValueChangeListener onValueChangedListener)
Sets the listener to be notified on change of the current value. |
void |
setValue(int value)
Set the current value for the number picker. |
void |
setWrapSelectorWheel(boolean wrapSelectorWheel)
Sets whether the selector wheel shown during flinging/scrolling should wrap around the getMinValue() and
getMaxValue() values. |
| Methods inherited from class android.widget.LinearLayout |
|---|
checkLayoutParams, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getBaseline, getBaselineAlignedChildIndex, getDividerDrawable, getDividerPadding, getOrientation, getShowDividers, getWeightSum, isBaselineAligned, isMeasureWithLargestChildEnabled, onInitializeAccessibilityNodeInfo, setBaselineAligned, setBaselineAlignedChildIndex, setDividerDrawable, setDividerPadding, setGravity, setHorizontalGravity, setMeasureWithLargestChildEnabled, setOrientation, setShowDividers, setVerticalGravity, setWeightSum, shouldDelayChildPressedState |
| Methods inherited from class android.view.ViewGroup |
|---|
addChildrenForAccessibility, addFocusables, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, childDrawableStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawableStateChanged, drawChild, endViewTransition, findFocus, findViewsWithText, fitSystemWindows, focusableViewAvailable, focusSearch, gatherTransparentRegion, 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, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, 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, 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, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchPopulateAccessibilityEvent, draw, findViewById, findViewWithTag, focusSearch, forceLayout, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBottom, 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, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTop, 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, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onOverScrolled, onPopulateAccessibilityEvent, onRestoreInstanceState, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, 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, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBottom, setCameraDistance, setClickable, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setKeepScreenOn, setLayerType, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnClickListener, 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 |
| Constructor Detail |
|---|
public NumberPicker(android.content.Context context)
context - The application environment.
public NumberPicker(android.content.Context context,
android.util.AttributeSet attrs)
context - The application environment.attrs - A collection of attributes.
public NumberPicker(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
context - the application environment.attrs - a collection of attributes.defStyle - The default style to apply to this view.| Method Detail |
|---|
public static final NumberPicker.Formatter getTwoDigitFormatter()
protected void onLayout(boolean changed,
int left,
int top,
int right,
int bottom)
onLayout in class android.widget.LinearLayout
protected void onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
onMeasure in class android.widget.LinearLayoutpublic boolean onInterceptTouchEvent(android.view.MotionEvent event)
onInterceptTouchEvent in class android.view.ViewGrouppublic boolean onTouchEvent(android.view.MotionEvent event)
onTouchEvent in class android.view.Viewpublic boolean dispatchTouchEvent(android.view.MotionEvent event)
dispatchTouchEvent in class android.view.ViewGrouppublic boolean dispatchKeyEvent(android.view.KeyEvent event)
dispatchKeyEvent in class android.view.ViewGrouppublic boolean dispatchTrackballEvent(android.view.MotionEvent event)
dispatchTrackballEvent in class android.view.ViewGroupprotected boolean dispatchHoverEvent(android.view.MotionEvent event)
dispatchHoverEvent in class android.view.ViewGrouppublic void computeScroll()
computeScroll in class android.view.Viewpublic void setEnabled(boolean enabled)
setEnabled in class android.view.View
public void scrollBy(int x,
int y)
scrollBy in class android.view.Viewpublic int getSolidColor()
getSolidColor in class android.view.Viewpublic void setOnValueChangedListener(NumberPicker.OnValueChangeListener onValueChangedListener)
onValueChangedListener - The listener.public void setOnScrollListener(NumberPicker.OnScrollListener onScrollListener)
onScrollListener - The listener.public void setFormatter(NumberPicker.Formatter formatter)
Note: If you have provided alternative values for the values this formatter is never invoked.
formatter - The formatter object. If formatter is null,
String.valueOf(int) will be used.setDisplayedValues(String[])public void setValue(int value)
If the argument is less than the getMinValue() and
getWrapSelectorWheel() is false the
current value is set to the getMinValue() value.
If the argument is less than the getMinValue() and
getWrapSelectorWheel() is true the
current value is set to the getMaxValue() value.
If the argument is less than the getMaxValue() and
getWrapSelectorWheel() is false the
current value is set to the getMaxValue() value.
If the argument is less than the getMaxValue() and
getWrapSelectorWheel() is true the
current value is set to the getMinValue() value.
value - The current value.setWrapSelectorWheel(boolean),
setMinValue(int),
setMaxValue(int)public boolean getWrapSelectorWheel()
getMinValue(),
getMaxValue()public void setWrapSelectorWheel(boolean wrapSelectorWheel)
getMinValue() and
getMaxValue() values.
By default if the range (max - min) is more than the number of items shown on the selector wheel the selector wheel wrapping is enabled.
Note: If the number of items, i.e. the range (
getMaxValue() - getMinValue()) is less than
the number of items shown on the selector wheel, the selector wheel will
not wrap. Hence, in such a case calling this method is a NOP.
wrapSelectorWheel - Whether to wrap.public void setOnLongPressUpdateInterval(long intervalMillis)
The default value is 300 ms.
intervalMillis - The speed (in milliseconds) at which the numbers
will be incremented and decremented.public int getValue()
public int getMinValue()
public void setMinValue(int minValue)
minValue - The min value inclusive.
Note: The length of the displayed values array
set via setDisplayedValues(String[]) must be equal to the
range of selectable numbers which is equal to
getMaxValue() - getMinValue() + 1.public int getMaxValue()
public void setMaxValue(int maxValue)
maxValue - The max value inclusive.
Note: The length of the displayed values array
set via setDisplayedValues(String[]) must be equal to the
range of selectable numbers which is equal to
getMaxValue() - getMinValue() + 1.public String[] getDisplayedValues()
public void setDisplayedValues(String[] displayedValues)
displayedValues - The displayed values.
Note: The length of the displayed values array
must be equal to the range of selectable numbers which is equal to
getMaxValue() - getMinValue() + 1.protected float getTopFadingEdgeStrength()
getTopFadingEdgeStrength in class android.view.Viewprotected float getBottomFadingEdgeStrength()
getBottomFadingEdgeStrength in class android.view.Viewprotected void onDetachedFromWindow()
onDetachedFromWindow in class android.view.Viewprotected void onDraw(android.graphics.Canvas canvas)
onDraw in class android.widget.LinearLayoutpublic void onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent event)
onInitializeAccessibilityEvent in class android.widget.LinearLayoutpublic android.view.accessibility.AccessibilityNodeProvider getAccessibilityNodeProvider()
getAccessibilityNodeProvider in class android.view.View
public static int resolveSizeAndState(int size,
int measureSpec,
int childMeasuredState)
View.MEASURED_SIZE_MASK bits and
optionally the bit View.MEASURED_STATE_TOO_SMALL set if the resulting
size is smaller than the size the view wants to be.
size - How big the view wants to bemeasureSpec - Constraints imposed by the parent
View.MEASURED_SIZE_MASK and View.MEASURED_STATE_TOO_SMALL.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||