diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index 0f08df7c0..48bdd6cf6 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -691,7 +691,7 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo upScreenTimeOut() } observeEvent(PreferKey.textSelectAble) { - page_view.upSelectAble(it) + page_view.curPage.upSelectAble(it) } } 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 1bd474c89..d17e55a67 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 @@ -197,6 +197,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at y: Float, select: (relativePage: Int, lineIndex: Int, charIndex: Int) -> Unit ) { + if (!selectAble) return if (!visibleRect.contains(x, y)) return var relativeOffset = relativeOffset(0) for ((lineIndex, textLine) in textPage.textLines.withIndex()) { diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt index 52acc8195..1482d309a 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt @@ -132,11 +132,6 @@ class PageView(context: Context, attrs: AttributeSet) : } } - fun upSelectAble(selectAble: Boolean) { - pageDelegate?.upSelectAble(selectAble) - curPage.upSelectAble(selectAble) - } - fun upStyle() { ChapterProvider.upStyle() curPage.upStyle() 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 c710367c7..2b26714c4 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 @@ -101,10 +101,6 @@ abstract class PageDelegate(protected val pageView: PageView) : onScroll() } - fun upSelectAble(selectAble: Boolean) { - detector.setIsLongpressEnabled(selectAble) - } - open fun fling( startX: Int, startY: Int, velocityX: Int, velocityY: Int, minX: Int, maxX: Int, minY: Int, maxY: Int