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

控件报错 #93

Closed 893193074 closed 2 years ago

893193074 commented 2 years ago

偶现的一次crash,后面刻意测试也无法复现。

class CustomCoverLoader : ActivityCoverLoader { lateinit var view: View

override fun attach(context: IMojitoActivity) {
    view = LayoutInflater.from(context.getContext())
        .inflate(R.layout.layout_cover, null)
    val close = view.findViewById<ImageView>(R.id.close)
    close.setOnClickListener {
        context.getCurrentFragment()?.backToMin()
    }
}

override fun providerView(): View {
    return view
}

override fun move(moveX: Float, moveY: Float) {

}

override fun pageChange(totalSize: Int, position: Int) {
}

override fun fingerRelease(isToMax: Boolean, isToMin: Boolean) {

}

}

------crash------

BOARD=EML CPU_ABI2= HOST=cn-west-3b-28f81ae491595390406091-865c478c76-qpxxc versionName=1.1.3.2(991) SUPPORTED_64_BIT_ABIS=[Ljava.lang.String;@fe4766f CPU_ABI=arm64-v8a PERMISSIONS_REVIEW_REQUIRED=true DISPLAY=EML-TL00 10.0.0.176(C01E175R1P4) SUPPORTED_ABIS=[Ljava.lang.String;@9366f7c FINGERPRINTEX=HUAWEI/EML-TL00/HWEML:10/HUAWEIEML-TL00/10.0.0.188C01:user/release-keys FINGERPRINT=HUAWEI/EML-TL00/HWEML:10/HUAWEIEML-TL00/10.0.0.176C01:user/release-keys PRODUCT=EML-TL00 ID=HUAWEIEML-TL00 HWFINGERPRINT=///EML-LGRP1-CHN 10.0.0.188/EML-TL00-CUST 10.0.0.186(C01)/EML-TL00-PRELOAD 10.0.0.5(C01R1)// TYPE=user SERIAL=unknown DEVICE=HWEML TIME=1595396463000 MODEL=EML-TL00 MANUFACTURER=HUAWEI USER=test versionCode=1131 BRAND=HUAWEI SUPPORTED_32_BIT_ABIS=[Ljava.lang.String;@289454e HARDWARE=kirin970 IS_DEBUGGABLE=false BOOTLOADER=unknown RADIO=unknown UNKNOWN=unknown IS_EMULATOR=false TAGS=release-keys java.lang.NullPointerException at net.mikaelzero.mojito.ui.ImageMojitoFragment.getBinding(ImageMojitoFragment.kt:31) at net.mikaelzero.mojito.ui.ImageMojitoFragment.backToMin(ImageMojitoFragment.kt:314) at com.yhtech.dfax.utils.mojito.CustomCoverLoader$attach$1.onClick(CustomCoverLoader.kt:18) at android.view.View.performClick(View.java:7192) at android.view.View.performClickInternal(View.java:7166) at android.view.View.access$3500(View.java:824) at android.view.View$PerformClick.run(View.java:27592) at android.os.Handler.handleCallback(Handler.java:888) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:213) at android.app.ActivityThread.main(ActivityThread.java:8178) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)

GuoYangGit commented 2 years ago

我这边同样遇到了该问题,请问解决了没有