public interface

PSPDFKitViews

com.pspdfkit.ui.PSPDFKitViews

Class Overview

Interface for convenient access to views in a PSPDFKit activity.

Summary

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 Methods
abstract void addOnVisibilityChangedListener(OnVisibilityChangedListener listener)
Add on visibility changed listener to every instantiated view.
abstract PSPDFKitViews.Type getActiveViewType()
Returns currently displayed view over the document.
abstract AudioView getAudioInspector()
Returns currently instantiated AudioView.
abstract PdfDocumentInfoView getDocumentInfoView()
Returns currently instantiated PdfDocumentInfoView.
abstract TextView getDocumentTitleOverlayView()
Returns the currently instantiated document title view.
abstract View getEmptyView()
Returns currently instantiated view that is shown when no document is loaded.
abstract FormEditingBar getFormEditingBarView()
Returns currently instantiated FormEditingBar.
abstract View getNavigateBackButton()
Returns the currently instantiate navigate back button.
abstract View getNavigateForwardButton()
Returns the currently instantiate navigate forward button.
abstract PdfOutlineView getOutlineView()
Returns currently instantiated PdfOutlineView.
abstract TextView getPageNumberOverlayView()
Returns currently instantiated page number view.
abstract PdfReaderView getReaderView()
Returns currently instantiated PdfReaderView.
abstract RedactionView getRedactionView()
Returns currently instantiated RedactionView.
abstract PdfSearchView getSearchView()
Returns currently instantiated PdfSearchView.
abstract PdfTabBar getTabBar()
Returns the currently instantiated tab bar view.
abstract PdfThumbnailBar getThumbnailBarView()
Returns currently instantiated PdfThumbnailBar.
abstract PdfThumbnailGrid getThumbnailGridView()
Returns currently instantiated PdfThumbnailGrid.
abstract PSPDFKitViews.PSPDFView getViewByType(PSPDFKitViews.Type type)
Returns view by the specified type.
abstract void onRestoreViewHierarchyState(Bundle state)
Called after activity recreation, to restore state of views that otherwise wouldn't be restored.
abstract void onSaveViewHierarchyState(Bundle outState)
Called while persisting the activity to persist state of views that otherwise wouldn't be stored.
abstract void removeOnVisibilityChangedListener(OnVisibilityChangedListener listener)
Remove on visibility changed listener from every instantiated view.
abstract void resetDocument()
Reset/clear the document on all instantiated views.
abstract void setDocument(PdfDocument document)
Sets the document to all instantiated views.
abstract boolean showView(PSPDFKitViews.Type viewType)
Similar to toggleView(Type) but not hiding the view if it is already visible.
abstract boolean toggleView(PSPDFKitViews.Type typeToToggle, long showDelay)
Toggles the view with the specified type.
abstract boolean toggleView(PSPDFKitViews.Type typeToToggle)
Toggles the view with the specified type.

Public Methods

public abstract void addOnVisibilityChangedListener (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. Must be non-null.

public abstract PSPDFKitViews.Type getActiveViewType ()

Returns currently displayed view over the document.

Returns
  • Currently displayed view, or VIEW_NONE if none active.

public 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.

public 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

public 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.

public 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.

public 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.

public 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.

public 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.

public abstract PdfOutlineView getOutlineView ()

Returns currently instantiated PdfOutlineView.

Returns
  • Currently instantiated outline view or null if outline is deactivated by the current configuration.

public 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.

public 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.

public abstract RedactionView getRedactionView ()

Returns currently instantiated RedactionView.

Returns
  • Currently instantiated redaction view or null if redaction UI is deactivated by current configuration.

public abstract PdfSearchView getSearchView ()

Returns currently instantiated PdfSearchView.

Returns
  • Current active search view or null if search is deactivated by the current configuration.

public 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.

public abstract PdfThumbnailBar getThumbnailBarView ()

Returns currently instantiated PdfThumbnailBar.

Returns
  • Currently instantiated thumbnail bar or null if thumbnail bar is deactivated by the current configuration.

public abstract PdfThumbnailGrid getThumbnailGridView ()

Returns currently instantiated PdfThumbnailGrid.

Returns
  • Currently instantiated thumbnail grid or null if thumbnail grid is deactivated by the current configuration.

public abstract PSPDFKitViews.PSPDFView getViewByType (PSPDFKitViews.Type type)

Returns view by the specified type.

Parameters
type Type of the view to be returned

public abstract void onRestoreViewHierarchyState (Bundle state)

Called after activity recreation, to restore state of views that otherwise wouldn't be restored.

Parameters
state State that was restored.

public 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.

public abstract void removeOnVisibilityChangedListener (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. Adding null is not allowed,and will result in an exception.

Parameters
listener OnVisibilityChangedListener that should be removed from all views. Must be non-null.

public abstract void resetDocument ()

Reset/clear the document on all instantiated views.

public abstract void setDocument (PdfDocument document)

Sets the document to all instantiated views. This has to be called on the main thread.

Parameters
document Document to be set.

public abstract boolean showView (PSPDFKitViews.Type viewType)

Similar to toggleView(Type) but not hiding the view if it is already visible.

Parameters
viewType PSPDFKitViews.Type of the view to show.
Returns
  • true if the view was shown, or false if the view hierarchy was not changed.

public 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 toggled
showDelay Delay time until toggle.
Returns
  • true if toggle happened, false otherwise

public 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