Stepper(increase/decrease value) control for Android?

Viewed 3060

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?

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

Related