Skip to content

Commit

Permalink
Add getFragment to PdfView for more ease when using PdfView directly
Browse files Browse the repository at this point in the history
  • Loading branch information
irgendeinich committed Oct 29, 2019
1 parent 72735ff commit 526f94f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions android/src/main/java/com/pspdfkit/views/PdfView.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

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 @@ -70,6 +71,7 @@
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.
Expand Down Expand Up @@ -708,4 +710,9 @@ public Maybe<Boolean> setFormFieldValue(@NonNull String formElementName, @NonNul
return false;
});
}

/** Returns the current fragment if it is set. */
public Maybe<PdfFragment> getFragment() {
return fragmentGetter.firstElement();
}
}

0 comments on commit 526f94f

Please sign in to comment.