I am working on an Android application. Somewhere inside, I am displaying the NumberPicker
widget.
How can I disable the transition between the minimum value and the maximum value?
What I mean, I am using a number picker, with a minimum value of 0 and a maximum value of 9999. It looks like this,
In this way, the user can quickly fling the widget to jump from 0 to 9999. I do not want this behavior. The number picker widget as it is now looks like a closed circle, and I am trying to see how I can break the circle exactly between the minimum and maximum value, so that it looks like this from the minimum value and maximum value:
How can I achieve this?
What I have tried :
- I searched everywhere in the
NumberPicker
API, it doesn't seem like this is something that one can simply set using a method. - I think that I can use the method
setDisplayedValues(String[] displayedValues)
method to add empty strings before the minimum value and after the maximum value, so that no value is displayed before the minimum value or after the maximum value, BUT the user will still be able to fling past them or WORSE: select the empty value.
Any ideas? Will I have to get my hands dirty and dig in the widget implementation? Inside the touch listener maybe?