Questions tagged [numberpicker]

A Number Picker is a UI element that lets the user pick a numeric value.

NumberPickers define the input value to be numbers and optionally some other numeric characters, like . or -.

This definition is useful for input sanitation, and it allows mobile devices to show a numeric-only keyboard when the input field is edited.

Examples:

362 questions
12
votes
3 answers

Block transition between minimum value and maximum value in NumberPicker

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…
Leeeeeeelo
  • 4,333
  • 3
  • 34
  • 44
11
votes
3 answers

NumberPicker.getValue() on SCROLL_STATE_IDLE, might not be the last updated value

I'm using the below function to detect the last final value when user complete their scroll select on NumberPicker. The getValue() would then get the latest value updated. numberPicker.setOnScrollListener(new NumberPicker.OnScrollListener() { …
Elye
  • 53,639
  • 54
  • 212
  • 474
11
votes
4 answers

Adding a listener to a number picker widget

I am working on integrating a number picker to my application. The activity displays a list of items each with a number picker. The user can increase or decrease the quantity using the number picker. As they do this I would like to update a TextView…
Javacadabra
  • 5,578
  • 15
  • 84
  • 152
10
votes
4 answers

How to create a negative NumberPicker

Does anyone know of an easy way to allow negative numbers with Android's default numberpicker? I understand that it's the InputFilter that disallows this, but is there any easy way to override without rewriting the whole widget?
Josh
  • 2,685
  • 6
  • 33
  • 47
10
votes
5 answers

How to change NumberPicker's value with animation?

I've created an application for Android, in which there is a NumberPicker. And I need to change the value of this NumberPicker but with a smooth animation like when you touch it and change its value. For example, assume the current value is 1 and…
Mehran
  • 1,951
  • 4
  • 20
  • 26
9
votes
4 answers

Android Jetpack Compose NumberPicker Widget Equivalent

What is the recommended solution for creating a NumberPicker Widget in Jetpack Compose? Similar to the image below. I am able to create an NumberPicker using an AndroidView within my composable but the view does not seem to allow flings or snap to…
9
votes
1 answer

Android NumberPicker widget, how to get value entered via softkeyboard?

I'm having trouble getting the edit field of my NumberPicker to work properly, I've read several helpful answers to similar questions but none of them seem to address this particular issue. Although the increment and decrement buttons do work…
Alan Moore
  • 6,525
  • 6
  • 55
  • 68
9
votes
2 answers

Restricting Android NumberPicker to Numeric Keyboard for Numeric Input (not Alpha keyboard)

Is there a way to suggest or restrict keyboard input when selecting a NumberPicker so only the number controls are shown when entering values, similar to how you can use android:inputType="number" with a EditText? I have a series of values, from 0.0…
CrimsonX
  • 9,048
  • 9
  • 41
  • 52
9
votes
3 answers

android numberpicker for floating point numbers

The user of our app should be able to adjust a floating point number. At the moment, I filled an ArrayAdapter with all possible values and attached it to a spinner. This solution doesn't really meet our expectations, since the spinner dropdown box…
Marco
  • 1,276
  • 1
  • 10
  • 19
8
votes
2 answers

Display a NumberPicker on an AlertDialog

I am trying to display a NumberPicker on an AlertDialog. The AlertDialog works, but it doesn't show the NumberPicker. Here is my code public Dialog onCreateDialog(Bundle savedInstanceState){ final NumberPicker numberPicker = new…
Apodeus
  • 105
  • 2
  • 7
8
votes
3 answers

How to change size of a numberpicker Android

I'm trying to decrease the size of an Android numberpicker, but already tried several things and I could not. I did not find a responsible attribute the change in size. Wanted to do the following: Must decrease because I have to put the…
Jefferson
  • 307
  • 1
  • 5
  • 12
8
votes
1 answer

How to change Number Picker center text color in Android

I have implemented a custom Date Picker wherein I need to have custom colors for the number picker (Date picker uses Number picker inside) inside it as follows: With the help of this answer I could make it look like this: But as you see the actual…
Rajkiran
  • 15,845
  • 24
  • 74
  • 114
8
votes
4 answers

Create NumberPicker dialog in preference

I am trying to create a NumberPicker dialog in my preference screen. I have already made one following this:https://stackoverflow.com/a/5533295/2442638 However, for my second dialog, I only want one spinner, so I have adapted the code as…
user2442638
8
votes
2 answers

Android NumberPicker, DatePicker, TimePicker arrows are missing

I have seen many examples with a pair of up and down arrows on NumberPicker, DatePicker and TimePicker of Android applications. But when I use it, application show no arrows. Are there any tricks to make the arrows shown? The SDK is API version 17…
OmniBus
  • 854
  • 1
  • 6
  • 25
8
votes
5 answers

Android - Error inflating SimonVT NumberPicker class in my layout xml

I've been at this for days now, and I am at the point of giving up, so any help is much appreciated! I've been trying to implement the simonVT numberpicker in my android app. Completely new to android, so including the library, referencing this…
Ste77
  • 676
  • 1
  • 7
  • 21
1
2
3
24 25