com.pspdfkit.ui.PdfUi |
![]() |
The API that is shared between PdfActivity
and PdfUiFragment
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
long | TIMEOUT_DEFAULT | Parameter for setScreenTimeout(long) used for restoring screen timeout to its
default system value. |
|||||||||
long | TIMEOUT_INFINITE | Parameter for setScreenTimeout(long) used for disabling screen timeout. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract void | addPropertyInspectorLifecycleListener(PropertyInspectorCoordinatorLayoutController.PropertyInspectorLifecycleListener lifecycleListener) | ||||||||||
abstract PdfActivityConfiguration |
getConfiguration()
Returns the
PdfActivityConfiguration that was provided while launching this pdf UI. | ||||||||||
abstract PdfDocument |
getDocument()
Returns the
PdfDocument that is loaded into this pdf UI, or null if no
document has been loaded yet. | ||||||||||
abstract DocumentCoordinator |
getDocumentCoordinator()
Returns the coordinator responsible for displaying documents and switching between multiple
loaded documents.
| ||||||||||
abstract PSPDFKitViews |
getPSPDFKitViews()
Returns object with inflated PSPDFKit views.
| ||||||||||
abstract int |
getPageIndex()
Returns current page index set on the document.
| ||||||||||
abstract PdfFragment |
getPdfFragment()
Returns the
PdfFragment that is used to show the document. | ||||||||||
abstract PropertyInspectorCoordinatorLayout | getPropertyInspectorCoordinator() | ||||||||||
abstract long |
getScreenTimeout()
Gets screen timeout in milliseconds that has been added to the predefined system timeout,
TIMEOUT_DEFAULT or TIMEOUT_INFINITE . | ||||||||||
abstract int |
getSiblingPageIndex(int pageIndex)
Gets page sibling index (usable in double page mode).
| ||||||||||
abstract UserInterfaceViewMode |
getUserInterfaceViewMode()
Return current user interface view mode that activity is using.
| ||||||||||
abstract void |
hideUserInterface()
Animates user interface controls out of view.
| ||||||||||
abstract boolean |
isDocumentInteractionEnabled()
Indicates whether interaction with the document is enabled right now.
| ||||||||||
abstract boolean |
isImageDocument()
Indicates whether the displayed document is an image or not.
| ||||||||||
abstract boolean |
isUserInterfaceEnabled()
Indicates whether UI is enabled right now.
| ||||||||||
abstract boolean |
isUserInterfaceVisible()
Checks whether user interface controls are currently visible.
| ||||||||||
abstract void | removePropertyInspectorLifecycleListener(PropertyInspectorCoordinatorLayoutController.PropertyInspectorLifecycleListener lifecycleListener) | ||||||||||
abstract PdfFragment |
requirePdfFragment()
Returns the
PdfFragment that is used to show the document. | ||||||||||
abstract void | setAnnotationCreationInspectorController(AnnotationCreationInspectorController annotationCreationInspectorController) | ||||||||||
abstract void | setAnnotationEditingInspectorController(AnnotationEditingInspectorController annotationEditingInspectorController) | ||||||||||
abstract void |
setConfiguration(PdfActivityConfiguration configuration)
Replaces activity configuration.
| ||||||||||
abstract void |
setDocumentFromDataProvider(DataProvider dataProvider, String password)
Loads a new document in this activity and replaces the existing one.
| ||||||||||
abstract void |
setDocumentFromDataProviders(List<DataProvider> dataProviders, List<String> passwords)
Loads a new document in this pdf UI and replaces the existing one.
| ||||||||||
abstract void |
setDocumentFromUri(Uri documentUri, String password)
Loads a new document in this activity and replaces the existing one.
| ||||||||||
abstract void |
setDocumentFromUris(List<Uri> documentUris, List<String> passwords)
Loads a new document in this activity and replaces the existing one.
| ||||||||||
abstract void |
setDocumentInteractionEnabled(boolean documentInteractionEnabled)
Enables or disables interaction with the document.
| ||||||||||
abstract void | setDocumentPrintDialogFactory(DocumentPrintDialogFactory factory) | ||||||||||
abstract void | setDocumentSharingDialogFactory(DocumentSharingDialogFactory factory) | ||||||||||
abstract void | setOnContextualToolbarLifecycleListener(ToolbarCoordinatorLayout.OnContextualToolbarLifecycleListener lifecycleListener) | ||||||||||
abstract void | setOnContextualToolbarMovementListener(ToolbarCoordinatorLayout.OnContextualToolbarMovementListener movementListener) | ||||||||||
abstract void | setOnContextualToolbarPositionListener(ToolbarCoordinatorLayout.OnContextualToolbarPositionListener positionListener) | ||||||||||
abstract void |
setPageIndex(int pageIndex)
Sets page to be displayed in the current document.
| ||||||||||
abstract void |
setPageIndex(int pageIndex, boolean animate)
Sets page to be displayed in the current document.
| ||||||||||
abstract void | setPrintOptionsProvider(PrintOptionsProvider provider) | ||||||||||
abstract void |
setScreenTimeout(long screenTimeoutMillis)
Sets screen timeout in milliseconds that will be added to the predefined system timeout (that
is usually 1 minute).
| ||||||||||
abstract void | setSharingActionMenuListener(ActionMenuListener listener) | ||||||||||
abstract void | setSharingOptionsProvider(SharingOptionsProvider provider) | ||||||||||
abstract void |
setUserInterfaceEnabled(boolean userInterfaceEnabled)
Enables or disables the user interface.
| ||||||||||
abstract void |
setUserInterfaceViewMode(UserInterfaceViewMode userInterfaceViewMode)
Sets the activity user interface view mode at a runtime.
| ||||||||||
abstract void |
setUserInterfaceVisible(boolean show, boolean animate)
Show or hide user interface controls.
| ||||||||||
abstract void |
showUserInterface()
Animates user interface controls into view.
| ||||||||||
abstract void |
toggleUserInterface()
Toggles the visibility of user interface controls.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Parameter for setScreenTimeout(long)
used for restoring screen timeout to its
default system value.
Parameter for setScreenTimeout(long)
used for disabling screen timeout.
Returns the PdfActivityConfiguration
that was provided while launching this pdf UI.
Returns the PdfDocument
that is loaded into this pdf UI, or null
if no
document has been loaded yet.
Returns the coordinator responsible for displaying documents and switching between multiple loaded documents.
DocumentCoordinator
instance managing documents in this PdfUi
.
Returns object with inflated PSPDFKit views. This is meant to be used when extending this class for easier customization.
PSPDFKitViews.PSPDFView
instances.
Returns current page index set on the document.
Returns the PdfFragment
that is used to show the document.
null
if no document is being
displayed.
Gets screen timeout in milliseconds that has been added to the predefined system timeout,
TIMEOUT_DEFAULT
or TIMEOUT_INFINITE
.
TIMEOUT_DEFAULT
or TIMEOUT_INFINITE
.
Gets page sibling index (usable in double page mode).
pageIndex | Index of the page for which we look for the sibling. |
---|
-1
if there is none.
Return current user interface view mode that activity is using.
Animates user interface controls out of view. Does nothing if already hidden, USER_INTERFACE_VIEW_MODE_VISIBLE
is set or when user interface is
sticky - inline search is active, toolbar forces user interface to be visible etc.
Indicates whether interaction with the document is enabled right now.
true
when the user can interact with the document, false
otherwise.
Indicates whether the displayed document is an image or not.
true
if the displayed document is image, false
otherwise.
Indicates whether UI is enabled right now. UI is disabled when document is being saved/loaded, or when manually disabled.
true
when UI is enabled right now.
Checks whether user interface controls are currently visible.
true
if visible, false
otherwise.
Returns the PdfFragment
that is used to show the document. Throws an exception when
PdfFragment
is not yet initialized.
Replaces activity configuration. This method restarts the pdf UI to apply new configuration.
Note: This is a no-op when configuration has not changed.
configuration | The configuration to restart pdf UI with. |
---|
Loads a new document in this activity and replaces the existing one. This method may only be
called if onSaveInstanceState(Bundle)
has not been called or an exception
will be thrown, since after that call state loss could occur.
dataProvider | Data provider for the document. |
---|---|
password | Document password. May be null. |
Loads a new document in this pdf UI and replaces the existing one. This method may only be
called if onSaveInstanceState(Bundle)
has not been called or an exception
will be thrown, since after that call state loss could occur.
dataProviders | List of data providers for compound document. |
---|---|
passwords | List of passwords for compound document, may be null. |
Loads a new document in this activity and replaces the existing one. This method may only be
called if onSaveInstanceState(Bundle)
has not been called or an exception
will be thrown, since after that call state loss could occur.
documentUri | Document URI. |
---|---|
password | Document password. May be null .
|
IllegalStateException |
---|
Loads a new document in this activity and replaces the existing one. This method may only be
called if onSaveInstanceState(Bundle)
has not been called or an exception
will be thrown, since after that call state loss could occur.
documentUris | List of document URIs for compound document. |
---|---|
passwords | List of passwords for compound document, may be null. |
Enables or disables interaction with the document. When the interaction is disabled you can no longer scroll or zoom the document in any way, any other UI like the thumbnail bar is still enabled.
documentInteractionEnabled | true to enable interacting with the document,
false to disable it.
|
---|
Sets page to be displayed in the current document.
pageIndex | Index of the target page (starting at 0). |
---|
Sets page to be displayed in the current document.
pageIndex | Index of the target page (starting at 0). |
---|---|
animate | true if the transition to the specified page should be animated,
false otherwise.
|
Sets screen timeout in milliseconds that will be added to the predefined system timeout (that is usually 1 minute). I.e. setScreenTimeout(30 * 1000) will turn off the device screen in 90 seconds.
screenTimeoutMillis | can be a positive number, TIMEOUT_DEFAULT or TIMEOUT_INFINITE .
|
---|
Enables or disables the user interface. When the user interface is disabled all temporary UI elements (navigation buttons, redaction UI) are hidden, and all user interaction is disabled (no scrolling, no clicking on the thumbnail bar, no annotation editing).
userInterfaceEnabled | true to enable the UI, false to disable the UI.
|
---|
Sets the activity user interface view mode at a runtime. Overriding PdfActivityConfiguration
.
Show or hide user interface controls. This does not respect currently configured UserInterfaceViewMode
.
show | true to show user interface, false to hide it. |
---|---|
animate | true to animate the change.
|
Animates user interface controls into view. Does nothing if already showing, USER_INTERFACE_VIEW_MODE_HIDDEN
is set or when user interface is
forced to be hidden - for example when creating annotations and using vertical toolbar.
Toggles the visibility of user interface controls.