-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This makes the necessary changes to use the latest SR2 version and, as such, implements support for the new bookmark views. Bookmarks go through the same system as Readium 1, and the bookmark data structure has been extended with chapter index and progress information. Unfortunately, until Readium 1 is removed from the codebase, we can't make the bookmark data structures as nice as they could be (currently, every field is optional!). Affects: https://jira.nypl.org/browse/SIMPLY-2796
- Loading branch information
Showing
20 changed files
with
459 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
simplified-books-api/src/main/java/org/nypl/simplified/books/api/BookChapterProgress.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.nypl.simplified.books.api | ||
|
||
/** | ||
* Progress through a specific chapter. | ||
*/ | ||
|
||
data class BookChapterProgress( | ||
|
||
/** | ||
* The index of the chapter. | ||
*/ | ||
|
||
val chapterIndex: Int, | ||
|
||
/** | ||
* The progress through the chapter. | ||
*/ | ||
|
||
val chapterProgress: Double | ||
) |
46 changes: 0 additions & 46 deletions
46
simplified-books-api/src/main/java/org/nypl/simplified/books/api/BookLocation.java
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
simplified-books-api/src/main/java/org/nypl/simplified/books/api/BookLocation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.nypl.simplified.books.api | ||
|
||
import java.io.Serializable | ||
|
||
/** | ||
* The current page. A specific location in an EPUB is identified by a chapter index, or an | ||
* *idref* and a *content CFI*. In some cases, the *content CFI* | ||
* may not be present. | ||
* | ||
* Note: The type is [Serializable] purely because the Android API requires this | ||
* in order pass values of this type between activities. We make absolutely no guarantees | ||
* that serialized values of this class will be compatible with future releases. | ||
*/ | ||
|
||
data class BookLocation( | ||
|
||
/** | ||
* The progress through the chapter, if progress is known. | ||
*/ | ||
|
||
val progress: BookChapterProgress?, | ||
|
||
/** | ||
* @return The content CFI, if any | ||
*/ | ||
|
||
val contentCFI: String?, | ||
|
||
/** | ||
* @return The IDRef | ||
*/ | ||
|
||
val idRef: String? | ||
) : Serializable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.