diff --git a/app/src/main/java/io/legado/app/ui/widget/page/TextChapter.kt b/app/src/main/java/io/legado/app/ui/widget/page/TextChapter.kt index 837f1b2da..bf529acbd 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/TextChapter.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/TextChapter.kt @@ -1,3 +1,15 @@ package io.legado.app.ui.widget.page -data class TextChapter(val position: Int, val title: String, val pages: List) +data class TextChapter( + val position: Int, + val title: String, + val pages: List +) { + fun getPage(index: Int): TextPage? { + if (index >= 0 && index < pages.size) { + return pages[index] + } + return null + } +} +