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

99 questions
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
  • 469
  • 5
  • 17
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
  • 123
  • 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
2 answers

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
  • 472
  • 1
  • 7
  • 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
  • 6,803
  • 7
  • 39
  • 83
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
1
vote
1 answer

Replace textView for NumberPicker - Android

So I have some textViews that their inputs are numbers, but in order to be less prone to error I want to replace it with numberPickers. What I have done TextViews work NumberPickers Work Any math and calculation works What I need: To replace the…
Joedk
  • 11
  • 3
1
vote
1 answer

NumberPicker Material Style Custom Selection Divider

I wanted to customize number picker selection divider. I created custom drawable to be used for number picker selection divider. I created custom material style inheriting number picker material style.