Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Mar 11, 2024
1 parent 1840645 commit c43ed2c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at
var textPage: TextPage = TextPage()
private set
var isMainView = false
private var longScreenshot = false
var longScreenshot = false
var reverseStartCursor = false
var reverseEndCursor = false

Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,10 @@ class PageView(context: Context) : FrameLayout(context) {
return binding.contentTextView.reverseEndCursor
}

fun isLongScreenShot(): Boolean {
return binding.contentTextView.longScreenshot
}

fun resetReverseCursor() {
binding.contentTextView.resetReverseCursor()
}
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,10 @@ class ReadView(context: Context, attrs: AttributeSet) :
curPage.submitRenderTask()
}

fun isLongScreenShot(): Boolean {
return curPage.isLongScreenShot()
}

override fun onLayoutPageCompleted(index: Int, page: TextPage) {
upProgressThrottle.invoke()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class ScrollPageDelegate(readView: ReadView) : PageDelegate(readView) {
//多点触控时即最后按下的手指产生的事件点
val pointX = event.getX(event.pointerCount - 1)
val pointY = event.getY(event.pointerCount - 1)
if (isMoved) {
if (isMoved || readView.isLongScreenShot()) {
readView.setTouchPoint(pointX, pointY, false)
}
if (!isMoved) {
Expand Down

0 comments on commit c43ed2c

Please sign in to comment.