Replies: 2 comments
-
Not out of the box but here are some extensions on public suspend fun Navigator.goToPreviousResourceIn(readingOrder: List<Link>): Boolean {
val previousLocator =
readingOrder.indexOfFirstWithHref(currentLocator.value.href)
?.let { readingOrder.getOrNull(it - 1) }
?: return false
return go(previousLocator)
}
public suspend fun Navigator.goToNextResourceIn(readingOrder: List<Link>): Boolean {
val nextLocator =
readingOrder.indexOfFirstWithHref(currentLocator.value.href)
?.let { readingOrder.getOrNull(it + 1) }
?: return false
return go(nextLocator)
} Then call navigator.goToNextResourceIn(publication.readingOrder) This is such a common use case that we will probably add some helpers for that at some point. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any way to switch to the previous chapter directly in Epub navigator, instead of goBackward and goForward to switch to the previous page and the next page?
Beta Was this translation helpful? Give feedback.
All reactions