material-components-android icon indicating copy to clipboard operation
material-components-android copied to clipboard

[Slider] Added an option to allow a subset of tick marks in discrete mode

Open gabrielemariotti opened this issue 4 years ago • 3 comments

With this option you can use a subset of the tick marks in respect of stepSize attribute.

screen

Example:

  <com.google.android.material.slider.Slider
    android:valueFrom="0"
    android:valueTo="1000"
    android:stepSize="50"
    app:tickValues="@array/subset_tick_values" />

with:

  <array name="subset_tick_values">
    <item>0.0</item>
    <item>100</item>
    <item>250</item>
    <item>500</item>
    <item>750</item>
    <item>1000</item>
  </array>

video

The tickValues must contain values:

  • >= valueFrom
  • <= valueTo
  • = valueFrom + a multiple of stepSize

gabrielemariotti avatar Aug 04 '20 16:08 gabrielemariotti

Please, resolve conflicts and merge to master ASAP, this functionality is highly useful Thank you!

MaxMirren avatar Feb 10 '22 16:02 MaxMirren

Hi I'm not sure if the author is still actively working on the github. Please feel free to help them finish the commit and I'll be glad to review it. : )

drchen avatar Feb 10 '22 16:02 drchen

so no update on this?

AZKZero avatar Apr 18 '24 10:04 AZKZero