I want to use ElevationImageView for images I load from the network. The problem is that i get a crash in ElevationImageView.getBitmapFromDrawable if no drawable is currently on the ImageView. Logs:
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.draw(android.graphics.Canvas)' on a null object reference
at com.qhutch.elevationimageview.ElevationImageView.getBitmapFromDrawable(ElevationImageView.kt:167)
at com.qhutch.elevationimageview.ElevationImageView.generateShadow(ElevationImageView.kt:143)
at com.qhutch.elevationimageview.ElevationImageView.onDraw(ElevationImageView.kt:74)
Is there a way to have the shadow update/be creatd when setDrawable is called on the imageview?
I want to use ElevationImageView for images I load from the network. The problem is that i get a crash in
ElevationImageView.getBitmapFromDrawable
if no drawable is currently on the ImageView. Logs:Is there a way to have the shadow update/be creatd when
setDrawable
is called on the imageview?