@ -9,8 +9,6 @@ interface DataSource {
fun getChapterPosition(): Int
fun getChapter(position: Int): TextChapter?
fun getCurrentChapter(): TextChapter?
fun getNextChapter(): TextChapter?
@ -2,8 +2,6 @@ package io.legado.app.ui.widget.page
abstract class PageFactory<DATA>(protected val dataSource: DataSource) {
abstract fun pageAt(index: Int): DATA?
abstract fun moveToFirst()
abstract fun moveToLast()
@ -190,10 +190,6 @@ class PageView(context: Context, attrs: AttributeSet) :
return ReadBook.durChapterIndex
}
override fun getChapter(position: Int): TextChapter? {
return ReadBook.textChapter(position)
override fun getCurrentChapter(): TextChapter? {
return ReadBook.textChapter(0)
@ -21,11 +21,6 @@ class TextPageFactory(dataSource: DataSource) : PageFactory<TextPage>(dataSource
override fun pageAt(index: Int): TextPage {
return dataSource.getCurrentChapter()?.page(index)
?: TextPage(index = index, title = "index:$index")
override fun moveToFirst() {
dataSource.setPageIndex(0)