优化
This commit is contained in:
@@ -952,6 +952,7 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|||||||
success: (() -> Unit)?
|
success: (() -> Unit)?
|
||||||
) {
|
) {
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
|
binding.readView.cancelSelect()
|
||||||
binding.readView.upContent(relativePosition, resetPageOffset)
|
binding.readView.upContent(relativePosition, resetPageOffset)
|
||||||
if (relativePosition == 0) {
|
if (relativePosition == 0) {
|
||||||
upSeekBarProgress()
|
upSeekBarProgress()
|
||||||
@@ -980,6 +981,7 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|||||||
override fun pageChanged() {
|
override fun pageChanged() {
|
||||||
pageChanged = true
|
pageChanged = true
|
||||||
binding.readView.onPageChange()
|
binding.readView.onPageChange()
|
||||||
|
binding.readView.cancelSelect()
|
||||||
handler.post {
|
handler.post {
|
||||||
upSeekBarProgress()
|
upSeekBarProgress()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ data class TextPage(
|
|||||||
*/
|
*/
|
||||||
fun getPosByLineColumn(lineIndex: Int, columnIndex: Int): Int {
|
fun getPosByLineColumn(lineIndex: Int, columnIndex: Int): Int {
|
||||||
var length = 0
|
var length = 0
|
||||||
val maxIndex = min(lineIndex, lineSize)
|
val maxIndex = min(lineIndex, lineSize - 1)
|
||||||
for (index in 0 until maxIndex) {
|
for (index in 0 until maxIndex) {
|
||||||
length += textLines[index].charSize
|
length += textLines[index].charSize
|
||||||
if (textLines[index].isParagraphEnd) {
|
if (textLines[index].isParagraphEnd) {
|
||||||
|
|||||||
Reference in New Issue
Block a user