简体   繁体   中英

Android Range Seekbar with two different thumbs

I want a range seekbar with two different thumb range selections.

I'm using this library but there is not an option right drawable only the left drawable is working on both ends.

<org.florescu.android.rangeseekbar.RangeSeekBar
                                    android:id="@+id/rangeSeekBar_"
                                    android:layout_width="match_parent"
                                    android:layout_height="50dp"
                                    android:visibility="visible"
                                    app:thumbPressed="@drawable/ic_seeker"
                                    app:thumbNormal="@drawable/ic_seeker"
                                    app:showLabels="false"
                               />

is there any other library or workaround please help Complete solutions are also welcome of course;)

You should use material design Sliders for that.

Add Google's Maven Repository google() in build.gradle. For example:

 allprojects {
    repositories {
      google()
      jcenter()
    }
  }

Add the library to the dependencies section:

 dependencies {
// ...
implementation 'com.google.android.material:material:<version>'
// ...
 }

In the layout:

<com.google.android.material.slider.RangeSlider
  android:id="@+id/range_slider"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:contentDescription="@string/slider_desc"
  app:values="@array/initial_slider_values"
  android:valueFrom="0.0"
  android:valueTo="100.0" />

For more details: https://material.io/components/sliders/android#continuous-slider

Try with this range seekbar: https://github.com/YahooArchive/android-range-seek-bar

Dependency:

implementation 'com.yahoo.mobile.client.android.util.rangeseekbar:rangeseekbar-

library:0.1.0'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM