DefaultBookmarkAdapter

Default implementation of BookmarkViewAdapter which handles bookmark behaviour for the default BookmarkListView.

Note: This adapter is bound to a single PdfFragment instance. If you are using this manually in your custom activity, replace the fragment (for example when reloading documents), create and set a new adapter for the new fragment.

Constructors

Link copied to clipboard
constructor(fragment: PdfFragment)

Properties

Link copied to clipboard
open override val bookmarks: List<Bookmark>
Link copied to clipboard

Functions

Link copied to clipboard

Adds this view to bookmark change events via BookmarkListener interface. Should be passed through to a BookmarkProvider. Passing null is not allowed, and will result in an exception.

Link copied to clipboard
open override fun getBookmarks(): List<Bookmark>

Called to retrieve the list of bookmarks to display.

Link copied to clipboard
open override fun isBookmarkAddButtonEnabled(): Boolean

Called to determine bookmark add button enabled state.

Link copied to clipboard
open override fun onBookmarkAdd()

Called when add button has been clicked in this view.

Link copied to clipboard
open override fun onBookmarkAdded(bookmark: Bookmark)

Called when a new bookmark was added. Called on the UI thread.

Link copied to clipboard
open override fun onBookmarkClicked(bookmark: Bookmark)

Called when user taps on a bookmark outside editing mode.

Link copied to clipboard
open override fun onBookmarkNameSet(bookmark: Bookmark, name: String?)

Called when bookmark should be renamed.

Link copied to clipboard
open override fun onBookmarkPositionSet(bookmark: Bookmark, position: Int)

Called when bookmark has been reordered in this view.

Link copied to clipboard
open override fun onBookmarkRemove(bookmark: Bookmark): Boolean

Called when user deleted the bookmark from list.

Link copied to clipboard
open override fun onBookmarksChanged(bookmarks: List<Bookmark>)

Called when bookmark list has been changed in some way. Called on the UI thread. It is also called if any property of any bookmark in the list changes.

Link copied to clipboard
open override fun onDestroy(owner: LifecycleOwner)

Called when the fragment is destroyed. Removes this adapter as a lifecycle observer.

Link copied to clipboard
open override fun onDocumentLoaded(document: PdfDocument)

Called when document is successfully loaded and the document view has been laid out. This has to be called on the main thread.

Link copied to clipboard
open override fun onStart(owner: LifecycleOwner)

Called when the fragment moves to the started state. Adds document and bookmark listeners.

Link copied to clipboard
open override fun onStop(owner: LifecycleOwner)

Called when the fragment moves to the stopped state. Removes document and bookmark listeners.

Link copied to clipboard

Removes this view from bookmark change events via BookmarkListener interface. Should be passed through to a BookmarkProvider. Upon calling this method the listener will no longer be notified of any changes. If the listener has not been added, this method will be a no-op. Adding null is not allowed,and will result in an exception.