Best code examples for Android NumberPicker class (android.widget.NumberPicker)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android NumberPicker class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android NumberPicker examples from Open Source projects
Examples using Android NumberPicker getMaxValue method:
This code example shows how to use the following methods: getMaxValue, getMinValue, setDisplayedValues, setMaxValue, setMinValue
449:	mMonthSpinner.setDisplayedValues(null); 
-
451:	mMonthSpinner.setMinValue(mCurrentDate.get(Calendar.MONTH)); 
452:	mMonthSpinner.setMaxValue(mCurrentDate.getActualMaximum(Calendar.MONTH)); 
-
454:	mMonthSpinner.setMinValue(mCurrentDate.getActualMinimum(Calendar.MONTH)); 
455:	mMonthSpinner.setMaxValue(mCurrentDate.get(Calendar.MONTH)); 
-
457:	mMonthSpinner.setMinValue(Calendar.JANUARY); 
458:	mMonthSpinner.setMaxValue(Calendar.DECEMBER); 
-
462:	mMonthSpinner.getMinValue(), mMonthSpinner.getMaxValue() + 1); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getMaxValue, getMinValue, setDisplayedValues, setMaxValue, setMinValue
377:	mMonthSpinner.setDisplayedValues(null); 
378:	mMonthSpinner.setMinValue(0); 
379:	mMonthSpinner.setMaxValue(11); 
380:	mMonthSpinner.setWrapSelectorWheel(true); 
-
386:	mMonthSpinner.getMinValue(), mMonthSpinner.getMaxValue() + 1); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getMaxValue, getValue
153:	int newId = mUnitSpinner.getValue() * (mNumberSpinner.getMaxValue() + 1) 
154:	+ mNumberSpinner.getValue() + 1; 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setDisplayedValues, setMaxValue, setMinValue, setValue, setWrapSelectorWheel
219:	mPositionInYearSpinner.setDisplayedValues(null); 
-
222:	mPositionInYearSpinner.setMinValue(getMinPositionInYear()); 
223:	mPositionInYearSpinner.setMaxValue(getMaxPositionInYear()); 
224:	mPositionInYearSpinner.setWrapSelectorWheel( 
-
234:	mPositionInYearSpinner.setValue(getPositionInYear()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setDisplayedValues, setMaxValue, setMinValue, setValue, setWrapSelectorWheel
219:	mPositionInYearSpinner.setDisplayedValues(null); 
-
222:	mPositionInYearSpinner.setMinValue(getMinPositionInYear()); 
223:	mPositionInYearSpinner.setMaxValue(getMaxPositionInYear()); 
224:	mPositionInYearSpinner.setWrapSelectorWheel( 
-
234:	mPositionInYearSpinner.setValue(getPositionInYear()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setDisplayedValues, setMaxValue, setMinValue, setValue
370:	mKHzPicker.setMinValue(1); 
371:	mKHzPicker.setMaxValue(khzNumSteps); 
372:	mKHzPicker.setDisplayedValues(khzStrings); 
-
386:	mKHzPicker.setValue(mKhz); 
Full Snippet Info
5
CodeRank
Examples using Android NumberPicker getValue method:
This code example shows how to use the following methods: clearFocus, getValue
117:	mNumberPicker.clearFocus(); 
118:	mCallback.onNumberSet(mDialogId, mNumberPicker.getValue()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: clearFocus, hasFocus, getValue, setEnabled, setFocusable
37:	} else if (addrEdit.hasFocus()) { 
38:	addrEdit.clearFocus(); 
-
47:	addrEdit.setEnabled(enabled); 
48:	addrEdit.setFocusable(enabled); 
49:	addrEdit.setFocusableInTouchMode(enabled); 
-
119:	light.setAddress(addrEdit.getValue()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getValue
100:	persistInt(mNumberPicker.getValue()); 
Full Snippet Info
6
CodeRank
Examples using Android NumberPicker setFormatter method:
This code example shows how to use the following methods: setFormatter, setMaxValue, setMinValue, setWrapSelectorWheel, setFocusable
315:	NumberPicker digit = new NumberPicker(getContext()); 
-
323:	digit.setLayoutParams(params); 
324:	digit.setMinValue(0); 
325:	digit.setMaxValue(maxValue); 
-
327:	digit.setWrapSelectorWheel(false); 
328:	digit.setFocusable(false); 
329:	digit.setFocusableInTouchMode(false); 
-
332:	digit.setFormatter(new NumberPicker.Formatter() { 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setDescendantFocusability, setFormatter, setMaxValue, setMinValue, setValue
65:	mPicker = new NumberPicker(getContext()); 
-
67:	mPicker.setMaxValue(mMaxValue); 
68:	mPicker.setMinValue(mMinValue); 
69:	mPicker.setValue(mValue); 
-
71:	mPicker.setFormatter(new NumberPicker.Formatter() 
-
81:	mPicker.setWrapSelectorWheel(false); 
82:	mPicker.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS); 
Full Snippet Info
6
CodeRank
Examples using Android NumberPicker setMaxValue method:
This code example shows how to use the following methods: setMaxValue, setMinValue, setOnValueChangedListener, setValue
31:	this.a.setMinValue(paramInt3); 
32:	this.a.setMaxValue(paramInt4); 
33:	this.a.setValue(paramInt2); 
34:	this.a.setOnValueChangedListener(this); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setMaxValue, setMinValue, setOnValueChangedListener, setValue
44:	mNumberPicker = new NumberPicker(mCtx); 
-
51:	mNumberPicker.setOnValueChangedListener(this); 
-
55:	mNumberPicker.setMaxValue(mMax); 
56:	mNumberPicker.setMinValue(1); 
57:	mNumberPicker.setValue(mValue); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setMaxValue, setMinValue, setContentDescription
33:	NumberPicker periodicity = new NumberPicker(this); 
34:	periodicity.setContentDescription("Defines the frequency that the location is send (in minutes)"); 
35:	periodicity.setMinValue(0); 
36:	periodicity.setMaxValue(60); 
Full Snippet Info
6
CodeRank
Examples using Android NumberPicker setEnabled method:
This code example shows how to use the following methods: clearFocus, hasFocus, getValue, setEnabled, setFocusable
39:	} else if (addrEdit.hasFocus()) { 
40:	addrEdit.clearFocus(); 
-
49:	addrEdit.setFocusable(enabled); 
50:	addrEdit.setFocusableInTouchMode(enabled); 
51:	addrEdit.setEnabled(enabled); 
-
108:	light.setAddress(addrEdit.getValue()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: clearFocus, hasFocus, getValue, setEnabled, setFocusable
41:	} else if (endAddrEdit.hasFocus()) { 
42:	endAddrEdit.clearFocus(); 
-
54:	endAddrEdit.setEnabled(enabled); 
55:	endAddrEdit.setFocusable(enabled); 
56:	endAddrEdit.setFocusableInTouchMode(enabled); 
-
130:	light.setEndAddress(endAddrEdit.getValue()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setEnabled, setMaxValue, setMinValue, setValue, setWrapSelectorWheel
179:	npSpeaker.setMaxValue(maxVolume); 
180:	npSpeaker.setMinValue(1); 
-
182:	npSpeaker.setWrapSelectorWheel(false); 
-
185:	npSpeaker.setValue(maxVolume/2); 
-
188:	npSpeaker.setEnabled(false); 
Full Snippet Info
6
CodeRank
Examples using Android NumberPicker getMinValue method:
This code example shows how to use the following methods: getMaxValue, getMinValue
68:	if (oldVal == picker.getMaxValue() && newVal == picker.getMinValue()) { 
-
71:	} else if (oldVal == picker.getMinValue() && newVal == picker.getMaxValue()) { 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getMaxValue, getMinValue, getValue
126:	savedState.value = mNumberPicker.getValue(); 
127:	savedState.maxValue = mNumberPicker.getMaxValue(); 
128:	savedState.minValue = mNumberPicker.getMinValue(); 
Full Snippet Info
5
CodeRank
Examples using Android NumberPicker setMinValue method:
This code example shows how to use the following methods: setMaxValue, setMinValue, setValue
440:	mDayPicker.setMinValue(1); 
441:	mDayPicker.setMaxValue(max); 
442:	mDayPicker.setValue(mDay); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getValue, setMaxValue, setMinValue, setOnValueChangedListener
79:	_numPlyrs.setMinValue(_util.MIN_PLAYERS); 
80:	_numPlyrs.setMaxValue(_util.MAX_PLAYERS); 
-
87:	_numPlyrsPlayoffs.setMaxValue(_numPlyrs.getValue()); 
-
97:	np.setOnValueChangedListener(new OnValueChangeListener() 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setDisplayedValues, setMaxValue, setMinValue, setValue
384:	mKHzPicker.setDisplayedValues(get50KHzStrings()); 
385:	mKHzPicker.setMinValue(1); 
386:	mKHzPicker.setMaxValue(khzNumSteps); 
387:	mKHzPicker.setDisplayedValues(khzStrings); 
-
402:	mKHzPicker.setValue(mKhz); 
Full Snippet Info
5
CodeRank
Examples using Android NumberPicker setValue method:
This code example shows how to use the following methods: setValue
154:	mNumberPicker.setValue(myState.value); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setMaxValue, setMinValue, setValue
440:	mDayPicker.setMinValue(1); 
441:	mDayPicker.setMaxValue(max); 
442:	mDayPicker.setValue(mDay); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setValue, setVisibility
426:	mYearPicker.setValue(mYear); 
427:	mYearPicker.setVisibility(mHasYear ? View.VISIBLE : View.GONE); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setMaxValue, setMinValue, setOnLongPressUpdateInterval
56:	picker.setMaxValue(255); 
57:	picker.setMinValue(0); 
58:	picker.setOnLongPressUpdateInterval(20); 
Full Snippet Info
5
CodeRank
Examples for other Android NumberPicker methods:
Related Android NumberPicker Questions & Answers:
NumberPicker Class Overview
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. If the current theme is derived from 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. If the current theme is derived from Theme_Holo or 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....
Methods
  • getValue
    Returns the value of the picker.
  • setFormatter
    Set the formatter to be used for formatting the current value.
  • setOnLongPressUpdateInterval
    Sets the speed at which the numbers be incremented and decremented when the up and down buttons are long pressed respectively.
  • setValue
    Set the current value for the number picker.
  • setWrapSelectorWheel
    Sets whether the selector wheel shown during flinging/scrolling should wrap around the getMinValue() and getMaxValue() values.