mirror of
https://github.com/gedoor/legado.git
synced 2024-07-06 23:47:49 +08:00
优化
This commit is contained in:
parent
952fc96574
commit
8e28ae1c4a
@ -536,6 +536,9 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at
|
||||
}
|
||||
|
||||
private fun upSelectChars() {
|
||||
if (!selectStart.isSelected() || !selectEnd.isSelected()) {
|
||||
return
|
||||
}
|
||||
val last = if (callBack.isScroll) 2 else 0
|
||||
val textPos = TextPos(0, 0, 0)
|
||||
for (relativePos in 0..last) {
|
||||
|
@ -104,6 +104,7 @@ data class TextChapter(
|
||||
* @return 已读长度
|
||||
*/
|
||||
fun getReadLength(pageIndex: Int): Int {
|
||||
if (pageIndex < 0) return 0
|
||||
return pages[min(pageIndex, lastIndex)].lines.first().chapterPosition
|
||||
/*
|
||||
var length = 0
|
||||
|
@ -69,4 +69,8 @@ data class TextPos(
|
||||
isLast = false
|
||||
}
|
||||
|
||||
fun isSelected(): Boolean {
|
||||
return lineIndex >= 0 && columnIndex >= 0
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user