pull/32/head
kunfei 5 years ago
parent 70f1082bba
commit fae1bb05f5
  1. 12
      app/src/main/java/io/legado/app/ui/widget/page/ChapterProvider.kt

@ -35,12 +35,16 @@ object ChapterProvider {
}
}
textView.text = spannableStringBuilder
pageLengths.add(textView.getCharNum())
val lastCharNum = textView.getCharNum()
if (lastCharNum == 0) {
break
} else {
pageLengths.add(lastCharNum)
textPages.add(
TextPage(
index = pageIndex,
text = spannableStringBuilder.delete(
pageLengths[pageIndex],
lastCharNum,
spannableStringBuilder.length
),
title = bookChapter.title,
@ -48,10 +52,10 @@ object ChapterProvider {
chapterIndex = bookChapter.index
)
)
surplusText = surplusText.substring(pageLengths[pageIndex])
surplusText = surplusText.substring(lastCharNum)
pageIndex++
}
}
for (item in textPages) {
item.pageSize = textPages.size
}

Loading…
Cancel
Save