| java.lang.Object | |
| ↳ | com.pspdfkit.ui.PSPDFKitViews |
Class for convenient access of views in a PSPDFKit activity. This class is deliberately not marked final so that it can
be mocked in tests.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| interface | PSPDFKitViews.PSPDFView | Shared interface of all auxiliary views (search view, thumbnail bar, grid, etc.) that are hosted inside the PdfActivity. |
|||||||||
| enum | PSPDFKitViews.Type | Known auxiliary view types. | |||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| PSPDFKitViews(View rootView, PdfActivityConfiguration configuration) | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void |
addOnVisibilityChangedListener(OnVisibilityChangedListener listener)
Add on visibility changed listener to every instantiated view.
| ||||||||||
| PSPDFKitViews.Type |
getActiveViewType()
Returns currently displayed view over the document.
| ||||||||||
| TextView |
getDocumentTitleOverlayView()
Returns the currently instantiated document title view.
| ||||||||||
| View |
getEmptyView()
Returns currently instantiated view that is shown when no document is loaded.
| ||||||||||
| FormEditingBar |
getFormEditingBarView()
Returns currently instantiated
FormEditingBar. | ||||||||||
| PdfFragment |
getFragment()
Returns currently instantiated fragment.
| ||||||||||
| View |
getNavigateBackButton()
Returns the currently instantiate navigate back button.
| ||||||||||
| View |
getNavigateForwardButton()
Returns the currently instantiate navigate forward button.
| ||||||||||
| PdfOutlineView |
getOutlineView()
Returns currently instantiated
PdfOutlineView. | ||||||||||
| TextView |
getPageNumberOverlayView()
Returns currently instantiated page number view.
| ||||||||||
| RedactionView |
getRedactionView()
Returns currently instantiated
RedactionView. | ||||||||||
| PdfSearchView |
getSearchView()
Returns currently instantiated
PdfSearchView. | ||||||||||
| PdfTabBar |
getTabBar()
Returns the currently instantiated tab bar view.
| ||||||||||
| PdfThumbnailBar |
getThumbnailBarView()
Returns currently instantiated
PdfThumbnailBar. | ||||||||||
| PdfThumbnailGrid |
getThumbnailGridView()
Returns currently instantiated
PdfThumbnailGrid. | ||||||||||
| PSPDFKitViews.PSPDFView |
getViewByType(PSPDFKitViews.Type type)
Returns view by the specified type.
| ||||||||||
| void |
onRestoreViewHierarchyState(Bundle state)
Called after activity recreation, to restore state of views that otherwise wouldn't be restored.
| ||||||||||
| void |
onSaveViewHierarchyState(Bundle outState)
Called while persisting the activity to persist state of views that otherwise wouldn't be stored.
| ||||||||||
| void |
removeOnVisibilityChangedListener(OnVisibilityChangedListener listener)
Remove on visibility changed listener from every instantiated view.
| ||||||||||
| void |
resetDocument()
Reset/clear the document on all instantiated views.
| ||||||||||
| void |
setDocument(PdfDocument document)
Sets the document to all instantiated views.
| ||||||||||
| boolean |
showView(PSPDFKitViews.Type viewType)
Similar to
toggleView(Type) but not hiding the view if it is already visible. | ||||||||||
| boolean |
toggleView(PSPDFKitViews.Type typeToToggle, long showDelay)
Toggles the view with the specified type.
| ||||||||||
| boolean |
toggleView(PSPDFKitViews.Type typeToToggle)
Toggles the view with the specified type.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Add on visibility changed listener to every instantiated view.
If the listener has already been added previously, this method will be a no-op.
Adding null is not allowed, and will result in an exception.
| listener | OnVisibilityChangedListener that should be notified. Must be non-null. |
|---|
Returns currently displayed view over the document.
VIEW_NONE if none active.
Returns the currently instantiated document title view.
null if document title overlay is deactivated by the current configuration.
Returns currently instantiated view that is shown when no document is loaded.
null if no view is set.
Returns currently instantiated FormEditingBar.
null if form editing bar is deactivated by the current configuration.
Returns currently instantiated fragment.
PdfFragment, or null if no document is displayed.
Returns the currently instantiate navigate back button.
null if navigation buttons are deactivated by the current configuration.
Returns the currently instantiate navigate forward button.
null if navigation buttons are deactivated by the current configuration.
Returns currently instantiated PdfOutlineView.
null if outline is deactivated by the current configuration.
Returns currently instantiated page number view.
null if page number overlay is deactivated by the current configuration.
Returns currently instantiated RedactionView.
null if redaction UI is deactivated by current configuration.
Returns currently instantiated PdfSearchView.
null if search is deactivated by the current configuration.
Returns the currently instantiated tab bar view.
null if tab bar is deactivated in the current configuration.
Returns currently instantiated PdfThumbnailBar.
null if thumbnail bar is deactivated by the current configuration.
Returns currently instantiated PdfThumbnailGrid.
null if thumbnail grid is deactivated by the current configuration.
Returns view by the specified type.
| type | Type of the view to be returned |
|---|
Called after activity recreation, to restore state of views that otherwise wouldn't be restored.
| state | State that was restored. |
|---|
Called while persisting the activity to persist state of views that otherwise wouldn't be stored.
| outState | Outgoing bundle on which to save the state. |
|---|
Remove on visibility changed listener from every instantiated view.
Upon calling this method the listener will no longer be notified of any changes.
If the listener has not been added, this method will be a no-op.
Adding null is not allowed,and will result in an exception.
| listener | OnVisibilityChangedListener that should be removed from all views. Must be non-null. |
|---|
Reset/clear the document on all instantiated views.
Sets the document to all instantiated views.
| document | Document to be set. |
|---|
Similar to toggleView(Type) but not hiding the view if it is already visible.
| viewType | PSPDFKitViews.Type of the view to show. |
|---|
true if the view was shown, or false if the view hierarchy was not changed.
Toggles the view with the specified type. If VIEW_NONE just hide the active one.
| typeToToggle | Type of the view to be toggled |
|---|---|
| showDelay | Delay time until toggle. |
true if toggle happened, false otherwise
Toggles the view with the specified type. If VIEW_NONE just hide the active one.
| typeToToggle | Type of the view to be toggled. |
|---|
true if toggle happened, false otherwise