Open jamie94bc opened 9 years ago
Ah yes, you're right with the keyboard increment.
How's this? :smile:
Also, for the programmatic color modification, we should use the same approach than the other methods. Also we should add set***Color methods receiving a ColorStateList too, just in case.
It would be better to remove the color commit from this original PR and open a different issue.
The setTrackColor
method uses the same approach as the existing setScrubberColor
method?
Oh, yes, didn't see that. We should add @AOrobator to that issue too, as he made the previous changes.
Ok, just leave the setTrackColor commit there and I'll add a new Issue to improve them.
@jamie94bc Can't you already set the track color programmatically? I made that change and am currently using it in an app I'm working on.
See DiscreteSeekBar.setScrubberColor(int), it has the same behavior. I think setTrackColor is a better name for it though, as it's a lot clearer with regards to what the function does. Maybe we deprecate setScrubberColor?
@AnderWeb What do you mean by same approach? What's the standard you want to set for changing a color?
@AOrobator no, the scrubber color is the "filled" part of the track, dependent on the current value.
Currently, all the drawables inherit from org.adw.library.widgets.discreteseekbar.internal.drawable.StateDrawable. This drawable uses a ColorStateList for the coloring (so devs can use different colors for pressed/focused/disabled/whatever). I was thinking on providing two setters for each component:
-setXXXColor(ColorStateList colorStateList)
This one would just set the ColorStateList to the drawable.
-setXXXColor(int color)
This one would work setting the drawable ColorStateList with ColorStateList.valueOf(color)
So no ColorFilters would be needed.
Originally, the mKeyProgressIncrement var was only used for keyboard tracking, and it's modified here. So if you set a manual step of 2 and then initiate a keyboard tracking event, the mStep var will be modified and we'll loose the specified value.
I think the proper way of doing this would need two separate variables for keyboard tracking (that the lib may need to modify for speed) and the touch tracking step.