|
|
|
@ -63,25 +63,25 @@ data class TextChapter( |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @return 获取未读文字 |
|
|
|
|
* 获取内容 |
|
|
|
|
*/ |
|
|
|
|
fun getUnRead(pageIndex: Int): String { |
|
|
|
|
fun getContent(): String { |
|
|
|
|
val stringBuilder = StringBuilder() |
|
|
|
|
if (pages.isNotEmpty()) { |
|
|
|
|
for (index in pageIndex..pages.lastIndex) { |
|
|
|
|
stringBuilder.append(pages[index].text) |
|
|
|
|
} |
|
|
|
|
pages.forEach { |
|
|
|
|
stringBuilder.append(it.text) |
|
|
|
|
} |
|
|
|
|
return stringBuilder.toString() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取内容 |
|
|
|
|
* @return 获取未读文字 |
|
|
|
|
*/ |
|
|
|
|
fun getContent(): String { |
|
|
|
|
fun getUnRead(pageIndex: Int): String { |
|
|
|
|
val stringBuilder = StringBuilder() |
|
|
|
|
pages.forEach { |
|
|
|
|
stringBuilder.append(it.text) |
|
|
|
|
if (pages.isNotEmpty()) { |
|
|
|
|
for (index in pageIndex..pages.lastIndex) { |
|
|
|
|
stringBuilder.append(pages[index].text) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return stringBuilder.toString() |
|
|
|
|
} |
|
|
|
@ -93,7 +93,6 @@ data class TextChapter( |
|
|
|
|
* @param startPos 从当前页什么地方开始朗读 |
|
|
|
|
*/ |
|
|
|
|
fun getNeedReadAloud(pageIndex: Int, pageSplit: Boolean, startPos: Int): String { |
|
|
|
|
//todo 未完成 |
|
|
|
|
val stringBuilder = StringBuilder() |
|
|
|
|
if (pages.isNotEmpty()) { |
|
|
|
|
for (index in pageIndex..pages.lastIndex) { |
|
|
|
@ -103,7 +102,7 @@ data class TextChapter( |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return stringBuilder.toString() |
|
|
|
|
return stringBuilder.substring(startPos).toString() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|