I'm trying to implement a discrete slider with fixed values, but the only thing I can set is the valueFrom, valueTo and stepSize.
Here is my code how I'm trying to do
<com.google.android.material.slider.Slider
android:id="@+id/slider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="8dp"
app:tickColor="@color/colorSecondaryLight"
app:tickColorActive="@color/colorSecondary" />
Is there a way to set fixed values on the slider? (Values that I will use 2, 5, 10, 25, 50 and 100)
The solution that worked for me was this lib called BubbleSeekBar
Step 1 - Add the dependencies on your Gradle.
Step 2 - Create your BubbleSeekBar on your XML and add the attributes that you need. For my case, the example below worked.
Step 3 - Since I needed custom options, I initialized on my onCreate with the array of values declared on my string.xml
Step 4 - You can capture the changes or set a value with the methods below.
The lib is pretty good and worked for me. For more info take a look at the link at the top of this answer.