Giphy / giphy-android-sdk

Home of the GIPHY SDK Android example app, along with Android SDK documentation, issue tracking, & release notes.
https://developers.giphy.com/
Mozilla Public License 2.0
94 stars 37 forks source link

Manually dragging GiphyDialogFragment to the very bottom of screen causes a crash #80

Closed cole-smith closed 3 years ago

cole-smith commented 4 years ago

Device experiencing bug: Google Pixel 4A, api 30 GIPHY SDK Version: 1.3.2

Triggered when manually dragging the uppermost part of the GiphyDialogFragment to the very bottom of the screen. If the GiphyDialogFragment swipes closed by itself at all then the error does not occur. I am calling the GDF from another fragment using the method shown in the Android SDK docs.

I am unsure if this occurs on iOS as well.

Causes the following error:

java.lang.IllegalArgumentException: height must be > 0
        at android.graphics.Bitmap.checkWidthHeight(Bitmap.java:453)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:874)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:836)
        at io.alterac.blurkit.BlurLayout.blur(BlurLayout.java:276)
        at io.alterac.blurkit.BlurLayout.invalidate(BlurLayout.java:164)
        at io.alterac.blurkit.BlurLayout.onSizeChanged(BlurLayout.java:158)
        at android.view.View.sizeChange(View.java:22654)
        at android.view.View.setFrame(View.java:22606)
        at android.view.View.layout(View.java:22463)
        at android.view.ViewGroup.layout(ViewGroup.java:6304)
        at androidx.constraintlayout.widget.ConstraintLayout.onLayout(ConstraintLayout.java:1695)
        at android.view.View.layout(View.java:22466)
        at android.view.ViewGroup.layout(ViewGroup.java:6304)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
        at android.view.View.layout(View.java:22466)
        at android.view.ViewGroup.layout(ViewGroup.java:6304)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
        at android.view.View.layout(View.java:22466)
        at android.view.ViewGroup.layout(ViewGroup.java:6304)
        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
        at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
        at android.view.View.layout(View.java:22466)
        at android.view.ViewGroup.layout(ViewGroup.java:6304)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
        at com.android.internal.policy.DecorView.onLayout(DecorView.java:779)
        at android.view.View.layout(View.java:22466)
        at android.view.ViewGroup.layout(ViewGroup.java:6304)
        at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3157)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2614)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1745)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7768)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:967)
        at android.view.Choreographer.doCallbacks(Choreographer.java:791)
        at android.view.Choreographer.doFrame(Choreographer.java:726)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:952)
        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:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
ALexanderLonsky commented 4 years ago

@cole-smith hey, thanks for raising this bug, indeed, I can reproduce and will look into it. For now I can suggest to disable blur (useBlurredBackground), it should avoid the crash.

colorgold commented 4 years ago

@ALexanderLonsky I disabled the blur. It does not crash for me. It just prevents me from searching GIFs.

ALexanderLonsky commented 3 years ago

BlurKit was removed from the SDK as of v2.1.1