From 8f55dcc8597b8149f1209fa8fc922435a193667b Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Sat, 10 Apr 2021 02:04:35 -0400 Subject: [PATCH] Fix gestureDectector on main crashing sometimes --- app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index 82531cd8be..a10b209845 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -95,7 +95,7 @@ open class MainActivity : BaseActivity(), DownloadServiceLi private set private var searchDrawable: Drawable? = null private var dismissDrawable: Drawable? = null - private lateinit var gestureDetector: GestureDetectorCompat + private var gestureDetector: GestureDetectorCompat? = null private var snackBar: Snackbar? = null private var extraViewForUndo: View? = null @@ -591,7 +591,7 @@ open class MainActivity : BaseActivity(), DownloadServiceLi } override fun dispatchTouchEvent(ev: MotionEvent?): Boolean { - gestureDetector.onTouchEvent(ev) + gestureDetector?.onTouchEvent(ev) if (ev?.action == MotionEvent.ACTION_DOWN) { if (snackBar != null && snackBar!!.isShown) { val sRect = Rect()