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
1
vote
0 answers

How can I make the sum of 3 number picker 100?

I want to make an application with 3 number pickers. I want to find the percentage distribution of carbohydrates, fat and protein. and this 3 number picker works in coordination with each other and I want to adjust the max and min values…
NOTR
  • 11
  • 2
1
vote
2 answers

NumberPicker value not getting if entered custom input number

I have used Material NumberPicker in Dialog and I have faced an issue while dialog opened and user can enter any number manually (From 1 to 10) in NumberPicker and Pressed "OK" button from Dialog then didn't get correct value as entered in…
Pratik Dodiya
  • 2,337
  • 1
  • 19
  • 12
1
vote
0 answers

Making numberpicker with usernames picked from database by the volley library

I'm trying to make a number picker with usernames picked from database by the volley library. My php script's response looks like this: [{"username":"adam"},{"username":"tomasz"},{"username":"komercja"}] My number picker code look like this …
1
vote
0 answers

NumberPicker Restrictions on non-SDK interfaces

I'm trying to create a custom NumberPicker like this. Class numberPickerClass = null; try { numberPickerClass = Class.forName("android.widget.NumberPicker"); } catch (ClassNotFoundException e) { …
1
vote
0 answers

java.lang.IndexOutOfBoundsException in NumberPicker

In pre launch reports for Android, I am getting the following error. While watching the recording it looks like when the bot selects a value it crashes but I cannot replicate the issue. Let me know if you need more information. How can I resolve…
1
vote
2 answers

Increase Number Picker Wheel Item Count - Default set to 3 items in the Wheel

Currently by default the number picker only displays 3 values/items/elements at a time. I thought this will be easily changed but I was wrong. I cannot figure out how to change this. I looked around and could not find a way to change it. Maybe there…
1
vote
2 answers

NumberPicker with arraylist

I am trying to add a list of data within a numberpicker. I am using the library of: https://github.com/ShawnLin013/NumberPicker for the numberpicker. This is how it appears in my app: As you can see it appears with [ ] at its sides and separated by…
1
vote
1 answer

Changing displayed values of NumberPicker

I want to change my first NumberPicker values whan user changes the second NumberPicker current value index. I've tried this code to achieve that: weightPostfixNumberPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() { …
coldembrace
  • 549
  • 8
  • 19
1
vote
1 answer

Android NumberPicker shows 2 keyboards when editing text

Originally the number picker worked perfectly, but as soon as I put it in a listview item I was unable to enter numbers. When you select it to edit the text it sometimes brings up a text keyboard and sometimes a number keyboard. When pressing the…
1
vote
0 answers

Android Studio dialog doesn't work

I am trying to create multi question dialog. It seems that everything is working fine expect that I cannot get result of numberpicker + I have leaking window in the end This is my code: final Context context = this; int currentshape,…
1
vote
1 answer

Android Number Picker "shadows"

The number pickers in Android contain a shadow above the previous and next value(s). Is there a attribute to make this shadow transparent? If an image is being used as the background, these shadows are distracting. Edit: Running emulator with…
lancer
  • 133
  • 1
  • 3
  • 11
1
vote
0 answers

NumberPicker displaying formated strings dosen't show selected value

So I load a list of objects successfully and format it like this. mNumberPicker.setFormatter(new NumberPicker.Formatter() { @Override public String format(int value) { …
1
vote
1 answer

Custom number picker which can display : 0 1 0?

With the default android Number Picker, when there is only 0 and 1 inside it, the UI doesn't react properly (freeze or glitch). Is there a possibility to extends from Number Picker to have as displayed Values [0,1,0] ?Thanks!!
Bénédicte Lagouge
  • 482
  • 2
  • 9
  • 24
1
vote
0 answers

NumberPicker scaling gives strange appearance (Nexus 5X)

I have 3 NumberPicker in my layout, like that: ... And I my fragment (onCreateView()) I set scale Y…
anthony
  • 7,653
  • 8
  • 49
  • 101
1
vote
0 answers

Hide previous/next numbers in a number picker

I'm looking to hide the top and bottom numbers in a number picker (Android), so that you only ever see what's inside the 'selected item' area. I can't seem to figure out how to modify the number picker class to stop it from drawing these numbers. I…
DXHHH101
  • 13
  • 6