# RangeSlider

[View Source](https://github.com/material-components/material-components-android/blob/1.14.0/lib/java/com/google/android/material/slider/RangeSlider.java)

*** ** * ** ***


```
public class RangeSlider
```

<br />

*** ** * ** ***

A range slider can be used to select from either a continuous or a discrete set of values. The default is to use a continuous range of values from valueFrom to valueTo.

The slider can function either as a continuous slider, or as a discrete slider. The mode of operation is controlled by the value of the step size. If the step size is set to 0, the slider operates as a continuous slider where the slider's thumb can be moved to any position along the horizontal line. If the step size is set to a number greater than 0, the slider operates as a discrete slider where the slider's thumb will snap to the closest valid value. See \* #setStepSize(float).

The interface defines a formatter to be used to render text within the value indicator label on interaction.

is a simple implementation of the that displays the selected value using letters to indicate magnitude (e.g.: 1.5K, 3M, 12B, etc..).

With the default style \* com.google.android.material.R.style#Widget_MaterialComponents_Slider, colorPrimary and colorOnPrimary are used to customize the color of the slider when enabled, and colorOnSurface is used when disabled. The following attributes are used to customize the slider's appearance further:

- haloColor}: the color of the halo around the thumb.
- haloRadius}: The radius of the halo around the thumb.
- labelBehavior}: The behavior of the label which can be LABEL_FLOATING}, LABEL_WITHIN_BOUNDS}, or LABEL_GONE}. See for more information.
- labelStyle}: the style to apply to the value indicator .
- thumbColor}: the color of the slider's thumb.
- thumbStrokeColor}: the color of the thumb's stroke.
- thumbStrokeWidth}: the width of the thumb's stroke.
- thumbElevation}: the elevation of the slider's thumb.
- thumbWidth}: The width of the slider's thumb.
- thumbHeight}: The height of the slider's thumb.
- thumbRadius}: The radius of the slider's thumb.
- thumbTrackGapSize}: The size of the gap between the thumb and the track.
- tickColorActive}: the color of the slider's tick marks for the active part of the track. Only used when the slider is in discrete mode.
- tickColorInactive}: the color of the slider's tick marks for the inactive part of the track. Only used when the slider is in discrete mode.
- tickColor}: the color of the slider's tick marks. Only used when the slider is in discrete mode. This is a short hand for setting both the tickColorActive} and \*tickColorInactive to the same thing. This takes precedence over tickColorActive} and tickColorInactive}.
- tickVisible} (**deprecated**, use tickVisibilityMode} instead): Whether to show the tick marks. Only used when the slider is in discrete mode.
- tickVisibilityMode}: Mode to specify the visibility of tick marks. Only used when the slider is in discrete mode.
- trackColorActive}: The color of the active part of the track.
- trackColorInactive}: The color of the inactive part of the track.
- trackColor}: The color of the whole track. This is a short hand for setting both the trackColorActive} and trackColorInactive} to the same thing. This takes precedence over trackColorActive} and trackColorInactive}.
- trackHeight}: The height of the track.
- trackCornerSize}: The corner size on the outside of the track.
- trackInsideCornerSize}: The corner size on the inside of the track (visible with gap).
- trackStopIndicatorSize}: The size of the stop indicator at the edges of the track.

The following XML attributes are used to set the slider's various parameters of operation:

- android:valueFrom}: **Required.** The slider's minimum value. This attribute must be less than valueTo} or an will be thrown when the view is laid out.
- android:valueTo}: **Required.** The slider's maximum value. This attribute must be greater than valueFrom} or an will be thrown when the view is laid out.
- android:value}: **Optional.** The initial value of the slider. If not specified, the slider's minimum value android:valueFrom} is used.
- android:stepSize}: **Optional.** This value dictates whether the slider operates in continuous mode, or in discrete mode. If missing or equal to 0, the slider operates in continuous mode. If greater than 0 and evenly divides the range described by \*valueFrom and valueTo}, the slider operates in discrete mode. If negative an \* is thrown, or if greater than 0 but not a factor of the range described by valueFrom} and valueTo}, an will be thrown when the view is laid out.

`app:values`: **Optional.** The initial values of the range slider. If not specified, the range slider will only have one value equal to `android:valueFrom`

`app:minSeparation`: **Optional.** The minimum distance between two thumbs that would otherwise overlap.

For more information, see the [component developer guidance](https://github.com/material-components/material-components-android/blob/master/docs/components/Slider.md) and [design guidelines](https://material.io/components/sliders/overview).

ref com.google.android.material.R.styleable#RangeSlider_values

ref com.google.android.material.R.styleable#RangeSlider_minSeparation

## Summary

| ### Nested types |
|---|
| `public interface https://developer.android.com/reference/com/google/android/material/slider/RangeSlider.OnChangeListener` Interface definition for a callback invoked when a slider's value is changed. |
| `public interface https://developer.android.com/reference/com/google/android/material/slider/RangeSlider.OnSliderTouchListener` Interface definition for a callback invoked when a slider's value is changed. |

| ### Public fields |
|---|---|
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#continuousModeTickCount()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#haloRadius()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#labelBehavior()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#minSeparation()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#stepSize()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#thumbElevation()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#thumbHeight()` |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#thumbStrokeColor()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#thumbStrokeWidth()` |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#thumbTintList()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#thumbTrackGapSize()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#thumbWidth()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#tickActiveRadius()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#tickInactiveRadius()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#tickVisibilityMode()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#trackCornerSize()` |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#trackIconActiveColor()` |
| `Drawable` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#trackIconActiveEnd()` |
| `Drawable` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#trackIconActiveStart()` |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#trackIconInactiveColor()` |
| `Drawable` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#trackIconInactiveEnd()` |
| `Drawable` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#trackIconInactiveStart()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#trackIconSize()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#trackInsideCornerSize()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#trackSidePadding()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#trackStopIndicatorSize()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#trackWidth()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#valueFrom()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#valueTo()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#RangeSlider(Context)(Context context)` |
| `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#RangeSlider(Context,AttributeSet)(Context context, AttributeSet attrs)` |
| `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#RangeSlider(Context,AttributeSet,int)(Context context, AttributeSet attrs, int defStyleAttr)` |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#addOnChangeListener(L)(L listener)` Registers a callback to be invoked when the slider changes. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#addOnSliderTouchListener(T)(T listener)` Registers a callback to be invoked when the slider touch event is being started or stopped |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#clearOnChangeListeners()()` Removes all instances of attached to this slider |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#clearOnSliderTouchListeners()()` Removes all instances of touch listeners attached to this slider |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#dispatchHoverEvent(MotionEvent)(MotionEvent event)` |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#dispatchKeyEvent(KeyEvent)(KeyEvent event)` |
| `https://developer.android.com/reference/java/lang/CharSequence` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getAccessibilityClassName()()` |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getActiveThumbIndex()()` Returns the index of the currently active thumb, or -1 if no thumb is active |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getContinuousModeTickCount()()` Returns the tick count used in continuous mode. |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getFocusedThumbIndex()()` Returns the index of the currently focused thumb |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getHaloRadius()()` Returns the radius of the halo. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getHaloTintList()()` Returns the color of the halo. |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getLabelBehavior()()` Returns the `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider.LabelBehavior` used. |
| `float` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getMinSeparation()()` Returns the minimum separation between two thumbs |
| `float` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getStepSize()()` Returns the step size used to mark the ticks. |
| `float` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getThumbElevation()()` Returns the elevation of the thumb. |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getThumbHeight()()` Returns the height of the thumb. |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getThumbRadius()()` Returns the radius of the thumb. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getThumbStrokeColor()()` Gets the stroke color for the thumb. |
| `float` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getThumbStrokeWidth()()` Gets the stroke width for the thumb |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getThumbTintList()()` Returns the color of the thumb. |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getThumbTrackGapSize()()` Returns the size of the gap between the thumb and the track. |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getThumbWidth()()` Returns the width of the thumb. |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTickActiveRadius()()` Returns the radius of the active tick in pixels. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTickActiveTintList()()` Returns the color of the ticks on the active portion of the track. |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTickInactiveRadius()()` Returns the radius of the inactive tick in pixels. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTickInactiveTintList()()` Returns the color of the ticks on the inactive portion of the track. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTickTintList()()` Returns the color of the tick if the active and inactive parts aren't different. |
| `int` | `@https://developer.android.com/reference/com/google/android/material/slider/TickVisibilityMode https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTickVisibilityMode()()` Returns the current tick visibility mode. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTrackActiveTintList()()` Returns the color of the active portion of the track. |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTrackCornerSize()()` Returns the corner size on the outside of the track. |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTrackHeight()()` Returns the height of the track in pixels. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTrackIconActiveColor()()` Gets the active track icon color shown, if present. |
| `Drawable` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTrackIconActiveEnd()()` Gets the active track end icon shown, if present. |
| `Drawable` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTrackIconActiveStart()()` Gets the active track start icon shown, if present. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTrackIconInactiveColor()()` Gets the inactive track icon color shown, if present. |
| `Drawable` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTrackIconInactiveEnd()()` Gets the inactive track end icon shown, if present. |
| `Drawable` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTrackIconInactiveStart()()` Gets the inactive track start icon shown, if present. |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTrackIconSize()()` Gets the track icons size shown, if present. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTrackInactiveTintList()()` Returns the color of the inactive portion of the track. |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTrackInsideCornerSize()()` Returns the corner size on the inside of the track (visible with gap). |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTrackSidePadding()()` Returns the side padding of the track. |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTrackStopIndicatorSize()()` Returns the size of the stop indicator at the edges of the track. |
| `ColorStateList` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTrackTintList()()` Returns the color of the track if the active and inactive parts aren't different. |
| `int` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getTrackWidth()()` Returns the width of the track in pixels. |
| `float` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getValueFrom()()` Returns the slider's `valueFrom` value. |
| `float` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getValueTo()()` Returns the slider's `valueTo` value. |
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/Float>` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getValues()()` Returns current values of the slider thumbs. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#hasLabelFormatter()()` Returns `true` if the slider has a `https://developer.android.com/reference/com/google/android/material/slider/LabelFormatter` attached, `false` otherwise. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#isCentered()()` |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#isTickVisible()()` Returns whether the tick marks are visible. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#isVertical()()` |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo)(AccessibilityNodeInfo info)` |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#onKeyDown(int,KeyEvent)(int keyCode, KeyEvent event)` |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#onKeyUp(int,KeyEvent)(int keyCode, KeyEvent event)` |
| `Parcelable` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#onSaveInstanceState()()` |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#onTouchEvent(MotionEvent)(MotionEvent event)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#onVisibilityAggregated(boolean)(boolean isVisible)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#removeOnChangeListener(L)(L listener)` Removes a callback for value changes from this slider. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#removeOnSliderTouchListener(T)(T listener)` Removes a callback to be invoked when the slider touch event is being started or stopped |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#scheduleTooltipTimeout()()` |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setCentered(boolean)(boolean isCentered)` Sets the slider to be in centered configuration, meaning the starting value is positioned in the middle of the slider. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setContinuousModeTickCount(int)(int continuousModeTickCount)` Sets the number of ticks to display in continuous mode. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setCustomThumbDrawable(Drawable)(Drawable drawable)` Sets the custom thumb drawable which will be used for all value positions. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setCustomThumbDrawable(int)(int drawableResId)` Sets the custom thumb drawable which will be used for all value positions. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setCustomThumbDrawablesForValues(int...)(int[] drawableResIds)` Sets custom thumb drawables. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setCustomThumbDrawablesForValues(Drawable...)(Drawable[] drawables)` Sets custom thumb drawables. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setEnabled(boolean)(boolean enabled)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setFocusedThumbIndex(int)(int index)` Sets the index of the currently focused thumb |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setHaloRadius(int)(int radius)` Sets the radius of the halo in pixels. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setHaloRadiusResource(int)(int radius)` Sets the radius of the halo from a dimension resource. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setHaloTintList(ColorStateList)(ColorStateList haloColor)` Sets the color of the halo. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setLabelBehavior(int)(int labelBehavior)` Determines the `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider.LabelBehavior` used. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setLabelFormatter(com.google.android.material.slider.LabelFormatter)(https://developer.android.com/reference/com/google/android/material/slider/LabelFormatter formatter)` Registers a `https://developer.android.com/reference/com/google/android/material/slider/LabelFormatter` to be used to format the value displayed in the bubble shown when the slider operates in discrete mode. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setMinSeparation(float)(float minSeparation)` Sets the minimum separation between two thumbs |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setMinSeparationValue(float)(float minSeparation)` Sets the minimum separation in the value scale. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setOrientation(int)(@https://developer.android.com/reference/com/google/android/material/slider/BaseSlider.Orientation int orientation)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setStepSize(float)(float stepSize)` Sets the step size to use to mark the ticks. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setThumbElevation(float)(float elevation)` Sets the elevation of the thumb. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setThumbElevationResource(int)(int elevation)` Sets the elevation of the thumb from a dimension resource. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setThumbHeight(int)(int height)` Sets the height of the thumb in pixels. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setThumbHeightResource(int)(int height)` Sets the height of the thumb from a dimension resource. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setThumbRadius(int)(int radius)` Sets the radius of the thumb in pixels. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setThumbRadiusResource(int)(int radius)` Sets the radius of the thumb from a dimension resource. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setThumbStrokeColor(ColorStateList)(ColorStateList thumbStrokeColor)` Sets the stroke color for the thumbs. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setThumbStrokeColorResource(int)(int thumbStrokeColorResourceId)` Sets the stroke color resource for the thumbs. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setThumbStrokeWidth(float)(float thumbStrokeWidth)` Sets the stroke width for the thumb. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setThumbStrokeWidthResource(int)(int thumbStrokeWidthResourceId)` Sets the stroke width dimension resource for the thumb.Both thumbStroke color and thumbStroke width must be set for a stroke to be drawn. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setThumbTintList(ColorStateList)(ColorStateList thumbColor)` Sets the color of the thumb. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setThumbTrackGapSize(int)(int thumbTrackGapSize)` Sets the size of the gap between the thumb and the track. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setThumbWidth(int)(int width)` Sets the width of the thumb in pixels. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setThumbWidthResource(int)(int width)` Sets the width of the thumb from a dimension resource. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTickActiveRadius(int)(int tickActiveRadius)` Set the radius of the active tick in pixels. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTickActiveTintList(ColorStateList)(ColorStateList tickColor)` Sets the color of the ticks on the active portion of the track. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTickInactiveRadius(int)(int tickInactiveRadius)` Set the radius of the inactive tick in pixels. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTickInactiveTintList(ColorStateList)(ColorStateList tickColor)` Sets the color of the ticks on the inactive portion of the track. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTickTintList(ColorStateList)(ColorStateList tickColor)` Sets the color of the tick marks. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTickVisibilityMode(int)(@https://developer.android.com/reference/com/google/android/material/slider/TickVisibilityMode int tickVisibilityMode)` Sets the tick visibility mode. |
| `void` | `[setTickVisible](https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTickVisible(boolean))(boolean tickVisible)` **This method is deprecated.** Use `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTickVisibilityMode(int)` instead. <br /> |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTrackActiveTintList(ColorStateList)(ColorStateList trackColor)` Sets the color of the active portion of the track. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTrackCornerSize(int)(int cornerSize)` Sets the corner size on the outside of the track. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTrackHeight(int)(int trackHeight)` Set the height of the track in pixels. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTrackIconActiveColor(ColorStateList)(ColorStateList color)` Sets the active track icon color. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTrackIconActiveEnd(Drawable)(Drawable icon)` Sets the active track end icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTrackIconActiveEnd(int)(int iconResourceId)` Sets the active track end icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTrackIconActiveStart(Drawable)(Drawable icon)` Sets the active track start icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTrackIconActiveStart(int)(int iconResourceId)` Sets the active track start icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTrackIconInactiveColor(ColorStateList)(ColorStateList color)` Sets the inactive track icon color. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTrackIconInactiveEnd(Drawable)(Drawable icon)` Sets the inactive track end icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTrackIconInactiveEnd(int)(int iconResourceId)` Sets the inactive track end icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTrackIconInactiveStart(Drawable)(Drawable icon)` Sets the inactive track start icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTrackIconInactiveStart(int)(int iconResourceId)` Sets the inactive track start icon. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTrackIconSize(int)(int size)` Sets the track icons size. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTrackInactiveTintList(ColorStateList)(ColorStateList trackColor)` Sets the color of the inactive portion of the track. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTrackInsideCornerSize(int)(int cornerSize)` Sets the corner size on the inside of the track (visible with gap). |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTrackStopIndicatorSize(int)(int trackStopIndicatorSize)` Sets the size of the stop indicator at the edges of the track. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTrackTintList(ColorStateList)(ColorStateList trackColor)` Sets the color of the track. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setValueFrom(float)(float valueFrom)` Sets the slider's `valueFrom` value. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setValueTo(float)(float valueTo)` Sets the slider's `valueTo` value. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setValues(java.lang.Float...)(Float[] values)` Sets multiple values for the slider. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setValues(java.util.List<java.lang.Float>)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/Float> values)` Sets multiple values for the slider. |

| ### Protected methods |
|---|---|
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#drawableStateChanged()()` |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#onAttachedToWindow()()` |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#onDetachedFromWindow()()` |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#onDraw(Canvas)(Canvas canvas)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#onFocusChanged(boolean,int,Rect)( boolean gainFocus, int direction, Rect previouslyFocusedRect )` |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#onLayout(boolean,int,int,int,int)(boolean changed, int left, int top, int right, int bottom)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#onMeasure(int,int)(int widthMeasureSpec, int heightMeasureSpec)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#onRestoreInstanceState(Parcelable)(Parcelable state)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#onSizeChanged(int,int,int,int)(int w, int h, int oldw, int oldh)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#onVisibilityChanged(View,int)(View changedView, int visibility)` |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#pickActiveThumb()()` Tries to pick the active thumb if one hasn't already been set. |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setActiveThumbIndex(int)(int index)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setSeparationUnit(int)(int separationUnit)` |

## Public fields

### continuousModeTickCount

```
public int continuousModeTickCount
```

### haloRadius

```
public int haloRadius
```

### labelBehavior

```
public int labelBehavior
```

### minSeparation

```
public float minSeparation
```

### stepSize

```
public float stepSize
```

### thumbElevation

```
public float thumbElevation
```

### thumbHeight

```
public int thumbHeight
```

### thumbStrokeColor

```
public ColorStateList thumbStrokeColor
```

### thumbStrokeWidth

```
public float thumbStrokeWidth
```

### thumbTintList

```
public ColorStateList thumbTintList
```

### thumbTrackGapSize

```
public int thumbTrackGapSize
```

### thumbWidth

```
public int thumbWidth
```

### tickActiveRadius

```
public int tickActiveRadius
```

### tickInactiveRadius

```
public int tickInactiveRadius
```

### tickVisibilityMode

```
public int tickVisibilityMode
```

### trackCornerSize

```
public int trackCornerSize
```

### trackIconActiveColor

```
public ColorStateList trackIconActiveColor
```

### trackIconActiveEnd

```
public Drawable trackIconActiveEnd
```

### trackIconActiveStart

```
public Drawable trackIconActiveStart
```

### trackIconInactiveColor

```
public ColorStateList trackIconInactiveColor
```

### trackIconInactiveEnd

```
public Drawable trackIconInactiveEnd
```

### trackIconInactiveStart

```
public Drawable trackIconInactiveStart
```

### trackIconSize

```
public int trackIconSize
```

### trackInsideCornerSize

```
public int trackInsideCornerSize
```

### trackSidePadding

```
public int trackSidePadding
```

### trackStopIndicatorSize

```
public int trackStopIndicatorSize
```

### trackWidth

```
public int trackWidth
```

### valueFrom

```
public float valueFrom
```

### valueTo

```
public float valueTo
```

## Public constructors

### RangeSlider

```
public RangeSlider(Context context)
```

### RangeSlider

```
public RangeSlider(Context context, AttributeSet attrs)
```

### RangeSlider

```
public RangeSlider(Context context, AttributeSet attrs, int defStyleAttr)
```

## Public methods

### addOnChangeListener

```
public void addOnChangeListener(L listener)
```

Registers a callback to be invoked when the slider changes. On the RangeSlider implementation, the listener is invoked once for each value.

| Parameters |
|---|---|
| `L listener` | The callback to run when the slider changes |

### addOnSliderTouchListener

```
public void addOnSliderTouchListener(T listener)
```

Registers a callback to be invoked when the slider touch event is being started or stopped

| Parameters |
|---|---|
| `T listener` | The callback to run when the slider starts or stops being touched |

### clearOnChangeListeners

```
public void clearOnChangeListeners()
```

Removes all instances of attached to this slider

### clearOnSliderTouchListeners

```
public void clearOnSliderTouchListeners()
```

Removes all instances of touch listeners attached to this slider

### dispatchHoverEvent

```
public boolean dispatchHoverEvent(MotionEvent event)
```

### dispatchKeyEvent

```
public boolean dispatchKeyEvent(KeyEvent event)
```

### getAccessibilityClassName

```
public CharSequence getAccessibilityClassName()
```

### getActiveThumbIndex

```
public int getActiveThumbIndex()
```

Returns the index of the currently active thumb, or -1 if no thumb is active

### getContinuousModeTickCount

```
public int getContinuousModeTickCount()
```

Returns the tick count used in continuous mode.

ref com.google.android.material.R.styleable#Slider_continuousModeTickCount

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setContinuousModeTickCount(int)` |   |

### getFocusedThumbIndex

```
public int getFocusedThumbIndex()
```

Returns the index of the currently focused thumb

### getHaloRadius

```
public int getHaloRadius()
```

Returns the radius of the halo.

ref com.google.android.material.R.styleable#Slider_haloRadius

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setHaloRadius(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setHaloRadiusResource(int)` |   |

### getHaloTintList

```
public ColorStateList getHaloTintList()
```

Returns the color of the halo.

ref com.google.android.material.R.styleable#Slider_haloColor

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setHaloTintList(ColorStateList)` |   |

### getLabelBehavior

```
public int getLabelBehavior()
```

Returns the `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider.LabelBehavior` used.

ref com.google.android.material.R.styleable#Slider_labelBehavior

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setLabelBehavior(int)` |   |

### getMinSeparation

```
public float getMinSeparation()
```

Returns the minimum separation between two thumbs

ref com.google.android.material.R.styleable#RangeSlider_minSeparation

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setMinSeparation(float)` |   |

### getStepSize

```
public float getStepSize()
```

Returns the step size used to mark the ticks.

A step size of 0 means that the slider is operating in continuous mode. A step size greater than 0 means that the slider is operating in discrete mode.

ref com.google.android.material.R.styleable#Slider_android_stepSize

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setStepSize(float)` |   |

### getThumbElevation

```
public float getThumbElevation()
```

Returns the elevation of the thumb.

ref com.google.android.material.R.styleable#Slider_thumbElevation

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setThumbElevation(float)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setThumbElevationResource(int)` |   |

### getThumbHeight

```
public int getThumbHeight()
```

Returns the height of the thumb. Note that setting this will also affect custom drawables set through `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawable(int)`, `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawable(Drawable)`, `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawablesForValues(int...)`, and `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawablesForValues(Drawable...)`.

ref com.google.android.material.R.styleable#Slider_thumbHeight

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setThumbHeight(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setThumbHeightResource(int)` |   |

### getThumbRadius

```
public int getThumbRadius()
```

Returns the radius of the thumb. Note that setting this will also affect custom drawables set through `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawable(int)`, `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawable(Drawable)`, `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawablesForValues(int...)`, and `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawablesForValues(Drawable...)`.

ref com.google.android.material.R.styleable#Slider_thumbRadius

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setThumbRadius(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setThumbRadiusResource(int)` |   |

### getThumbStrokeColor

```
public ColorStateList getThumbStrokeColor()
```

Gets the stroke color for the thumb.

ref com.google.android.material.R.styleable#Slider_thumbStrokeColor

| Returns |
|---|---|
| `ColorStateList` | The color used for the stroke in the thumb. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setThumbStrokeColor(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setThumbStrokeColorResource(int)` |   |

### getThumbStrokeWidth

```
public float getThumbStrokeWidth()
```

Gets the stroke width for the thumb

ref com.google.android.material.R.styleable#Slider_thumbStrokeWidth

| Returns |
|---|---|
| `float` | Stroke width for the thumb. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setThumbStrokeWidth(float)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setThumbStrokeWidthResource(int)` |   |

### getThumbTintList

```
public ColorStateList getThumbTintList()
```

Returns the color of the thumb.

ref com.google.android.material.R.styleable#Slider_thumbColor

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setThumbTintList(ColorStateList)` |   |

### getThumbTrackGapSize

```
public int getThumbTrackGapSize()
```

Returns the size of the gap between the thumb and the track.

ref com.google.android.material.R.styleable#Slider_thumbTrackGapSize

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setThumbTrackGapSize(int)` |   |

### getThumbWidth

```
public int getThumbWidth()
```

Returns the width of the thumb. Note that setting this will also affect custom drawables set through `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawable(int)`, `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawable(Drawable)`, `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawablesForValues(int...)`, and `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawablesForValues(Drawable...)`.

ref com.google.android.material.R.styleable#Slider_thumbWidth

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setThumbWidth(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setThumbWidthResource(int)` |   |

### getTickActiveRadius

```
public int getTickActiveRadius()
```

Returns the radius of the active tick in pixels.

ref com.google.android.material.R.styleable#Slider_activeTickRadius

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTickActiveRadius(int)` |   |

### getTickActiveTintList

```
public ColorStateList getTickActiveTintList()
```

Returns the color of the ticks on the active portion of the track.

ref com.google.android.material.R.styleable#Slider_tickColorActive

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTickActiveTintList(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTickTintList(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTickTintList()` |   |

### getTickInactiveRadius

```
public int getTickInactiveRadius()
```

Returns the radius of the inactive tick in pixels.

ref com.google.android.material.R.styleable#Slider_inactiveTickRadius

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTickInactiveRadius(int)` |   |

### getTickInactiveTintList

```
public ColorStateList getTickInactiveTintList()
```

Returns the color of the ticks on the inactive portion of the track.

ref com.google.android.material.R.styleable#Slider_tickColorInactive

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTickInactiveTintList(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTickTintList(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTickTintList()` |   |

### getTickTintList

```
public ColorStateList getTickTintList()
```

Returns the color of the tick if the active and inactive parts aren't different.

ref com.google.android.material.R.styleable#Slider_tickColor

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If `tickColorActive` and `tickColorInactive` have been set to different values. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTickTintList(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTickInactiveTintList(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTickActiveTintList(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTickInactiveTintList()` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTickActiveTintList()` |   |

### getTickVisibilityMode

```
@TickVisibilityMode
public int getTickVisibilityMode()
```

Returns the current tick visibility mode.

ref com.google.android.material.R.styleable#Slider_tickVisibilityMode

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTickVisibilityMode(int)` |   |

### getTrackActiveTintList

```
public ColorStateList getTrackActiveTintList()
```

Returns the color of the active portion of the track.

ref com.google.android.material.R.styleable#Slider_trackColorActive

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackActiveTintList(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackTintList(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackTintList()` |   |

### getTrackCornerSize

```
public int getTrackCornerSize()
```

Returns the corner size on the outside of the track.

ref com.google.android.material.R.styleable#Slider_trackCornerSize

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackCornerSize(int)` |   |

### getTrackHeight

```
public int getTrackHeight()
```

Returns the height of the track in pixels.

ref com.google.android.material.R.styleable#Slider_trackHeight

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackHeight(int)` |   |

### getTrackIconActiveColor

```
public ColorStateList getTrackIconActiveColor()
```

Gets the active track icon color shown, if present.

ref com.google.android.material.R.styleable#Slider_trackIconActiveColor

| Returns |
|---|---|
| `ColorStateList` | Color of the icon shown for this active track, if present. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackIconActiveColor(ColorStateList)` |   |

### getTrackIconActiveEnd

```
public Drawable getTrackIconActiveEnd()
```

Gets the active track end icon shown, if present.

ref com.google.android.material.R.styleable#Slider_trackIconActiveEnd

| Returns |
|---|---|
| `Drawable` | End icon shown for this active track, if present. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackIconActiveEnd(Drawable)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackIconActiveEnd(int)` |   |

### getTrackIconActiveStart

```
public Drawable getTrackIconActiveStart()
```

Gets the active track start icon shown, if present.

ref com.google.android.material.R.styleable#Slider_trackIconActiveStart

| Returns |
|---|---|
| `Drawable` | Start icon shown for this active track, if present. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackIconActiveStart(Drawable)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackIconActiveStart(int)` |   |

### getTrackIconInactiveColor

```
public ColorStateList getTrackIconInactiveColor()
```

Gets the inactive track icon color shown, if present.

ref com.google.android.material.R.styleable#Slider_trackIconInactiveColor

| Returns |
|---|---|
| `ColorStateList` | Color of the icon shown for this inactive track, if present. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackIconInactiveColor(ColorStateList)` |   |

### getTrackIconInactiveEnd

```
public Drawable getTrackIconInactiveEnd()
```

Gets the inactive track end icon shown, if present.

ref com.google.android.material.R.styleable#Slider_trackIconInactiveEnd

| Returns |
|---|---|
| `Drawable` | End icon shown for this inactive track, if present. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackIconInactiveEnd(Drawable)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackIconInactiveEnd(int)` |   |

### getTrackIconInactiveStart

```
public Drawable getTrackIconInactiveStart()
```

Gets the inactive track start icon shown, if present.

ref com.google.android.material.R.styleable#Slider_trackIconInactiveStart

| Returns |
|---|---|
| `Drawable` | Start icon shown for this inactive track, if present. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackIconInactiveStart(Drawable)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackIconInactiveStart(int)` |   |

### getTrackIconSize

```
public int getTrackIconSize()
```

Gets the track icons size shown, if present.

ref com.google.android.material.R.styleable#Slider_trackIconSize

| Returns |
|---|---|
| `int` | Size of the icons shown for this track, if present. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackIconSize(int)` |   |

### getTrackInactiveTintList

```
public ColorStateList getTrackInactiveTintList()
```

Returns the color of the inactive portion of the track.

ref com.google.android.material.R.styleable#Slider_trackColorInactive

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackInactiveTintList(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackTintList(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackTintList()` |   |

### getTrackInsideCornerSize

```
public int getTrackInsideCornerSize()
```

Returns the corner size on the inside of the track (visible with gap).

ref com.google.android.material.R.styleable#Slider_trackInsideCornerSize

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackInsideCornerSize(int)` |   |

### getTrackSidePadding

```
public int getTrackSidePadding()
```

Returns the side padding of the track.

### getTrackStopIndicatorSize

```
public int getTrackStopIndicatorSize()
```

Returns the size of the stop indicator at the edges of the track.

ref com.google.android.material.R.styleable#Slider_trackStopIndicatorSize

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackStopIndicatorSize(int)` |   |

### getTrackTintList

```
public ColorStateList getTrackTintList()
```

Returns the color of the track if the active and inactive parts aren't different.

ref com.google.android.material.R.styleable#Slider_trackColor

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If `trackColorActive` and `trackColorInactive` have been set to different values. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackTintList(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackInactiveTintList(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackActiveTintList(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackInactiveTintList()` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackActiveTintList()` |   |

### getTrackWidth

```
public int getTrackWidth()
```

Returns the width of the track in pixels.

### getValueFrom

```
public float getValueFrom()
```

Returns the slider's `valueFrom` value.

ref com.google.android.material.R.styleable#Slider_android_valueFrom

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setValueFrom(float)` |   |

### getValueTo

```
public float getValueTo()
```

Returns the slider's `valueTo` value.

ref com.google.android.material.R.styleable#Slider_android_valueTo

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setValueTo(float)` |   |

### getValues

```
public List<Float> getValues()
```

Returns current values of the slider thumbs.

### hasLabelFormatter

```
public boolean hasLabelFormatter()
```

Returns `true` if the slider has a `https://developer.android.com/reference/com/google/android/material/slider/LabelFormatter` attached, `false` otherwise.

### isCentered

```
public boolean isCentered()
```

### isTickVisible

```
public boolean isTickVisible()
```

Returns whether the tick marks are visible. Only used when the slider is in discrete mode.

ref com.google.android.material.R.styleable#Slider_tickVisible

### isVertical

```
public boolean isVertical()
```

### onInitializeAccessibilityNodeInfo

```
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info)
```

### onKeyDown

```
public boolean onKeyDown(int keyCode, KeyEvent event)
```

### onKeyUp

```
public boolean onKeyUp(int keyCode, KeyEvent event)
```

### onSaveInstanceState

```
public Parcelable onSaveInstanceState()
```

### onTouchEvent

```
public boolean onTouchEvent(MotionEvent event)
```

### onVisibilityAggregated

```
public void onVisibilityAggregated(boolean isVisible)
```

### removeOnChangeListener

```
public void removeOnChangeListener(L listener)
```

Removes a callback for value changes from this slider.

| Parameters |
|---|---|
| `L listener` | The callback that'll stop receive slider changes |

### removeOnSliderTouchListener

```
public void removeOnSliderTouchListener(T listener)
```

Removes a callback to be invoked when the slider touch event is being started or stopped

| Parameters |
|---|---|
| `T listener` | The callback that'll stop be notified when the slider is being touched |

### scheduleTooltipTimeout

```
public void scheduleTooltipTimeout()
```

### setCentered

```
public void setCentered(boolean isCentered)
```

Sets the slider to be in centered configuration, meaning the starting value is positioned in the middle of the slider.

ref com.google.android.material.R.styleable#Slider_centered

| Parameters |
|---|---|
| `boolean isCentered` | boolean to use for the slider's centered configuration. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#isCentered()` |   |

### setContinuousModeTickCount

```
public void setContinuousModeTickCount(int continuousModeTickCount)
```

Sets the number of ticks to display in continuous mode. Default is 0.

This allows for showing purely visual ticks in continuous mode.

Setting this value to a negative value will result in an `https://developer.android.com/reference/java/lang/IllegalArgumentException`.

ref com.google.android.material.R.styleable#Slider_continuousModeTickCount

| Parameters |
|---|---|
| `int continuousModeTickCount` | The number of ticks that must be drawn in continuous mode count |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | If the continuous mode tick count is less than 0 |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getContinuousModeTickCount()` |   |

### setCustomThumbDrawable

```
public void setCustomThumbDrawable(Drawable drawable)
```

Sets the custom thumb drawable which will be used for all value positions. Note that the custom drawable provided will be resized to match the thumb radius set by #setThumbRadius(int) or #setThumbRadiusResource(int). Be aware that the image quality may be compromised during resizing.

### setCustomThumbDrawable

```
public void setCustomThumbDrawable(int drawableResId)
```

Sets the custom thumb drawable which will be used for all value positions. Note that the custom drawable provided will be resized to match the thumb radius set by #setThumbRadius(int) or #setThumbRadiusResource(int). Be aware that the image quality may be compromised during resizing.

### setCustomThumbDrawablesForValues

```
public void setCustomThumbDrawablesForValues(int[] drawableResIds)
```

Sets custom thumb drawables. The drawables provided will be used in its corresponding value position - i.e., the first drawable will be used to indicate the first value, and so on. If the number of drawables is less than the number of values, the default drawable will be used for the remaining values.

Note that the custom drawables provided will be resized to match the thumb radius set by #setThumbRadius(int) or #setThumbRadiusResource(int). Be aware that the image quality may be compromised during resizing.

### setCustomThumbDrawablesForValues

```
public void setCustomThumbDrawablesForValues(Drawable[] drawables)
```

Sets custom thumb drawables. The drawables provided will be used in its corresponding value position - i.e., the first drawable will be used to indicate the first value, and so on. If the number of drawables is less than the number of values, the default drawable will be used for the remaining values.

Note that the custom drawables provided will be resized to match the thumb radius set by #setThumbRadius(int) or #setThumbRadiusResource(int). Be aware that the image quality may be compromised during resizing.

### setEnabled

```
public void setEnabled(boolean enabled)
```

### setFocusedThumbIndex

```
public void setFocusedThumbIndex(int index)
```

Sets the index of the currently focused thumb

### setHaloRadius

```
public void setHaloRadius(int radius)
```

Sets the radius of the halo in pixels.

ref com.google.android.material.R.styleable#Slider_haloRadius

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getHaloRadius()` |   |

### setHaloRadiusResource

```
public void setHaloRadiusResource(int radius)
```

Sets the radius of the halo from a dimension resource.

ref com.google.android.material.R.styleable#Slider_haloRadius

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getHaloRadius()` |   |

### setHaloTintList

```
public void setHaloTintList(ColorStateList haloColor)
```

Sets the color of the halo.

ref com.google.android.material.R.styleable#Slider_haloColor

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getHaloTintList()` |   |

### setLabelBehavior

```
public void setLabelBehavior(int labelBehavior)
```

Determines the `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider.LabelBehavior` used.

ref com.google.android.material.R.styleable#Slider_labelBehavior

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider.LabelBehavior` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getLabelBehavior()` |   |

### setLabelFormatter

```
public void setLabelFormatter(LabelFormatter formatter)
```

Registers a `https://developer.android.com/reference/com/google/android/material/slider/LabelFormatter` to be used to format the value displayed in the bubble shown when the slider operates in discrete mode.

| Parameters |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/LabelFormatter formatter` | The `https://developer.android.com/reference/com/google/android/material/slider/LabelFormatter` to use to format the bubble's text |

### setMinSeparation

```
public void setMinSeparation(float minSeparation)
```

Sets the minimum separation between two thumbs

ref com.google.android.material.R.styleable#RangeSlider_minSeparation

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | if used in conjunction with `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setStepSize(float)`, use `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setMinSeparationValue(float)` instead. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getMinSeparation()` |   |

### setMinSeparationValue

```
public void setMinSeparationValue(float minSeparation)
```

Sets the minimum separation in the value scale. Useful to create minimum ranges, between thumbs.

ref com.google.android.material.R.styleable#RangeSlider_minSeparation

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getMinSeparation()` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setMinSeparation(float)` |   |

### setOrientation

```
public void setOrientation(@BaseSlider.Orientation int orientation)
```

### setStepSize

```
public void setStepSize(float stepSize)
```

Sets the step size to use to mark the ticks.

Setting this value to 0 will make the slider operate in continuous mode. Setting this value to a number greater than 0 will make the slider operate in discrete mode.

The step size must evenly divide the range described by the `valueFrom` and `
valueTo`, it must be a factor of the range. If the step size is not a factor of the range, an `https://developer.android.com/reference/java/lang/IllegalStateException` will be thrown when this view is laid out.

Setting this value to a negative value will result in an `https://developer.android.com/reference/java/lang/IllegalArgumentException`.

ref com.google.android.material.R.styleable#Slider_android_stepSize

| Parameters |
|---|---|
| `float stepSize` | The interval value at which ticks must be drawn. Set to 0 to operate the slider in continuous mode and not have any ticks. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | If the step size is less than 0 |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getStepSize()` |   |

### setThumbElevation

```
public void setThumbElevation(float elevation)
```

Sets the elevation of the thumb.

ref com.google.android.material.R.styleable#Slider_thumbElevation

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getThumbElevation()` |   |

### setThumbElevationResource

```
public void setThumbElevationResource(int elevation)
```

Sets the elevation of the thumb from a dimension resource.

ref com.google.android.material.R.styleable#Slider_thumbElevation

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getThumbElevation()` |   |

### setThumbHeight

```
public void setThumbHeight(int height)
```

Sets the height of the thumb in pixels. Note that setting this will also affect custom drawables set through `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawable(int)`, `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawable(Drawable)`, `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawablesForValues(int...)`, and `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawablesForValues(Drawable...)`.

ref com.google.android.material.R.styleable#Slider_thumbHeight

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getThumbHeight()` |   |

### setThumbHeightResource

```
public void setThumbHeightResource(int height)
```

Sets the height of the thumb from a dimension resource. Note that setting this will also affect custom drawables set through `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawable(int)`, `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawable(Drawable)`, `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawablesForValues(int...)`, and `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawablesForValues(Drawable...)`.

ref com.google.android.material.R.styleable#Slider_thumbHeight

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getThumbHeight()` |   |

### setThumbRadius

```
public void setThumbRadius(int radius)
```

Sets the radius of the thumb in pixels. Note that setting this will also affect custom drawables set through `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawable(int)`, `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawable(Drawable)`, `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawablesForValues(int...)`, and `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawablesForValues(Drawable...)`.

ref com.google.android.material.R.styleable#Slider_thumbRadius

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getThumbRadius()` |   |

### setThumbRadiusResource

```
public void setThumbRadiusResource(int radius)
```

Sets the radius of the thumb from a dimension resource. Note that setting this will also affect custom drawables set through `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawable(int)`, `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawable(Drawable)`, `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawablesForValues(int...)`, and `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawablesForValues(Drawable...)`.

ref com.google.android.material.R.styleable#Slider_thumbRadius

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getThumbRadius()` |   |

### setThumbStrokeColor

```
public void setThumbStrokeColor(ColorStateList thumbStrokeColor)
```

Sets the stroke color for the thumbs. Both thumbStroke color and thumbStroke width must be set for a stroke to be drawn.

ref com.google.android.material.R.styleable#Slider_thumbStrokeColor

| Parameters |
|---|---|
| `ColorStateList thumbStrokeColor` | Color to use for the stroke in the thumbs. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setThumbStrokeColorResource(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getThumbStrokeColor()` |   |

### setThumbStrokeColorResource

```
public void setThumbStrokeColorResource(int thumbStrokeColorResourceId)
```

Sets the stroke color resource for the thumbs. Both thumbStroke color and thumbStroke width must be set for a stroke to be drawn.

ref com.google.android.material.R.styleable#Slider_thumbStrokeColor

| Parameters |
|---|---|
| `int thumbStrokeColorResourceId` | Color resource to use for the stroke. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setThumbStrokeColor(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getThumbStrokeColor()` |   |

### setThumbStrokeWidth

```
public void setThumbStrokeWidth(float thumbStrokeWidth)
```

Sets the stroke width for the thumb. Both thumbStroke color and thumbStroke width must be set for a stroke to be drawn.

ref com.google.android.material.R.styleable#Slider_thumbStrokeWidth

| Parameters |
|---|---|
| `float thumbStrokeWidth` | Stroke width for the thumb |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setThumbStrokeWidthResource(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getThumbStrokeWidth()` |   |

### setThumbStrokeWidthResource

```
public void setThumbStrokeWidthResource(int thumbStrokeWidthResourceId)
```

Sets the stroke width dimension resource for the thumb.Both thumbStroke color and thumbStroke width must be set for a stroke to be drawn.

ref com.google.android.material.R.styleable#Slider_thumbStrokeWidth

| Parameters |
|---|---|
| `int thumbStrokeWidthResourceId` | Stroke width dimension resource for the thumb |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setThumbStrokeWidth(float)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getThumbStrokeWidth()` |   |

### setThumbTintList

```
public void setThumbTintList(ColorStateList thumbColor)
```

Sets the color of the thumb.

ref com.google.android.material.R.styleable#Slider_thumbColor

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getThumbTintList()` |   |

### setThumbTrackGapSize

```
public void setThumbTrackGapSize(int thumbTrackGapSize)
```

Sets the size of the gap between the thumb and the track.

ref com.google.android.material.R.styleable#Slider_thumbTrackGapSize

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getThumbTrackGapSize()` |   |

### setThumbWidth

```
public void setThumbWidth(int width)
```

Sets the width of the thumb in pixels. Note that setting this will also affect custom drawables set through `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawable(int)`, `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawable(Drawable)`, `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawablesForValues(int...)`, and `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawablesForValues(Drawable...)`.

ref com.google.android.material.R.styleable#Slider_thumbWidth

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getThumbWidth()` |   |

### setThumbWidthResource

```
public void setThumbWidthResource(int width)
```

Sets the width of the thumb from a dimension resource. Note that setting this will also affect custom drawables set through `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawable(int)`, `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawable(Drawable)`, `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawablesForValues(int...)`, and `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setCustomThumbDrawablesForValues(Drawable...)`.

ref com.google.android.material.R.styleable#Slider_thumbWidth

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getThumbWidth()` |   |

### setTickActiveRadius

```
public void setTickActiveRadius(int tickActiveRadius)
```

Set the radius of the active tick in pixels.

ref com.google.android.material.R.styleable#Slider_activeTickRadius

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTickActiveRadius()` |   |

### setTickActiveTintList

```
public void setTickActiveTintList(ColorStateList tickColor)
```

Sets the color of the ticks on the active portion of the track.

ref com.google.android.material.R.styleable#Slider_tickColorActive

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTickActiveTintList()` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTickTintList(ColorStateList)` |   |

### setTickInactiveRadius

```
public void setTickInactiveRadius(int tickInactiveRadius)
```

Set the radius of the inactive tick in pixels.

ref com.google.android.material.R.styleable#Slider_inactiveTickRadius

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTickInactiveRadius()` |   |

### setTickInactiveTintList

```
public void setTickInactiveTintList(ColorStateList tickColor)
```

Sets the color of the ticks on the inactive portion of the track.

ref com.google.android.material.R.styleable#Slider_tickColorInactive

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTickInactiveTintList()` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTickTintList(ColorStateList)` |   |

### setTickTintList

```
public void setTickTintList(ColorStateList tickColor)
```

Sets the color of the tick marks.

ref com.google.android.material.R.styleable#Slider_tickColor

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTickInactiveTintList(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTickActiveTintList(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTickTintList()` |   |

### setTickVisibilityMode

```
public void setTickVisibilityMode(@TickVisibilityMode int tickVisibilityMode)
```

Sets the tick visibility mode. Only used when the slider is in discrete mode.

ref com.google.android.material.R.styleable#Slider_tickVisibilityMode

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTickVisibilityMode()` |   |

### setTickVisible

```
public void [setTickVisible](https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#setTickVisible(boolean))(boolean tickVisible)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTickVisibilityMode(int)` instead.

Sets whether the tick marks are visible. Only used when the slider is in discrete mode.

ref com.google.android.material.R.styleable#Slider_tickVisible

| Parameters |
|---|---|
| `boolean tickVisible` | The visibility of tick marks. |

### setTrackActiveTintList

```
public void setTrackActiveTintList(ColorStateList trackColor)
```

Sets the color of the active portion of the track.

ref com.google.android.material.R.styleable#Slider_trackColorActive

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackActiveTintList()` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackTintList(ColorStateList)` |   |

### setTrackCornerSize

```
public void setTrackCornerSize(int cornerSize)
```

Sets the corner size on the outside of the track.

ref com.google.android.material.R.styleable#Slider_trackCornerSize

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackCornerSize()` |   |

### setTrackHeight

```
public void setTrackHeight(int trackHeight)
```

Set the height of the track in pixels.

ref com.google.android.material.R.styleable#Slider_trackHeight

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackHeight()` |   |

### setTrackIconActiveColor

```
public void setTrackIconActiveColor(ColorStateList color)
```

Sets the active track icon color.

ref com.google.android.material.R.styleable#Slider_trackIconActiveColor

| Parameters |
|---|---|
| `ColorStateList color` | color to use for the active track's icon. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackIconActiveColor()` |   |

### setTrackIconActiveEnd

```
public void setTrackIconActiveEnd(Drawable icon)
```

Sets the active track end icon.

ref com.google.android.material.R.styleable#Slider_trackIconActiveEnd

| Parameters |
|---|---|
| `Drawable icon` | Drawable to use for the active track's end icon. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackIconActiveEnd(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackIconActiveEnd()` |   |

### setTrackIconActiveEnd

```
public void setTrackIconActiveEnd(int iconResourceId)
```

Sets the active track end icon.

ref com.google.android.material.R.styleable#Slider_trackIconActiveEnd

| Parameters |
|---|---|
| `int iconResourceId` | Drawable resource ID to use for the active track's end icon. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackIconActiveEnd(Drawable)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackIconActiveEnd()` |   |

### setTrackIconActiveStart

```
public void setTrackIconActiveStart(Drawable icon)
```

Sets the active track start icon.

ref com.google.android.material.R.styleable#Slider_trackIconActiveStart

| Parameters |
|---|---|
| `Drawable icon` | Drawable to use for the active track's start icon. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackIconActiveStart(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackIconActiveStart()` |   |

### setTrackIconActiveStart

```
public void setTrackIconActiveStart(int iconResourceId)
```

Sets the active track start icon.

ref com.google.android.material.R.styleable#Slider_trackIconActiveStart

| Parameters |
|---|---|
| `int iconResourceId` | Drawable resource ID to use for the active track's start icon. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackIconActiveStart(Drawable)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackIconActiveStart()` |   |

### setTrackIconInactiveColor

```
public void setTrackIconInactiveColor(ColorStateList color)
```

Sets the inactive track icon color.

ref com.google.android.material.R.styleable#Slider_trackIconInactiveColor

| Parameters |
|---|---|
| `ColorStateList color` | color to use for the inactive track's icon. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackIconInactiveColor()` |   |

### setTrackIconInactiveEnd

```
public void setTrackIconInactiveEnd(Drawable icon)
```

Sets the inactive track end icon.

ref com.google.android.material.R.styleable#Slider_trackIconInactiveEnd

| Parameters |
|---|---|
| `Drawable icon` | Drawable to use for the inactive track's end icon. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackIconInactiveEnd(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackIconInactiveEnd()` |   |

### setTrackIconInactiveEnd

```
public void setTrackIconInactiveEnd(int iconResourceId)
```

Sets the inactive track end icon.

ref com.google.android.material.R.styleable#Slider_trackIconInactiveEnd

| Parameters |
|---|---|
| `int iconResourceId` | Drawable resource ID to use for the inactive track's end icon. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackIconInactiveEnd(Drawable)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackIconInactiveEnd()` |   |

### setTrackIconInactiveStart

```
public void setTrackIconInactiveStart(Drawable icon)
```

Sets the inactive track start icon.

ref com.google.android.material.R.styleable#Slider_trackIconInactiveStart

| Parameters |
|---|---|
| `Drawable icon` | Drawable to use for the inactive track's start icon. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackIconInactiveStart(int)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackIconInactiveStart()` |   |

### setTrackIconInactiveStart

```
public void setTrackIconInactiveStart(int iconResourceId)
```

Sets the inactive track start icon.

ref com.google.android.material.R.styleable#Slider_trackIconInactiveStart

| Parameters |
|---|---|
| `int iconResourceId` | Drawable resource ID to use for the inactive track's start icon. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackIconInactiveStart(Drawable)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackIconInactiveStart()` |   |

### setTrackIconSize

```
public void setTrackIconSize(int size)
```

Sets the track icons size.

ref com.google.android.material.R.styleable#Slider_trackIconSize

| Parameters |
|---|---|
| `int size` | size to use for the track icons. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackIconSize()` |   |

### setTrackInactiveTintList

```
public void setTrackInactiveTintList(ColorStateList trackColor)
```

Sets the color of the inactive portion of the track.

ref com.google.android.material.R.styleable#Slider_trackColorInactive

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackInactiveTintList()` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackTintList(ColorStateList)` |   |

### setTrackInsideCornerSize

```
public void setTrackInsideCornerSize(int cornerSize)
```

Sets the corner size on the inside of the track (visible with gap).

ref com.google.android.material.R.styleable#Slider_trackInsideCornerSize

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackInsideCornerSize()` |   |

### setTrackStopIndicatorSize

```
public void setTrackStopIndicatorSize(int trackStopIndicatorSize)
```

Sets the size of the stop indicator at the edges of the track.

ref com.google.android.material.R.styleable#Slider_trackStopIndicatorSize

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackStopIndicatorSize()` |   |

### setTrackTintList

```
public void setTrackTintList(ColorStateList trackColor)
```

Sets the color of the track.

ref com.google.android.material.R.styleable#Slider_trackColor

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackInactiveTintList(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#setTrackActiveTintList(ColorStateList)` |   |
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getTrackTintList()` |   |

### setValueFrom

```
public void setValueFrom(float valueFrom)
```

Sets the slider's `valueFrom` value.

The `valueFrom` value must be strictly lower than the `valueTo` value. If that is not the case, an `https://developer.android.com/reference/java/lang/IllegalStateException` will be thrown when the view is laid out.

ref com.google.android.material.R.styleable#Slider_android_valueFrom

| Parameters |
|---|---|
| `float valueFrom` | The minimum value for the slider's range of values |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getValueFrom()` |   |

### setValueTo

```
public void setValueTo(float valueTo)
```

Sets the slider's `valueTo` value.

The `valueTo` value must be strictly greater than the `valueFrom` value. If that is not the case, an `https://developer.android.com/reference/java/lang/IllegalStateException` will be thrown when the view is laid out.

ref com.google.android.material.R.styleable#Slider_android_valueTo

| Parameters |
|---|---|
| `float valueTo` | The maximum value for the slider's range of values |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BaseSlider#getValueTo()` |   |

### setValues

```
public void setValues(Float[] values)
```

Sets multiple values for the slider. Each value will represent a different thumb.

Each value must be greater or equal to valueFrom}, and lesser or equal to \*valueTo. If that is not the case, an will be thrown when the view is laid out.

If the slider is in discrete mode (i.e. the tick increment value is greater than 0), the values must be set to a value falls on a tick (i.e.: value == valueFrom + x \* stepSize}, where x} is an integer equal to or greater than 0). If that is not the case, an \* will be thrown when the view is laid out.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getValues()` |   |

### setValues

```
public void setValues(List<Float> values)
```

Sets multiple values for the slider. Each value will represent a different thumb.

Each value must be greater or equal to valueFrom}, and lesser or equal to \*valueTo. If that is not the case, an will be thrown when the view is laid out.

If the slider is in discrete mode (i.e. the tick increment value is greater than 0), the values must be set to a value falls on a tick (i.e.: value == valueFrom + x \* stepSize}, where x} is an integer equal to or greater than 0). If that is not the case, an \* will be thrown when the view is laid out.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/RangeSlider#getValues()` |   |

## Protected methods

### drawableStateChanged

```
protected void drawableStateChanged()
```

### onAttachedToWindow

```
protected void onAttachedToWindow()
```

### onDetachedFromWindow

```
protected void onDetachedFromWindow()
```

### onDraw

```
protected void onDraw(Canvas canvas)
```

### onFocusChanged

```
protected void onFocusChanged(
    boolean gainFocus,
    int direction,
    Rect previouslyFocusedRect
)
```

### onLayout

```
protected void onLayout(boolean changed, int left, int top, int right, int bottom)
```

### onMeasure

```
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
```

### onRestoreInstanceState

```
protected void onRestoreInstanceState(Parcelable state)
```

### onSizeChanged

```
protected void onSizeChanged(int w, int h, int oldw, int oldh)
```

### onVisibilityChanged

```
protected void onVisibilityChanged(View changedView, int visibility)
```

### pickActiveThumb

```
protected boolean pickActiveThumb()
```

Tries to pick the active thumb if one hasn't already been set. This will pick the closest thumb if there is only one thumb under the touch position. If there is more than one thumb under the touch position, it will wait for enough drag left or right to determine which thumb to pick.

### setActiveThumbIndex

```
protected void setActiveThumbIndex(int index)
```

### setSeparationUnit

```
protected void setSeparationUnit(int separationUnit)
```