Commit 50b0ffbc authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Update DrawableHelper.kt

parent 2222849e
......@@ -13,9 +13,11 @@ object DrawableHelper {
* @param drawable The drawable to wrap.
* @see tintDrawable
*/
fun wrapDrawable(drawable: Drawable) {
fun wrapDrawable(drawable: Drawable?) {
if (drawable != null) {
DrawableCompat.wrap(drawable)
}
}
/**
* REMARK: You MUST always wrap the drawable before tint it.
......@@ -25,7 +27,9 @@ object DrawableHelper {
* @param resId The resource id color to tint the drawable.
* @see wrapDrawable
*/
fun tintDrawable(drawable: Drawable, context: Context, resId: Int) {
fun tintDrawable(drawable: Drawable?, context: Context, resId: Int) {
if (drawable != null) {
DrawableCompat.setTint(drawable, ContextCompat.getColor(context, resId))
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment