mikaelzero / mojito

微信、bilibili大图、长图、gif、视频、自定义view的转场效果,The transition effect of wechat, bilibili large image, long image, GIF, video and custom view
Apache License 2.0
1.51k stars 164 forks source link

点击退出时,再次点击会崩溃 #104

Closed liuki2014 closed 2 years ago

liuki2014 commented 2 years ago

java.lang.NullPointerException at net.mikaelzero.mojito.ui.ImageMojitoFragment.getBinding(ImageMojitoFragment.kt:31) at net.mikaelzero.mojito.ui.ImageMojitoFragment.access$getBinding(ImageMojitoFragment.kt:29) at net.mikaelzero.mojito.ui.ImageMojitoFragment$onViewCreated$1.onTap(ImageMojitoFragment.kt:83) at net.mikaelzero.mojito.view.sketch.SketchContentLoaderImpl.onTapCallback$lambda-0(SketchContentLoaderImpl.kt:177) at net.mikaelzero.mojito.view.sketch.SketchContentLoaderImpl.$r8$lambda$MlNEU68Wvg8noLPyH_Nk0zVSZOM(Unknown Source:0) at net.mikaelzero.mojito.view.sketch.SketchContentLoaderImpl$$ExternalSyntheticLambda1.onViewTap(Unknown Source:2) at net.mikaelzero.mojito.view.sketch.core.zoom.TapHelper.onSingleTapConfirmed(TapHelper.java:56) at android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:329) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:210) at android.os.Looper.loop(Looper.java:299) at android.app.ActivityThread.main(ActivityThread.java:8085) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045)

mikaelzero commented 2 years ago

怎么个再次点击法? 是点击图片退出吗

liuki2014 commented 2 years ago

怎么再次点击法? 是点击图片退出吗?

点击图片退出时,在动画还没结束的情况下再点击下图片,会报空指针异常

NeVaDaAAA commented 2 years ago

我也遇到了该问题

SuperKung commented 2 years ago

目测只需要把点击监听里的binding.mojitoView.backToMin() 改成backToMin() 就可以了,作者看见了改一下吧,就这点东西懒得提pr了。