Sever
Sever

Reputation: 2636

Android Material Slider from Max to Min

Thats a little simple question, but unfortunately i did not find any info.

I need to set slider to max, so user slide to the left to min value.

Thats default behavior:

Thats default behavior

Thats how I want:

Thats how I want

Upvotes: 1

Views: 2007

Answers (1)

Erselan Khan
Erselan Khan

Reputation: 845

You can use the property of layoutDirection

<com.google.android.material.slider.Slider
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:valueFrom="0"
        android:valueTo="100"
        android:layoutDirection="rtl"/>

Or if you want to set maximum value as default:

<com.google.android.material.slider.Slider
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:valueFrom="0"
        android:valueTo="100"
        android:value="100"/>

Upvotes: 7

Related Questions