I have a SeekBar
in my app and I want to change the colors of thumb and progressbar programmatically in my MainActivity
I know how to do it in XML:
android:thumbTint="@color/myColorTest"
android:progressDrawable="@color/myColorTest2"
But I want to implement this on SeekBar - onProgressChanged - to be able to change colors in realtime. I found some examples on how to do it - like this one - but they are all in Java (and I think they are deprecated).
I'm struggling on finding out the correct syntax in Kotlin for it.
Thank you!
Following David Kroukamp advice I run into this:
seekbar.getProgressDrawable().colorFilter(Color.RED, PorterDuff.Mode.SRC_IN)
seekbarr.getThumb().colorFilter(Color.RED, PorterDuff.Mode.SRC_IN)
Where colorFilter is in red warning "unresolved reference" colorFilter unresolver reference