From 22b1238bd2b43db87391bea0484ce2984c069cf8 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 17 Aug 2019 14:57:21 +0800 Subject: [PATCH] up --- .../io/legado/app/ui/widget/page/TextChapter.kt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 + } +} +