|
|
|
@ -13,6 +13,10 @@ class TextPageFactory(dataSource: DataSource) : PageFactory<TextPage>(dataSource |
|
|
|
|
return hasNextChapter() || currentChapter?.isLastIndex(pageIndex) != true |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun hasNextPlus(): Boolean = with(dataSource) { |
|
|
|
|
return hasNextChapter() || pageIndex < (currentChapter?.pageSize() ?: 1) - 2 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun moveToFirst() { |
|
|
|
|
ReadBook.setPageIndex(0) |
|
|
|
|
} |
|
|
|
@ -86,9 +90,6 @@ class TextPageFactory(dataSource: DataSource) : PageFactory<TextPage>(dataSource |
|
|
|
|
?: TextPage(title = it.title).format() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (!hasPrevChapter()) { |
|
|
|
|
return@with TextPage(text = "") |
|
|
|
|
} |
|
|
|
|
prevChapter?.let { |
|
|
|
|
return@with it.lastPage()?.removePageAloudSpan() |
|
|
|
|
?: TextPage(title = it.title).format() |
|
|
|
@ -103,9 +104,6 @@ class TextPageFactory(dataSource: DataSource) : PageFactory<TextPage>(dataSource |
|
|
|
|
return@with it.page(pageIndex + 2)?.removePageAloudSpan() |
|
|
|
|
?: TextPage(title = it.title).format() |
|
|
|
|
} |
|
|
|
|
if (!hasNextChapter()) { |
|
|
|
|
TextPage(text = "") |
|
|
|
|
} |
|
|
|
|
nextChapter?.let { nc -> |
|
|
|
|
if (pageIndex < it.pageSize() - 1) { |
|
|
|
|
return@with nc.page(0)?.removePageAloudSpan() |
|
|
|
|