1

I want to create range seekbar in my app. But i can't create perfectly seekbar according to image. How can i create Please tell me any one. Thanks example

1

1 Answer 1

9

You can use the RangeSlider provided by the Material Components library:

        <com.google.android.material.slider.RangeSlider
            app:labelBehavior="withinBounds"
            android:valueFrom="0"
            android:valueTo="10000"
            app:values="@array/initial_slider_values"
        />

with:

<resources>
  <array name="initial_slider_values">
    <item>2000</item>
    <item>3500</item>
  </array>
</resources>

enter image description here

You can also use the method setValues():

RangeSlider slider = findViewById(R.id.slider);
slider.setValues(2000f,3500f);
Sign up to request clarification or add additional context in comments.

3 Comments

Links to the official doc and guidelines : material.io/components/sliders/android
How show values with seekbar
Hi Thanks for posting this can you please help me can we should Time Interval Like 1am-2Pm in start and end interval

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.