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