0

I'm looking for something equivalent to MultiSlider's different colours for each bin feature but in the modern 'Materials Range Slider'. MultiSlider's example: MultiSlider's example (from https://github.com/apptik/MultiSlider)

However Multislider is no longer being maintained as of 2 years ago and I don't want to depend on unmaintained code.

I've looked at the xml attributes for the Range Slider and I don't see something that would accomplish this. (https://developer.android.com/reference/com/google/android/material/slider/RangeSlider)

Context: I have three percentage based inputs that are user defined. A range slider seemed to be the most efficient way of dealing with having these three percentages defined nicely (without worrying about rounding, having it all equal to 100%, dealing with users typing in stuff, etc).

  1. Is there a better way of dealing with three percentage based inputs then range sliders? If so, what is it?

  2. If not, is it possible to implement this idea with range sliders?

  3. If not, what third party libraries would you recommend?

Thanks in advance.

(It looks like this question comes closest, but if there is another solution besides 'make it yourself', that would be great, and if not, I'll make it myself then: Circular Progress bar with three different color in Android)

What I've tried:

  • Using Multislider: couldn't get it to build properly
  • Using Range Slider: can't seem to modify the colour of only one side of the track. There seems to only be 'active' track and 'inactive' track.
Helbino
  • 1
  • 2
  • See if you can simply set the background. See [this](https://stackoverflow.com/a/64444959/6287910). – Cheticamp Jan 20 '23 at 18:07
  • @Cheticamp I have been looking at that post and trying to extrapolate how I am supposed to apply that but I am a little lost as to the shader -> background link. I am working in XML for the slidebar. Am I understanding correctly that your objective would be to have me edit a colour of the 'background' track of slidebar? – Helbino Jan 26 '23 at 12:34
  • That's right: I suggested that you change the _RangeSlider's_ background programmatically. I took a look at the post I referenced, and there seems to have been a change since that post was made. The transition angle from one color to another use to be 90 degrees, or so it seemed. It is now slanted forward. Offhand, I don't know the fix for this. You may also be able to do something with a layer list and you could definitely do something with a custom drawable as the background. If i get a chance, I will take a look. – Cheticamp Jan 26 '23 at 15:23

0 Answers0