Interface PSPDFKitViews
-
- All Implemented Interfaces:
public interface PSPDFKitViews
Interface for convenient access to views in a PSPDFKit activity.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
PSPDFKitViews.Type
Known auxiliary view types. Implementations of PSPDFView should return one of these types from getPSPDFViewType.
public interface
PSPDFKitViews.PSPDFView
Shared interface of all auxiliary views (search view, thumbnail bar, grid, etc.) that are hosted inside the PdfActivity.
-
Method Summary
Modifier and Type Method Description abstract PdfOutlineView
getOutlineView()
Returns currently instantiated PdfOutlineView. abstract PdfDocumentInfoView
getDocumentInfoView()
Returns currently instantiated PdfDocumentInfoView. abstract PdfReaderView
getReaderView()
Returns currently instantiated PdfReaderView. abstract TextView
getPageNumberOverlayView()
Returns currently instantiated page number view. abstract TextView
getDocumentTitleOverlayView()
Returns the currently instantiated document title view. abstract PdfTabBar
getTabBar()
Returns the currently instantiated tab bar view. abstract View
getNavigateBackButton()
Returns the currently instantiate navigate back button. abstract View
getNavigateForwardButton()
Returns the currently instantiate navigate forward button. abstract PdfSearchView
getSearchView()
Returns currently instantiated PdfSearchView. abstract PdfThumbnailBar
getThumbnailBarView()
Returns currently instantiated PdfThumbnailBar. abstract PdfThumbnailGrid
getThumbnailGridView()
Returns currently instantiated PdfThumbnailGrid. abstract FormEditingBar
getFormEditingBarView()
Returns currently instantiated FormEditingBar. abstract ContentEditingStylingBar
getContentEditingStylingBarView()
Returns currently instantiated ContentEditingStylingBar. abstract AudioView
getAudioInspector()
Returns currently instantiated AudioView. abstract RedactionView
getRedactionView()
Returns currently instantiated RedactionView. abstract MeasurementScaleView
getMeasurementScaleView()
Returns currently instantiated MeasurementScaleView. abstract View
getEmptyView()
Returns currently instantiated view that is shown when no document is loaded. abstract PSPDFKitViews.PSPDFView
getViewByType(PSPDFKitViews.Type type)
Returns view by the specified type. abstract PSPDFKitViews.Type
getActiveViewType()
Returns currently displayed view over the document. abstract boolean
toggleView(PSPDFKitViews.Type typeToToggle)
Toggles the view with the specified type. abstract boolean
toggleView(PSPDFKitViews.Type typeToToggle, long showDelay)
Toggles the view with the specified type. abstract boolean
showView(PSPDFKitViews.Type viewType)
Similar to toggleView but not hiding the view if it is already visible. abstract void
setDocument(@NonNull() PdfDocument document)
Sets the document to all instantiated views. abstract void
addOnVisibilityChangedListener(@NonNull() OnVisibilityChangedListener listener)
Add on visibility changed listener to every instantiated view. abstract void
removeOnVisibilityChangedListener(@NonNull() OnVisibilityChangedListener listener)
Remove on visibility changed listener from every instantiated view. abstract void
resetDocument()
Reset/clear the document on all instantiated views. abstract void
onSaveViewHierarchyState(Bundle outState)
Called while persisting the activity to persist state of views that otherwise wouldn't be stored. abstract void
onRestoreViewHierarchyState(@NonNull() Bundle state)
Called after activity recreation, to restore state of views that otherwise wouldn't be restored. abstract ViewGroup
getCreateTextBlockButtonsContainer()
container view for the create-textblock buttons abstract FloatingActionButton
getMainPageCreateTextBlockButton()
create-textblock button for the main page abstract FloatingActionButton
getSecondPageCreateTextBlockButton()
create-textblock button for the second page (in double page mode) -
-
Method Detail
-
getOutlineView
@Nullable() abstract PdfOutlineView getOutlineView()
Returns currently instantiated PdfOutlineView.
- Returns:
Currently instantiated outline view or
null
if outline is deactivated by the current configuration.
-
getDocumentInfoView
@Nullable() abstract PdfDocumentInfoView getDocumentInfoView()
Returns currently instantiated PdfDocumentInfoView.
- Returns:
Currently instantiated document info view view or
null
if document info view is not separated from the outline view
-
getReaderView
@Nullable() abstract PdfReaderView getReaderView()
Returns currently instantiated PdfReaderView.
- Returns:
Currently instantiated reader view or
null
if deactivated by the current configuration or not supported on the device as Android Web View is not present.
-
getPageNumberOverlayView
@Nullable() abstract TextView getPageNumberOverlayView()
Returns currently instantiated page number view.
- Returns:
Currently instantiated page number view or
null
if page number overlay is deactivated by the current configuration.
-
getDocumentTitleOverlayView
@Nullable() abstract TextView getDocumentTitleOverlayView()
Returns the currently instantiated document title view.
- Returns:
Currently instantiated document title view or
null
if document title overlay is deactivated by the current configuration.
-
getTabBar
@Nullable() abstract PdfTabBar getTabBar()
Returns the currently instantiated tab bar view.
- Returns:
Currently instantiated tab bar view or
null
if tab bar is deactivated in the current configuration.
-
getNavigateBackButton
@Nullable() abstract View getNavigateBackButton()
Returns the currently instantiate navigate back button.
- Returns:
Currently instantiated navigate back button or
null
if navigation buttons are deactivated by the current configuration.
-
getNavigateForwardButton
@Nullable() abstract View getNavigateForwardButton()
Returns the currently instantiate navigate forward button.
- Returns:
Currently instantiated navigate forward button or
null
if navigation buttons are deactivated by the current configuration.
-
getSearchView
@Nullable() abstract PdfSearchView getSearchView()
Returns currently instantiated PdfSearchView.
- Returns:
Current active search view or
null
if search is deactivated by the current configuration.
-
getThumbnailBarView
@Nullable() abstract PdfThumbnailBar getThumbnailBarView()
Returns currently instantiated PdfThumbnailBar.
- Returns:
Currently instantiated thumbnail bar or
null
if thumbnail bar is deactivated by the current configuration.
-
getThumbnailGridView
@Nullable() abstract PdfThumbnailGrid getThumbnailGridView()
Returns currently instantiated PdfThumbnailGrid.
- Returns:
Currently instantiated thumbnail grid or
null
if thumbnail grid is deactivated by the current configuration.
-
getFormEditingBarView
@Nullable() abstract FormEditingBar getFormEditingBarView()
Returns currently instantiated FormEditingBar.
- Returns:
Currently instantiated form editing bar or
null
if form editing bar is deactivated by the current configuration.
-
getContentEditingStylingBarView
@Nullable() abstract ContentEditingStylingBar getContentEditingStylingBarView()
Returns currently instantiated ContentEditingStylingBar.
- Returns:
Currently instantiated content editing bar or
null
if content editing bar is deactivated by the current configuration.
-
getAudioInspector
@Nullable() abstract AudioView getAudioInspector()
Returns currently instantiated AudioView.
- Returns:
Currently instantiated audio inspector or
null
if audio inspector is deactivated by the current configuration or was not present in the activity layout.
-
getRedactionView
@Nullable() abstract RedactionView getRedactionView()
Returns currently instantiated RedactionView.
- Returns:
Currently instantiated redaction view or
null
if redaction UI is deactivated by current configuration.
-
getMeasurementScaleView
@Nullable() abstract MeasurementScaleView getMeasurementScaleView()
Returns currently instantiated MeasurementScaleView.
- Returns:
Currently instantiated measurement scale view
-
getEmptyView
@Nullable() abstract View getEmptyView()
Returns currently instantiated view that is shown when no document is loaded.
- Returns:
The view that is shown when no document is loaded, or
null
if no view is set.
-
getViewByType
@Nullable() abstract PSPDFKitViews.PSPDFView getViewByType(PSPDFKitViews.Type type)
Returns view by the specified type.
- Parameters:
type
- Type of the view to be returned
-
getActiveViewType
@NonNull() abstract PSPDFKitViews.Type getActiveViewType()
Returns currently displayed view over the document.
- Returns:
Currently displayed view, or VIEW_NONE if none active.
-
toggleView
abstract boolean toggleView(PSPDFKitViews.Type typeToToggle)
Toggles the view with the specified type. If VIEW_NONE just hide the active one.
- Parameters:
typeToToggle
- Type of the view to be toggled.- Returns:
true
if toggle happened,false
otherwise
-
toggleView
abstract boolean toggleView(PSPDFKitViews.Type typeToToggle, long showDelay)
Toggles the view with the specified type. If VIEW_NONE just hide the active one.
- Parameters:
typeToToggle
- Type of the view to be toggledshowDelay
- Delay time until toggle.- Returns:
true
if toggle happened,false
otherwise
-
showView
abstract boolean showView(PSPDFKitViews.Type viewType)
Similar to toggleView but not hiding the view if it is already visible.
- Parameters:
viewType
- Type of the view to show.- Returns:
true
if the view was shown, orfalse
if the view hierarchy was not changed.
-
setDocument
@UiThread() abstract void setDocument(@NonNull() PdfDocument document)
Sets the document to all instantiated views. This has to be called on the main thread.
- Parameters:
document
- Document to be set.
-
addOnVisibilityChangedListener
abstract void addOnVisibilityChangedListener(@NonNull() OnVisibilityChangedListener listener)
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.- Parameters:
listener
- OnVisibilityChangedListener that should be notified.
-
removeOnVisibilityChangedListener
abstract void removeOnVisibilityChangedListener(@NonNull() OnVisibilityChangedListener listener)
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. Addingnull
is not allowed,and will result in an exception.- Parameters:
listener
- OnVisibilityChangedListener that should be removed from all views.
-
resetDocument
abstract void resetDocument()
Reset/clear the document on all instantiated views.
-
onSaveViewHierarchyState
abstract void onSaveViewHierarchyState(Bundle outState)
Called while persisting the activity to persist state of views that otherwise wouldn't be stored.
- Parameters:
outState
- Outgoing bundle on which to save the state.
-
onRestoreViewHierarchyState
abstract void onRestoreViewHierarchyState(@NonNull() Bundle state)
Called after activity recreation, to restore state of views that otherwise wouldn't be restored.
- Parameters:
state
- State that was restored.
-
getCreateTextBlockButtonsContainer
@Nullable() abstract ViewGroup getCreateTextBlockButtonsContainer()
container view for the create-textblock buttons
-
getMainPageCreateTextBlockButton
@Nullable() abstract FloatingActionButton getMainPageCreateTextBlockButton()
create-textblock button for the main page
-
getSecondPageCreateTextBlockButton
@Nullable() abstract FloatingActionButton getSecondPageCreateTextBlockButton()
create-textblock button for the second page (in double page mode)
-
-
-
-