diff --git a/app/src/main/java/io/legado/app/ui/widget/page/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/widget/page/ChapterProvider.kt index 29a82318a..6666d4a07 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/ChapterProvider.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/ChapterProvider.kt @@ -31,7 +31,11 @@ object ChapterProvider { textPages.add( TextPage( pageIndex, - spannableStringBuilder.delete(pageLengths[pageIndex], spannableStringBuilder.length) + spannableStringBuilder.delete( + pageLengths[pageIndex], + spannableStringBuilder.length + ), + bookChapter.title ) ) surplusText = surplusText.substring(pageLengths[pageIndex]) diff --git a/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt b/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt index 24d06331d..c2fc3abd2 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt @@ -79,13 +79,9 @@ class ContentView : FrameLayout { tv_top_right.text = context.getString(R.string.battery_show, battery) } - fun setChapterTile(tile: String) { - tv_bottom_left.text = tile - } - fun setContent(page: TextPage?) { content_text_view.text = page?.text - + tv_bottom_left.text = page?.title tv_bottom_right.text = page?.index?.toString() } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/widget/page/TextPage.kt b/app/src/main/java/io/legado/app/ui/widget/page/TextPage.kt index 202529ca8..ea261ff2b 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/TextPage.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/TextPage.kt @@ -2,5 +2,6 @@ package io.legado.app.ui.widget.page data class TextPage( val index: Int, - val text: CharSequence + val text: CharSequence, + val title: String ) diff --git a/app/src/main/java/io/legado/app/ui/widget/page/TextPageFactory.kt b/app/src/main/java/io/legado/app/ui/widget/page/TextPageFactory.kt index 7fe165942..4d66ed307 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/TextPageFactory.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/TextPageFactory.kt @@ -55,17 +55,17 @@ class TextPageFactory private constructor(dataSource: DataSource) : override fun currentPage(): TextPage? { return dataSource.getCurrentChapter()?.page(index) - ?: TextPage(index, "index:$index") + ?: TextPage(index, "index:$index", "index:$index") } override fun nextPage(): TextPage? { return dataSource.getCurrentChapter()?.page(index + 1) - ?: TextPage(index + 1, "index:${index + 1}") + ?: TextPage(index + 1, "index:${index + 1}", "index:${index + 1}") } override fun previousPage(): TextPage? { return dataSource.getCurrentChapter()?.page(index - 1) - ?: TextPage(index - 1, "index:${index - 1}") + ?: TextPage(index - 1, "index:${index - 1}", "index:${index - 1}") }