From 0917221b8375e9ba8d18892db97abd145aa4601d Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 12 May 2021 15:21:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/main/bookshelf/RootView.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/RootView.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/RootView.kt index 95ee7b755..4162e6e6e 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/RootView.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/RootView.kt @@ -19,7 +19,7 @@ class RootView : LinearLayout { constructor(context: Context) : super(context) constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) - private var touchSlop = 0 + private val touchSlop = ViewConfiguration.get(context).scaledTouchSlop private var initialX = 0f private var initialY = 0f @@ -28,10 +28,6 @@ class RootView : LinearLayout { private val childViewPager: View? get() = findViewById(R.id.view_pager_bookshelf) - init { - touchSlop = ViewConfiguration.get(context).scaledTouchSlop - } - private fun canChildScroll(orientation: Int, delta: Float): Boolean { val direction = -delta.sign.toInt() return when (orientation) {