|
|
@ -65,7 +65,7 @@ class TextPageFactory(dataSource: DataSource) : PageFactory<TextPage>(dataSource |
|
|
|
return@with TextPage(text = it).format() |
|
|
|
return@with TextPage(text = it).format() |
|
|
|
} |
|
|
|
} |
|
|
|
currentChapter?.let { |
|
|
|
currentChapter?.let { |
|
|
|
return@with it.page(pageIndex) ?: TextPage(title = it.title).format() |
|
|
|
return@with it.getPage(pageIndex) ?: TextPage(title = it.title).format() |
|
|
|
} |
|
|
|
} |
|
|
|
return TextPage().format() |
|
|
|
return TextPage().format() |
|
|
|
} |
|
|
|
} |
|
|
@ -77,7 +77,7 @@ class TextPageFactory(dataSource: DataSource) : PageFactory<TextPage>(dataSource |
|
|
|
} |
|
|
|
} |
|
|
|
currentChapter?.let { |
|
|
|
currentChapter?.let { |
|
|
|
if (pageIndex < it.pageSize - 1) { |
|
|
|
if (pageIndex < it.pageSize - 1) { |
|
|
|
return@with it.page(pageIndex + 1)?.removePageAloudSpan() |
|
|
|
return@with it.getPage(pageIndex + 1)?.removePageAloudSpan() |
|
|
|
?: TextPage(title = it.title).format() |
|
|
|
?: TextPage(title = it.title).format() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -85,7 +85,7 @@ class TextPageFactory(dataSource: DataSource) : PageFactory<TextPage>(dataSource |
|
|
|
return@with TextPage(text = "") |
|
|
|
return@with TextPage(text = "") |
|
|
|
} |
|
|
|
} |
|
|
|
nextChapter?.let { |
|
|
|
nextChapter?.let { |
|
|
|
return@with it.page(0)?.removePageAloudSpan() |
|
|
|
return@with it.getPage(0)?.removePageAloudSpan() |
|
|
|
?: TextPage(title = it.title).format() |
|
|
|
?: TextPage(title = it.title).format() |
|
|
|
} |
|
|
|
} |
|
|
|
return TextPage().format() |
|
|
|
return TextPage().format() |
|
|
@ -98,7 +98,7 @@ class TextPageFactory(dataSource: DataSource) : PageFactory<TextPage>(dataSource |
|
|
|
} |
|
|
|
} |
|
|
|
if (pageIndex > 0) { |
|
|
|
if (pageIndex > 0) { |
|
|
|
currentChapter?.let { |
|
|
|
currentChapter?.let { |
|
|
|
return@with it.page(pageIndex - 1)?.removePageAloudSpan() |
|
|
|
return@with it.getPage(pageIndex - 1)?.removePageAloudSpan() |
|
|
|
?: TextPage(title = it.title).format() |
|
|
|
?: TextPage(title = it.title).format() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -113,15 +113,15 @@ class TextPageFactory(dataSource: DataSource) : PageFactory<TextPage>(dataSource |
|
|
|
get() = with(dataSource) { |
|
|
|
get() = with(dataSource) { |
|
|
|
currentChapter?.let { |
|
|
|
currentChapter?.let { |
|
|
|
if (pageIndex < it.pageSize - 2) { |
|
|
|
if (pageIndex < it.pageSize - 2) { |
|
|
|
return@with it.page(pageIndex + 2)?.removePageAloudSpan() |
|
|
|
return@with it.getPage(pageIndex + 2)?.removePageAloudSpan() |
|
|
|
?: TextPage(title = it.title).format() |
|
|
|
?: TextPage(title = it.title).format() |
|
|
|
} |
|
|
|
} |
|
|
|
nextChapter?.let { nc -> |
|
|
|
nextChapter?.let { nc -> |
|
|
|
if (pageIndex < it.pageSize - 1) { |
|
|
|
if (pageIndex < it.pageSize - 1) { |
|
|
|
return@with nc.page(0)?.removePageAloudSpan() |
|
|
|
return@with nc.getPage(0)?.removePageAloudSpan() |
|
|
|
?: TextPage(title = nc.title).format() |
|
|
|
?: TextPage(title = nc.title).format() |
|
|
|
} |
|
|
|
} |
|
|
|
return@with nc.page(1)?.removePageAloudSpan() |
|
|
|
return@with nc.getPage(1)?.removePageAloudSpan() |
|
|
|
?: TextPage(title = nc.title).format() |
|
|
|
?: TextPage(title = nc.title).format() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|