diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt index 05fb0a0a1..1265c3ec2 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt @@ -1,11 +1,9 @@ package io.legado.app.ui.book.read.page -import android.annotation.SuppressLint import android.content.Context import android.graphics.Canvas import android.graphics.Paint import android.util.AttributeSet -import android.view.MotionEvent import android.view.View import io.legado.app.R import io.legado.app.constant.PreferKey @@ -51,12 +49,6 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at } } - @SuppressLint("ClickableViewAccessibility") - override fun onTouchEvent(event: MotionEvent?): Boolean { - - return true - } - override fun onDraw(canvas: Canvas) { super.onDraw(canvas) textPage?.let { textPage -> diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt index abc953046..4cb163900 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt @@ -211,7 +211,6 @@ abstract class PageDelegate(protected val pageView: PageView) : @CallSuper open fun onTouch(event: MotionEvent): Boolean { if (isStarted) return false - curPage.dispatchTouchEvent(event) return detector.onTouchEvent(event) } @@ -222,7 +221,6 @@ abstract class PageDelegate(protected val pageView: PageView) : if (isTextSelected) { curPage.cancelSelect() } -// abort() //是否移动 isMoved = false //是否存在下一章 @@ -242,6 +240,10 @@ abstract class PageDelegate(protected val pageView: PageView) : * 单击 */ override fun onSingleTapUp(e: MotionEvent): Boolean { + if (isTextSelected) { + isTextSelected = false + return true + } val x = e.x val y = e.y if (centerRectF.contains(x, y)) { @@ -290,6 +292,9 @@ abstract class PageDelegate(protected val pageView: PageView) : velocityX: Float, velocityY: Float ): Boolean { + if (isTextSelected) { + isTextSelected = false + } if (!noNext) onAnimStart() return true }