Questions tagged [android-number-picker]

A widget that enables the user to select a number from a predefined range. There are two flavors of this widget and which one is presented to the user depends on the current theme.

A widget that enables the user to select a number from 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.

Useful links

105 questions
39
votes
10 answers

Android NumberPicker with Formatter doesn't format on first rendering

I have a NumberPicker that has a formatter that formats the displayed numbers either when the NumberPicker spins or when a value is entered manually. This works fine, but when the NumberPicker is first shown and I initialize it with setValue(0) the…
A. Steenbergen
  • 3,360
  • 4
  • 34
  • 51
26
votes
6 answers

How to decrease padding in NumberPicker

How to decrease padding in NumberPicker I want something like it:
comalex3
  • 2,497
  • 4
  • 26
  • 47
9
votes
4 answers

Android Jetpack Compose NumberPicker Widget Equivalent

What is the recommended solution for creating a NumberPicker Widget in Jetpack Compose? Similar to the image below. I am able to create an NumberPicker using an AndroidView within my composable but the view does not seem to allow flings or snap to…
9
votes
0 answers

Change NumberPicker fading edge value or change alpha of top/bottom text

Is there a way to increase the fading edge or change top/bottom text alpha of number picker? I was able to extend NumberPicker class and change alpha of number picker wheel but once I start scrolling alpha gets applied to the center text as well. As…
Alex
  • 1,052
  • 1
  • 11
  • 22
7
votes
0 answers

Android - NumberPicker scroll / fling faster

How can I make number picker scroll/fling faster? Currently it takes so much effort from going 00 minute to 59 minute. I've tried some example from Slowing speed of Viewpager controller in android and applied opposite of it to number picker, but I…
Alex
  • 1,052
  • 1
  • 11
  • 22
5
votes
3 answers

Setting NumberPicker default value

I am making a number picker dialog having 2 number pickers, years and months. I want to show some default value in these 2 number picker, apart from 0, 0 Code:: final NumberPicker numberPickerYear = (NumberPicker)…
Adarsh Raj
  • 183
  • 1
  • 3
  • 12
5
votes
0 answers

Android Custom number picker issue

I am building a library with a NumberPicker and two buttons which controls the Up and Down of the number. I set the min and max to the NumberPicker with setMin, setMax, setValue and after that I set an ordered array in the setDisplayValues…
Mun0n
  • 4,438
  • 4
  • 28
  • 46
4
votes
1 answer

Display more numbers in NumberPicker

I have two issues, first one is removing the divider in the NumberPicker and I'm extending the NumberPicker in Android to solve this issue, like this: import android.content.Context; import android.content.res.Resources; import…
Abdulrahman
  • 301
  • 1
  • 3
  • 12
3
votes
3 answers

Number picker data is not showing correctly android

Hello guys I am facing a problem with number picker. I have some string that needs to be displayed as but on select second option 'menu' with select button and reopen the dialog containing number picker the data is being shown something like…
Anand Kumar Jha
  • 614
  • 9
  • 23
3
votes
0 answers

NumberPicker, intercept when picker stop scrolling

I need to implement a View with two numberPicker, pickerOne and pickerTwo. pickerTwo values depending on current value of pickerOne, so when user scroll pickerOne, values inside pickerTwo change. I've implement pickerOne like: NumberPicker…
giozh
  • 9,868
  • 30
  • 102
  • 183
3
votes
1 answer

Formatted value of NumberPicker disappears onClick

My NumberPicker in setDescendantFocusability(FOCUS_BLOCK_DESCENDANTS) mode and the setWrapSelectorWheel(false) is turned off. I formatted my Numberpicker with a simple formatter: mNumberPicker.setFormatter(new NumberPicker.Formatter() { …
3
votes
2 answers

Number picker only allowing zero as value

I am making an app that utilizes the numberpicker. What happens is when I try to create the numberpicker and set its attributes, it just simply won't do anything. The only value it allows is zero, and you can't scroll the numbers with it either.…
Jonas M.W.
  • 113
  • 7
3
votes
0 answers

Android number picker set sensitivity for scroll

I am trying to use a time picker in my alarm clock. My current lowest level api is set to 17 so I cant just use the time/date picker and set the style to spinner because this is only available in api 21. I found this…
Nicholas Muir
  • 2,897
  • 8
  • 39
  • 89
3
votes
1 answer

start number picker with previously selected value

I am using alert dailog as number picker,i am able to select value and set it to my textview,but what i am trying is,if i select suppose 5 from number picker,then it will set to textview and again if i click on textview then 5 must be focused or…
rosy
  • 57
  • 11
3
votes
1 answer

Typing with keyboard in TimePicker requires pressing "Enter" before "OK", otherwise values discarded

My program shows classic android.app.TimePickerDialog and listens to OnTimeSetListener.onTimeSet() . After migrating from Android 4.3 to 5.1 I noticed that typing minutes using keyboard and pressing "OK" results wrong values passed to onTimeSet()…
1
2 3 4 5 6 7