I don't believe that this is natively supported. I thought of a 'messy' way of doing it manually:
You can use the NumberPicker's scrollBy(int x, int y) function called iteratively to make the effect of the animation.
Some things to take into account:
- scrollBy(x,y) works with pixels. As Android has got all that different screen densities, what you should do is first guess (I'd do it by trial and error) the 'dp' distance that corresponds to scrolling to a consecutive value, and convert that to pixels in order to use it.
- The first parameter of scrollBy(x,y) should take a value of 0, in case it is not obvious
I haven't made animations myself in Android, but there is a very good API since Honeycomb which probably makes it easy to accomplish this.
I am sorry, but this is the easiest I could think of!
EDIT: To convert from 'dp' to pixels:
private float pxFromDp(float dp)
{
return dp * this.getContext().getResources().getDisplayMetrics().density;
}
What you'll have to do is test calling scrollBy(0, pxFromDp(dp)) with different 'dp' values, until you get the exact one that moves the NumberPicker up one number. Once you get that value, you can create your animation method that when moving up X numbers will scroll X times this dp distance.
Please ask again if you don't understand it completely :)