优化
This commit is contained in:
@@ -536,6 +536,9 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun upSelectChars() {
|
private fun upSelectChars() {
|
||||||
|
if (!selectStart.isSelected() || !selectEnd.isSelected()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
val last = if (callBack.isScroll) 2 else 0
|
val last = if (callBack.isScroll) 2 else 0
|
||||||
val textPos = TextPos(0, 0, 0)
|
val textPos = TextPos(0, 0, 0)
|
||||||
for (relativePos in 0..last) {
|
for (relativePos in 0..last) {
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ data class TextChapter(
|
|||||||
* @return 已读长度
|
* @return 已读长度
|
||||||
*/
|
*/
|
||||||
fun getReadLength(pageIndex: Int): Int {
|
fun getReadLength(pageIndex: Int): Int {
|
||||||
|
if (pageIndex < 0) return 0
|
||||||
return pages[min(pageIndex, lastIndex)].lines.first().chapterPosition
|
return pages[min(pageIndex, lastIndex)].lines.first().chapterPosition
|
||||||
/*
|
/*
|
||||||
var length = 0
|
var length = 0
|
||||||
|
|||||||
@@ -69,4 +69,8 @@ data class TextPos(
|
|||||||
isLast = false
|
isLast = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun isSelected(): Boolean {
|
||||||
|
return lineIndex >= 0 && columnIndex >= 0
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user