Make Target drawable methods nullable as per the Picasso Javadoc
@@ -187,14 +187,18 @@ class AvatarLoader @Inject constructor(context: Context) {
actionBar.setLogo(InsetDrawable(drawable, 0, 0, insetPx, 0))
}
- override fun onBitmapFailed(errorDrawable: Drawable) {
+ override fun onBitmapFailed(errorDrawable: Drawable?) {
+ if (errorDrawable != null) {
actionBar.setLogo(errorDrawable)
}
+ }
- override fun onPrepareLoad(placeHolderDrawable: Drawable) {
+ override fun onPrepareLoad(placeHolderDrawable: Drawable?) {
+ if (placeHolderDrawable != null) {
actionBar.setLogo(placeHolderDrawable)
}
}
+ }
inner class RoundedCornersTransformation : Transformation {
