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
0
votes
0 answers

Sharing setOnValueChangedListener of a NmmberPicker to other classes

I am fairly new to Java and android development. I am currently coding a number picker to get user to choose a value as follows; public class ValPicker extends AppCompatActivity { public Activity activity; public ValPicker(Activity _activity) { …
Wave
  • 111
  • 1
  • 3
  • 12
0
votes
0 answers

How can we set a drawable background to scrolled position in Number Picker in Native Android

I'm implementing a Number Picker for my native Android Application. I have a requirement to show the scrolled position in number Picker to be selected with a drawable layout. How can I implement that in Number Picker? layoutFile:
0
votes
1 answer

Can we make custom horizontal NumberPicker in our own without library?

Can we make custom numberpicker using the NumberPicker and adding some Drawable ? Sample Image
Aashis
  • 41
  • 1
  • 8
0
votes
1 answer

I'm trying to use the Android NumberPicker widget, but I can't figure out how to set a value from the NumberPicker

I'm a total noob to Kotlin and programming in general, and I want to make an app. In the app involves a NumberPicker widget. I think I got the NP set up properly, as it works when I test it, but I have no clue how to retrieve the user set value from…
0
votes
2 answers

Display two number pickers on textview

I made a created two number pickers to fake as timepicker for the simple purpose of been able to rotate 0 - 30 repeatedly, which works. But now I want to display these two number pickers to a textview. So if the numberpickers shows what's in the…
Mr Android
  • 37
  • 5
0
votes
0 answers

Reduce width of MaterialAlertDialog with NumberPicker

i have a layout for a MaterialAlertDialog that just has a NumberPicker in it
0
votes
1 answer

How can I add NumberPicker on my Layout from Java code in my Android application?

I am making a simple application. I want to add NumberPicker from my Java code, but when I run it, the applications closes immediately. Can someone tell me where is the error? I know that I can add it in XML, but I wanted to add it from Java…
0
votes
1 answer

How to have different color for selected and non-selected value of a number picker in android studio?

I am making a custom number picker. I want the color of selected values to be different from non selected values. below is my XML: