PdfUiFragment

Experimental API - Might change in the future.

This fragment provides the same UI as PdfActivity. It can be used inside any view hierarchy but use is limited to one instance per Activity, unless pdfFragmentTag is used to set a unique fragment tag for each instance.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
@get:NonNull
open val implementation: PdfUiImpl
The current implementation of the PDF UI.

Functions

Link copied to clipboard
Returns the PdfActivityConfiguration that was provided while launching this pdf UI.
Link copied to clipboard
open fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent)
Link copied to clipboard
Call this from your activity to properly close the UI when pressing back.
Link copied to clipboard
open fun onCreateOptionsMenu(@NonNull menu: Menu, @NonNull inflater: MenuInflater)
Link copied to clipboard
open fun onCreateView(@NonNull inflater: LayoutInflater, @Nullable container: ViewGroup, @Nullable savedInstanceState: Bundle): View
Link copied to clipboard
open fun onDestroy()
Link copied to clipboard
Called when the user taps / clicks on the document, not the page itself but on the side (if visible).
Link copied to clipboard
open fun onDocumentLoaded(@NonNull document: PdfDocument)
Called when document is successfully loaded and the document view has been laid out.
Link copied to clipboard
open fun onDocumentLoadFailed(@NonNull exception: Throwable)
Called if document loading has failed.
Link copied to clipboard
open fun onDocumentSave(@NonNull document: PdfDocument, @NonNull saveOptions: DocumentSaveOptions): Boolean
Called before document will be saved.
Link copied to clipboard
Called if document saving has been cancelled.
Link copied to clipboard
open fun onDocumentSaved(@NonNull document: PdfDocument)
Called after the document has been saved.
Link copied to clipboard
open fun onDocumentSaveFailed(@NonNull document: PdfDocument, @NonNull exception: Throwable)
Called if document saving has failed.
Link copied to clipboard
open fun onDocumentZoomed(@NonNull document: PdfDocument, @IntRange(from = 0) pageIndex: Int, scaleFactor: Float)
Called when a user zooms a document.
Link copied to clipboard
Link copied to clipboard
open fun onGetShowAsAction(menuItemId: Int, defaultShowAsAction: Int): Int
Link copied to clipboard
Link copied to clipboard
open fun onPageChanged(@NonNull document: PdfDocument, @IntRange(from = 0) pageIndex: Int)
Called when user scrolled to a new page.
Link copied to clipboard
open fun onPageClick(@NonNull document: PdfDocument, pageIndex: Int, @Nullable event: MotionEvent, @Nullable pagePosition: PointF, @Nullable clickedAnnotation: Annotation): Boolean
Called when user taps / clicks on the page.
Link copied to clipboard
open fun onPageUpdated(@NonNull document: PdfDocument, @IntRange(from = 0) pageIndex: Int)
Called when content of page with pageIndex has changed (for example due to annotation or form field being updated).
Link copied to clipboard
open fun onPause()
Link copied to clipboard
Link copied to clipboard
open fun onResume()
Link copied to clipboard
open fun onSaveInstanceState(@NonNull outState: Bundle)
Link copied to clipboard
Called when activity title must be set - before and after document was loaded.
Link copied to clipboard
open fun onStart()
Link copied to clipboard
open fun onStop()
Link copied to clipboard
Called when user interface visibility have changed.
Link copied to clipboard
Replaces activity configuration.