Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stepper(increase/decrease value) control for Android?

In iOS, there is the Stepper control that has a plus and minus button to change a value.

I could not find a similar control in both the Android developer and the material design documentation.

What is the "official Android way" of doing an "increase/decrease" button?

like image 583
PastAndSalmon Avatar asked Sep 17 '25 21:09

PastAndSalmon


2 Answers

Stepper(increase/decrease value) control for Android?

There is no Built in control available like Stepper in Android

But your can try this way

<LinearLayout
    android:layout_width="wrap_content"
    android:background="#ffffff"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

    <ImageButton
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:src="@drawable/ic_add_black" />

    <ImageButton
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:src="@drawable/ic_remove" />

</LinearLayout>

android:src="@drawable/ic_add_black"

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0">
    <path
        android:fillColor="#FF000000"
        android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>

android:src="@drawable/ic_remove"

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0">
    <path
        android:fillColor="#FF000000"
        android:pathData="M19,13H5v-2h14v2z"/>
</vector>

OUTPUT

enter image description here

like image 102
AskNilesh Avatar answered Sep 20 '25 13:09

AskNilesh


As @Nilesh Rathod said, there's no built in solution. You can create your own or make use of some third-party library available. For example this looks good:

https://github.com/ashik94vc/ElegantNumberButton

like image 37
sebasira Avatar answered Sep 20 '25 12:09

sebasira