@@ -15,6 +15,7 @@ MiLibrisReaderSDK is the new miLibris reading SDK (previously called MLPDFReader
1515 - [ Print] ( #print )
1616 - [ Search publication] ( #search-publication )
1717 - [ Interstitial advert] ( #interstitial-advert )
18+ - [ Page bookmark] ( #page-bookmark )
1819 - [ Configure the reader tutorial] ( #configure-the-reader-tutorial )
1920 - [ Event tracking] ( #event-tracking )
2021 - [ Resume reading at the last read page] ( #resume-reading-at-the-last-read-page )
@@ -43,7 +44,7 @@ repositories {
4344}
4445
4546dependencies {
46- def miLibrisReader = "1.19.1 "
47+ def miLibrisReader = "1.20.0 "
4748 api("com.milibris:one-reader:$miLibrisReader") { //If you ever have conflict with the version used in our library add this line
4849 exclude group: "androidx.lifecycle"
4950 }
@@ -202,6 +203,31 @@ OneReaderActivity.newIntent(
202203)
203204```
204205
206+ #### Page bookmark
207+
208+ To enable page bookmark, activate the setting.
209+ ``` kotlin
210+ val settings = ReaderSettings (
211+ isPageBookmarkEnabled = true
212+ )
213+ ```
214+
215+ Then implement the ` ReaderListener ` methods to provide the bookmark states and handle the changes:
216+
217+ ``` kotlin
218+ override fun isPageBookMarked (page : Int ): Boolean? {
219+ // Get current state
220+ return pageBookmarkRepository.getState(page)
221+ }
222+
223+ override fun onPageBookMarkClicked (page : Int , bookmarkListener : BaseListener <Boolean >) {
224+ // Toggle state
225+ val newState: Boolean = pageBookmarkRepository.toggleState(page)
226+ // Provide new state to the reader
227+ bookmarkListener.onSuccessListener(newState)
228+ }
229+ ```
230+
205231### Configure the reader tutorial
206232
207233The reader is configured to display a tutorial the first time that it is opened on a new device. You can disable it you want:
0 commit comments