Skip to content

Commit

Permalink
Final cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
irgendeinich committed Jan 30, 2020
1 parent 28a3ea8 commit 29b6eb9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 12 deletions.
10 changes: 2 additions & 8 deletions android/src/main/java/com/pspdfkit/views/PdfView.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.pspdfkit.views;

import android.annotation.SuppressLint;
import android.content.Context;
import android.net.Uri;
import android.util.AttributeSet;
Expand All @@ -10,7 +11,6 @@

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;

import com.facebook.react.bridge.ReadableMap;
Expand Down Expand Up @@ -42,7 +42,6 @@
import com.pspdfkit.ui.PdfUiFragment;
import com.pspdfkit.ui.PdfUiFragmentBuilder;
import com.pspdfkit.ui.toolbar.grouping.MenuItemGroupingRule;
import com.pspdfkit.ui.toolbar.popup.PdfTextSelectionPopupToolbar;

import org.json.JSONArray;
import org.json.JSONException;
Expand All @@ -68,11 +67,11 @@
import io.reactivex.functions.Function;
import io.reactivex.schedulers.Schedulers;
import io.reactivex.subjects.BehaviorSubject;
import io.reactivex.subjects.Subject;

/**
* This view displays a {@link com.pspdfkit.ui.PdfFragment} and all associated toolbars.
*/
@SuppressLint("pspdfkit-experimental")
public class PdfView extends FrameLayout {

private static final String FILE_SCHEME = "file:///";
Expand Down Expand Up @@ -299,14 +298,9 @@ public void onDocumentLoaded(@NonNull PdfDocument document) {
}
});

// To prevent listeners from being attached multiple times we clean them before attaching them.
pdfFragment.removeOnTextSelectionModeChangeListener(pdfViewModeController);
pdfFragment.addOnTextSelectionModeChangeListener(pdfViewModeController);
pdfFragment.removeDocumentListener(pdfViewDocumentListener);
pdfFragment.addDocumentListener(pdfViewDocumentListener);
pdfFragment.removeOnAnnotationSelectedListener(pdfViewDocumentListener);
pdfFragment.addOnAnnotationSelectedListener(pdfViewDocumentListener);
pdfFragment.removeOnAnnotationUpdatedListener(pdfViewDocumentListener);
pdfFragment.addOnAnnotationUpdatedListener(pdfViewDocumentListener);
}

Expand Down
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.8",
"version": "1.27.0",
"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.8",
"version": "1.27.0",
"private": true,
"scripts": {
"start": "react-native start",
Expand Down
2 changes: 1 addition & 1 deletion samples/NativeCatalog/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "NativeCatalog",
"version": "1.26.8",
"version": "1.27.0",
"private": true,
"scripts": {
"android": "react-native run-android",
Expand Down

0 comments on commit 29b6eb9

Please sign in to comment.