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

Update DrawableHelper.kt

parent 2222849e
...@@ -13,8 +13,10 @@ object DrawableHelper { ...@@ -13,8 +13,10 @@ object DrawableHelper {
* @param drawable The drawable to wrap. * @param drawable The drawable to wrap.
* @see tintDrawable * @see tintDrawable
*/ */
fun wrapDrawable(drawable: Drawable) { fun wrapDrawable(drawable: Drawable?) {
DrawableCompat.wrap(drawable) if (drawable != null) {
DrawableCompat.wrap(drawable)
}
} }
/** /**
...@@ -25,7 +27,9 @@ object DrawableHelper { ...@@ -25,7 +27,9 @@ object DrawableHelper {
* @param resId The resource id color to tint the drawable. * @param resId The resource id color to tint the drawable.
* @see wrapDrawable * @see wrapDrawable
*/ */
fun tintDrawable(drawable: Drawable, context: Context, resId: Int) { fun tintDrawable(drawable: Drawable?, context: Context, resId: Int) {
DrawableCompat.setTint(drawable, ContextCompat.getColor(context, resId)) 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