From 0f264eb0ce5a556e9b5dc4d30ac36bff0497c012 Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 22 Oct 2019 19:13:46 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/widget/page/ContentTextView.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/page/ContentTextView.kt b/app/src/main/java/io/legado/app/ui/widget/page/ContentTextView.kt index ac444b4d6..df68b4cc5 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/ContentTextView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/ContentTextView.kt @@ -109,14 +109,11 @@ class ContentTextView : AppCompatTextView { @SuppressLint("ClickableViewAccessibility") override fun onTouchEvent(event: MotionEvent?): Boolean { event?.let { - val action = event.action - val vtEvent = MotionEvent.obtain(event) - if (velocityTracker == null) { velocityTracker = VelocityTracker.obtain() } velocityTracker?.addMovement(it) - when (action) { + when (event.action) { MotionEvent.ACTION_DOWN -> { setScrollState(scrollStateIdle) mLastTouchY = (event.y + 0.5f).toInt() @@ -159,7 +156,6 @@ class ContentTextView : AppCompatTextView { resetTouch() } } - vtEvent.recycle() } return super.onTouchEvent(event) }