|
|
@ -24,14 +24,15 @@ object ChapterProvider { |
|
|
|
while (surplusText.isNotEmpty()) { |
|
|
|
while (surplusText.isNotEmpty()) { |
|
|
|
val spannableStringBuilder = SpannableStringBuilder(surplusText) |
|
|
|
val spannableStringBuilder = SpannableStringBuilder(surplusText) |
|
|
|
if (pageIndex == 0) { |
|
|
|
if (pageIndex == 0) { |
|
|
|
var end = surplusText.indexOf("\n") |
|
|
|
val end = surplusText.indexOf("\n") |
|
|
|
if (end == -1) end = surplusText.length |
|
|
|
if (end > 0) { |
|
|
|
spannableStringBuilder.setSpan( |
|
|
|
spannableStringBuilder.setSpan( |
|
|
|
titleSpan, |
|
|
|
titleSpan, |
|
|
|
0, |
|
|
|
0, |
|
|
|
end, |
|
|
|
end, |
|
|
|
Spannable.SPAN_INCLUSIVE_EXCLUSIVE |
|
|
|
Spannable.SPAN_INCLUSIVE_EXCLUSIVE |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
textView.text = spannableStringBuilder |
|
|
|
textView.text = spannableStringBuilder |
|
|
|
pageLengths.add(textView.getCharNum()) |
|
|
|
pageLengths.add(textView.getCharNum()) |
|
|
|