Created
February 18, 2018 09:26
-
-
Save plnice/b8e117e12ea0fc9913de00e790922bac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun Drawable.tinted(@ColorInt tintColor: Int? = null, tintMode: PorterDuff.Mode = SRC_IN) = | |
apply { | |
setTintList(tintColor?.toColorStateList()) | |
setTintMode(tintMode) | |
} | |
private fun Int.toColorStateList() = ColorStateList.valueOf(this) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment