Add this into your dependencies block.
implementation 'co.sodalabs:styled-slider-view:x.x.x'
If you cannot find the package on JCenter, add this to your gradle repository
maven {
url 'https://dl.bintray.com/sodalabs/android'
}
A slider that the thumb is cut by the shape of the track.
app:thumbDrawable
: The thumb drawable.app:trackForegroundDrawable
: The foreground track drawable.app:trackBackgroundDrawable
: The track (a.k.a progress, but only the background part) drawable.app:touchDragSlop
: A slop where the touch forms a drag if the move distance is over.
<co.sodalabs.view.StyledCutThumbSliderView
...
android:progress="50"
app:thumbDrawable="@drawable/default_slider_thumb"
app:trackBackgroundDrawable="@drawable/default_slider_background_track"
app:trackForegroundDrawable="@drawable/default_slider_foreground_track" />
A discrete slider with drawable marker customization.
Note: The slider has a minimum height 21 dip.
app:thumbDrawable
: The thumb drawable.app:trackBackgroundDrawable
: The track (a.k.a progress, but only the background part) drawable.app:markerDrawableMiddle
: The marker (tick) drawable in the middle.app:markerDrawableStart
: The marker (tick) drawable at the start.app:markerDrawableEnd
: The marker (tick) drawable at the end.app:markerNum
: The amount of markers on the track. The markers are distributed evenly spaced.app:touchDragSlop
: A slop where the touch forms a drag if the move distance is over.
<co.sodalabs.view.StyledMarkerSliderView
...
android:progress="50"
app:markerDrawableEnd="@drawable/default_marker_slider_marker_end"
app:markerDrawableMiddle="@drawable/default_marker_slider_marker_middle"
app:markerDrawableStart="@drawable/default_marker_slider_marker_start"
app:markerNum="5"
app:thumbDrawable="@drawable/default_slider_thumb"
app:trackBackgroundDrawable="@drawable/default_slider_foreground_track" />