Interface BookmarkViewAdapter
-
- All Implemented Interfaces:
public interface BookmarkViewAdapter
Bookmarks adapter for the PdfOutlineView. This interface handles interaction with actual bookmark data for this view as well as events triggered on the view (for example, bookmark taps, edits, etc.).
-
-
Method Summary
Modifier and Type Method Description abstract List<Bookmark>
getBookmarks()
Called to retrieve the list of bookmarks to display. abstract void
onBookmarkAdd()
Called when add button has been clicked in this view. abstract void
onBookmarkPositionSet(@NonNull() Bookmark bookmark, int position)
Called when bookmark has been reordered in this view. abstract void
onBookmarkNameSet(@NonNull() Bookmark bookmark, @Nullable() String name)
Called when bookmark should be renamed. abstract void
onBookmarkClicked(@NonNull() Bookmark bookmark)
Called when user taps on a bookmark outside editing mode. abstract boolean
onBookmarkRemove(@NonNull() Bookmark bookmark)
Called when user deleted the bookmark from list. abstract boolean
isBookmarkAddButtonEnabled()
Called to determine bookmark add button enabled state. abstract void
addBookmarkListener(@NonNull() BookmarkProvider.BookmarkListener listener)
Adds this view to bookmark change events via BookmarkListener interface. abstract void
removeBookmarkListener(@NonNull() BookmarkProvider.BookmarkListener listener)
Removes this view from bookmark change events via BookmarkListener interface. -
-
Method Detail
-
getBookmarks
abstract List<Bookmark> getBookmarks()
Called to retrieve the list of bookmarks to display.
- Returns:
List of bookmarks to be shown in this view.
-
onBookmarkAdd
abstract void onBookmarkAdd()
Called when add button has been clicked in this view.
-
onBookmarkPositionSet
abstract void onBookmarkPositionSet(@NonNull() Bookmark bookmark, int position)
Called when bookmark has been reordered in this view.
- Parameters:
bookmark
- Bookmark that has been reordered.position
- New bookmark position.
-
onBookmarkNameSet
abstract void onBookmarkNameSet(@NonNull() Bookmark bookmark, @Nullable() String name)
Called when bookmark should be renamed.
- Parameters:
bookmark
- Bookmark that has been selected for rename.name
- New bookmark name.
-
onBookmarkClicked
abstract void onBookmarkClicked(@NonNull() Bookmark bookmark)
Called when user taps on a bookmark outside editing mode.
- Parameters:
bookmark
- Bookmark that was tapped.
-
onBookmarkRemove
abstract boolean onBookmarkRemove(@NonNull() Bookmark bookmark)
Called when user deleted the bookmark from list.
- Parameters:
bookmark
- Bookmark that was deleted.- Returns:
true
if the bookmark should be actually deleted,false
if it should be left on the list.
-
isBookmarkAddButtonEnabled
abstract boolean isBookmarkAddButtonEnabled()
Called to determine bookmark add button enabled state.
- Returns:
true
if add button should be enabled,false
if it should be disabled.
-
addBookmarkListener
abstract void addBookmarkListener(@NonNull() BookmarkProvider.BookmarkListener listener)
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.- Parameters:
listener
- BookmarkListener that should be notified.
-
removeBookmarkListener
abstract void removeBookmarkListener(@NonNull() BookmarkProvider.BookmarkListener listener)
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. Addingnull
is not allowed,and will result in an exception.- Parameters:
listener
- BookmarkListener that should be removed.
-
-
-
-