0

I've spent a few hours on a SeekBar and I was able to customize it accordingly, except that there is a pressed background that insists in using my primary color (colorAccent).

I'm attaching a few pictures so I hope you can understand what I mean. I've messed with all the SeekBar methods and with PorterDuff.MODE's, but no success so far.

Clicking and pressing Clicking and pressing

Clicking and pressing Clicking and pressing again

Normal state, not clicking Normal state, not clicking

Any help is appreciated!

Community
  • 1
  • 1
Teo Inke
  • 5,928
  • 4
  • 38
  • 37

1 Answers1

0

You can start from here and then develop your own:

XML

<app.minimize.com.seek_bar_compat.SeekBarCompat
    android:id="@+id/mySeekBar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:maxHeight="300sp"
    app:progressColor="#AFF123"
    app:progressBackgroundColor="#000"
    app:thumbColor="#FF4444"
    app:thumbAlpha="1.0"/>

you can also control it programmatically

SeekBarCompat seekBarCompat = (SeekBarCompat) findViewById(R.id.mySeekBar);
seekBarCompat.setThumbColor(Color.RED);
seekBarCompat.setProgressColor(Color.CYAN);
seekBarCompat.setProgressBackgroundColor(Color.BLUE); 
seekBarCompat.setThumbAlpha(128); //you can also set alpha value for the thumb

Don't forget to add the Dependecy

compile 'com.minimize.library:seekbar-compat:0.2.5'

I would also recommend you to visit This link for various styles of seekbars it is really helpful

Thorvald
  • 3,424
  • 6
  • 40
  • 66