Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bookmark action configuration option #354

Merged
merged 2 commits into from
Mar 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* PSPDFKit
*
* Copyright © 2017-2019 PSPDFKit GmbH. All rights reserved.
* Copyright © 2017-2020 PSPDFKit GmbH. All rights reserved.
*
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
Expand Down Expand Up @@ -62,6 +62,7 @@ public class ConfigurationAdapter {
private static final String SHOW_THUMBNAIL_BAR_NONE = "none";
private static final String SHOW_THUMBNAIL_GRID_ACTION = "showThumbnailGridAction";
private static final String SHOW_OUTLINE_ACTION = "showOutlineAction";
private static final String SHOW_BOOKMARKS_ACTION = "showBookmarksAction";
private static final String SHOW_ANNOTATION_LIST_ACTION = "showAnnotationListAction";
private static final String SHOW_PAGE_NUMBER_OVERLAY = "showPageNumberOverlay";
private static final String SHOW_PAGE_LABELS = "showPageLabels";
Expand Down Expand Up @@ -123,6 +124,9 @@ public ConfigurationAdapter(@NonNull Context context, ReadableMap configuration)
if (configuration.hasKey(SHOW_OUTLINE_ACTION)) {
configureShowOutlineAction(configuration.getBoolean(SHOW_OUTLINE_ACTION));
}
if (configuration.hasKey(SHOW_BOOKMARKS_ACTION)) {
configureShowBookmarksAction(configuration.getBoolean(SHOW_BOOKMARKS_ACTION));
}
if (configuration.hasKey(SHOW_ANNOTATION_LIST_ACTION)) {
configureShowAnnotationListAction(configuration.getBoolean(SHOW_ANNOTATION_LIST_ACTION));
}
Expand Down Expand Up @@ -276,6 +280,14 @@ private void configureShowOutlineAction(boolean showOutlineAction) {
}
}

private void configureShowBookmarksAction(final boolean showBookmarksAction) {
if (showBookmarksAction) {
configuration.enableBookmarkList();
} else {
configuration.disableBookmarkList();
}
}

private void configureShowAnnotationListAction(boolean showAnnotationListAction) {
if (showAnnotationListAction) {
configuration.enableAnnotationList();
Expand Down