0

I need to create a custom SeekBar, which can show two different values. My idea is, that dragging the thumb will change background color of whole seek bar (first value) and there will also be a white horizontal line, which will show the second value.

Custom Seekbar

Can you help me achieve this?

One of my thoughts was to use

mySeekBar.setProgressDrawable(dynamicalyCreatedDrawable);

but I hope there should be a better solution. If there is not, can you at least point me, how to dynamicaly draw an image/drawable to use it like this?

Komi
  • 330
  • 3
  • 13

1 Answers1

0

You can use:

mySeekBar.setProgress(value1); // for the thumb
mySeekBar.setSecondaryProgress(value2); // for the white line

where value1 and value2 are between 0 and max.

biegleux
  • 13,179
  • 11
  • 45
  • 52
Lulylulu
  • 1,254
  • 8
  • 17