Closed ahmedre closed 9 years ago
In the latest commit I pushed there is now full tinting support. You can apply tint in one of 2 ways:
app:backgroundTint
to MorphButton. This takes either a color ( eg. "#1E5FD6") or a color state list (defined in xml)//Assume you have a properly defined MorphButton
myMorphButton.setBackgroundTintList(ColorStateList.valueOf(Color.RED));
There is now also a setColorFilter()
method for fallback to drawables that still don't support tint but the implementation already takes care of this fallback for you, so it's best to just use setBackgroundTintList()
thanks @wnafee!
VectorDrawable and AnimatedVectorDrawable both support setColorFilter, but there's no easy way to apply the color filter to a MorphButton. This adds a method which proxies the setColorFilter calls to the respective drawables if they are set.