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

Update PSPDFKit to 6.0.2 #312

Merged
merged 3 commits into from
Oct 28, 2019
Merged
Show file tree
Hide file tree
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
5 changes: 1 addition & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Contains gradle configuration constants
*/
ext {
PSPDFKIT_VERSION = '5.5.1'
PSPDFKIT_VERSION = '6.0.2'
}

buildscript {
Expand Down Expand Up @@ -72,8 +72,5 @@ dependencies {
compile("com.pspdfkit:pspdfkit:${PSPDFKIT_VERSION}") {
exclude group: 'com.google.auto.value', module: 'auto-value'
}
compile("com.pspdfkit:pspdfkit-instant:${PSPDFKIT_VERSION}") {
exclude group: 'com.google.auto.value', module: 'auto-value'
}
compile "com.facebook.react:react-native:+"
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
import com.pspdfkit.configuration.page.PageLayoutMode;
import com.pspdfkit.configuration.page.PageScrollDirection;
import com.pspdfkit.configuration.page.PageScrollMode;
import com.pspdfkit.configuration.sharing.ShareFeatures;

import java.util.EnumSet;

import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -236,9 +239,9 @@ private void configureImmersiveMode(boolean immersiveMode) {
}

private void configureShowThumbnailBar(String showThumbnailBar) {
ThumbnailBarMode thumbnailBarMode = ThumbnailBarMode.THUMBNAIL_BAR_MODE_DEFAULT;
ThumbnailBarMode thumbnailBarMode = ThumbnailBarMode.THUMBNAIL_BAR_MODE_FLOATING;
if (showThumbnailBar.equals(SHOW_THUMBNAIL_BAR_DEFAULT)) {
thumbnailBarMode = ThumbnailBarMode.THUMBNAIL_BAR_MODE_DEFAULT;
thumbnailBarMode = ThumbnailBarMode.THUMBNAIL_BAR_MODE_FLOATING;
} else if (showThumbnailBar.equals(SHOW_THUMBNAIL_BAR_SCROLLABLE)) {
thumbnailBarMode = ThumbnailBarMode.THUMBNAIL_BAR_MODE_SCROLLABLE;
} else if (showThumbnailBar.equals(SHOW_THUMBNAIL_BAR_NONE)) {
Expand Down Expand Up @@ -301,9 +304,9 @@ private void configureEnableAnnotationEditing(boolean enableAnnotationEditing) {

private void configureShowShareAction(boolean showShareAction) {
if (showShareAction) {
configuration.enableShare();
configuration.setEnabledShareFeatures(ShareFeatures.all());
} else {
configuration.disableShare();
configuration.setEnabledShareFeatures(ShareFeatures.none());
}
}

Expand Down
2 changes: 1 addition & 1 deletion android/src/main/java/com/pspdfkit/views/PdfView.java
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ public Disposable removeAnnotation(final int requestId, ReadableMap annotation)
return Observable.empty();
}

return pdfDocument.getAnnotationProvider().getAllAnnotationsOfType(getTypeFromString(type), pageIndex, 1)
return pdfDocument.getAnnotationProvider().getAllAnnotationsOfTypeAsync(getTypeFromString(type), pageIndex, 1)
.filter(annotationToFilter -> name.equals(annotationToFilter.getName()))
.map(filteredAnnotation -> new Pair<>(filteredAnnotation, pdfDocument));
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import com.pspdfkit.ui.special_mode.controller.AnnotationSelectionController;
import com.pspdfkit.ui.special_mode.manager.AnnotationManager;

import java.util.List;

class PdfViewDocumentListener implements DocumentListener, AnnotationManager.OnAnnotationSelectedListener, AnnotationProvider.OnAnnotationUpdatedListener {

@NonNull
Expand Down Expand Up @@ -122,4 +124,9 @@ public void onAnnotationUpdated(@NonNull Annotation annotation) {
public void onAnnotationRemoved(@NonNull Annotation annotation) {
eventDispatcher.dispatchEvent(new PdfViewAnnotationChangedEvent(parent.getId(), PdfViewAnnotationChangedEvent.EVENT_TYPE_REMOVED, annotation));
}

@Override
public void onAnnotationZOrderChanged(int i, @NonNull List<Annotation> list, @NonNull List<Annotation> list1) {
// Not required.
}
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-pspdfkit",
"version": "1.26.2",
"version": "1.26.3",
"description": "A React Native module for the PSPDFKit library.",
"keywords": [
"react native",
Expand Down
2 changes: 1 addition & 1 deletion samples/Catalog/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Catalog",
"version": "1.26.2",
"version": "1.26.3",
"private": true,
"scripts": {
"start": "react-native start",
Expand Down