Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when setting null drawable #171

Open
markusressel opened this issue Jun 29, 2020 · 1 comment
Open

Exception when setting null drawable #171

markusressel opened this issue Jun 29, 2020 · 1 comment
Labels

Comments

@markusressel
Copy link
Collaborator

markusressel commented Jun 29, 2020

Describe the bug

Setting a null drawable strangely causes the Drawables without intrinsic dimensions (such as a solid color) are not supported exception to trigger. It seems like passing a null value to the setImageDrawable function actually results in setting a BitmapDrawable, see screenshot below.

  • Library version: 1.8.0
  • Reproducible in official demo app: no
  • Device / Android version: OnePlus 6T API 29

To Reproduce

Steps to reproduce the behavior, possibly in the demo app:

  1. Open something using ZoomImageView
  2. use zoomImageView.setImageBitmap(null)
  3. See error

Expected behavior

Not sure, but I guess it should be possible to set a null image (simply show nothing at all).

Screenshots

image

Logs

    java.lang.IllegalArgumentException: Drawables without intrinsic dimensions (such as a solid color) are not supported
        at com.otaliastudios.zoom.ZoomImageView.setImageDrawable(ZoomImageView.kt:95)
        at android.widget.ImageView.setImageBitmap(ImageView.java:767)
        at de.markusressel.kodeeditor.library.view.CodeEditorLayout$updateMinimapImage$$inlined$apply$lambda$1.run(CodeEditorLayout.kt:409)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7682)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
@chubecode
Copy link

same here, I already try check null before using zoomImageView.setImageBitmap but the error still occur?
anything else can help ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants