public class

PdfOutlineView

extends FrameLayout
implements OutlinePagerBaseView.OnHideListener PSPDFKitViews.PSPDFView PdfDrawableManager
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.pspdfkit.ui.PdfOutlineView
Known Direct Subclasses

Class Overview

A layout containing the tab on the top and a view pager for switching between the outline, the list of annotations and the bookmarks.

Summary

Nested Classes
interface PdfOutlineView.DocumentOutlineProvider Interface to objects that provide outline elements. 
interface PdfOutlineView.OnAnnotationTapListener Annotation list tap listener. 
interface PdfOutlineView.OnOutlineElementTapListener Outline element tap listener. 
class PdfOutlineView.OutlinePagerAdapter A state pager adapter controlling the pager items (outline view and annotation list view) that saves and restores View states. 
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
PdfOutlineView(Context context)
PdfOutlineView(Context context, AttributeSet attrs)
PdfOutlineView(Context context, AttributeSet attrs, int defStyleAttr)
PdfOutlineView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
void addDrawableProvider(PdfDrawableProvider drawableProvider)
Adds a PdfDrawableProvider to be managed by this object.
void addOnDocumentInfoViewModeChangeListener(OnDocumentInfoViewModeChangeListener listener)
Adds the listener for the editing mode changes on this document info view.
void addOnDocumentInfoViewSaveListener(OnDocumentInfoViewSaveListener listener)
Adds the listener for saving the document info changes.
void addOnVisibilityChangedListener(OnVisibilityChangedListener listener)
Register a listener that would like to receive visibility change events.
void clearDocument()
Called by the activity when the view should unbind the previously set document.
DocumentListener getDocumentListener()
Returns the document listener this PdfOutlineView uses.
boolean getMayContainDocumentInfoView()
PSPDFKitViews.Type getPSPDFViewType()
Returns the current type of this view.
void hide()
Hides the outline view (scroll up animation).
boolean isDisplayed()
Called when the activity needs to know the visibility of this view.
boolean onTouchEvent(MotionEvent event)
void refreshViewPager()
Refreshes the view pager adapter and binds it to the pager tabs.
void removeDrawableProvider(PdfDrawableProvider drawableProvider)
Removes a previously added PdfDrawableProvider.
void removeOnDocumentInfoViewModeChangeListener(OnDocumentInfoViewModeChangeListener listener)
Removes the listener for the editing mode changes on this document info view.
void removeOnDocumentInfoViewSaveListener(OnDocumentInfoViewSaveListener listener)
Removes the listener for saving the document info changes.
void removeOnVisibilityChangedListener(OnVisibilityChangedListener listener)
Unregister a previously registered listener that no longer wants to receive visibility change events.
void setAnnotationEditingEnabled(boolean annotationEditingEnabled)
Enables additional controls in the annotation outline view to delete annotations.
void setAnnotationListReorderingEnabled(boolean enable)
Sets whether reordering of annotations in the annotation list is enabled.
void setAnnotationListViewEnabled(boolean annotationListViewEnabled, boolean refreshViewPager)
Enables annotation list view.
void setAnnotationListViewEnabled(boolean annotationListViewEnabled)
Enables annotation list view.
void setBookmarkAdapter(BookmarkViewAdapter adapter)
Sets an adapter that handles actual bookmark data.
void setBookmarkEditingEnabled(boolean bookmarkEditingEnabled)
Allows bookmark view to edit annotations.
void setBookmarkRenamingEnabled(boolean bookmarkRenamingEnabled)
Allows bookmark view to rename annotations.
void setBookmarkViewEnabled(boolean bookmarkViewEnabled)
Enables bookmark view.
void setBookmarkViewEnabled(boolean bookmarkViewEnabled, boolean refreshViewPager)
Enables bookmark view.
void setDocument(PdfDocument document, PdfConfiguration configuration)
Called when the document has been loaded and is going to be displayed.
void setDocumentInfoViewEnabled(boolean documentInfoViewEnabled)
Enables document info view.
void setDocumentInfoViewEnabled(boolean documentInfoViewEnabled, boolean refreshViewPager)
Enables document info view.
void setDocumentOutlineProvider(PdfOutlineView.DocumentOutlineProvider outlineProvider)
Sets PdfOutlineView.DocumentOutlineProvider that should be used as a source of outline elements in the outline list instead of document outline.
void setListedAnnotationTypes(EnumSet<AnnotationType> listedAnnotationTypes)
Sets annotation types to be listed (if the annotation list is enabled).
void setMayContainDocumentInfoView(boolean may)
void setOnAnnotationTapListener(PdfOutlineView.OnAnnotationTapListener onAnnotationTapListener)
Sets a listener to be notified of annotation tap events.
void setOnOutlineElementTapListener(PdfOutlineView.OnOutlineElementTapListener onOutlineElementTapListener)
Sets a listener to be notified of outline tap events.
void setOutlineViewEnabled(boolean outlineViewEnabled, boolean refreshViewPager)
Enables outline view.
void setOutlineViewEnabled(boolean outlineViewEnabled)
Enables outline view.
void setRedactionAnnotationPreviewEnabled(boolean redactionAnnotationPreviewEnabled)
void setShowPageLabels(boolean showPageLabels)
Provide API for controlling content of the PdfOutlineView.
void setUndoManager(UndoManager undoManager)
Sets the UndoManager used for tracking annotations removed from the annotation list.
void setVisibility(int visibility)
void show()
Shows the outline view (scroll down animation).
Protected Methods
boolean fitSystemWindows(Rect insets)
void onAttachedToWindow()
void onDetachedFromWindow()
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
boolean shouldDisplayAnnotationListView()
boolean shouldDisplayBookmarkListView()
boolean shouldDisplayDocumentInfoListView()
boolean shouldDisplayOutlineView()
[Expand]
Inherited Methods
From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource
From interface com.pspdfkit.internal.views.outline.OutlinePagerBaseView.OnHideListener
From interface com.pspdfkit.ui.PSPDFKitViews.PSPDFView
From interface com.pspdfkit.ui.drawable.PdfDrawableManager

Public Constructors

public PdfOutlineView (Context context)

public PdfOutlineView (Context context, AttributeSet attrs)

public PdfOutlineView (Context context, AttributeSet attrs, int defStyleAttr)

public PdfOutlineView (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public Methods

public void addDrawableProvider (PdfDrawableProvider drawableProvider)

Adds a PdfDrawableProvider to be managed by this object. If the provider has been added previously, this method will be a no-op. Adding null is not allowed, and will result in an exception.

Parameters
drawableProvider PdfDrawableProvider whose drawable instances should be managed (e.g. rendered on screen).

public void addOnDocumentInfoViewModeChangeListener (OnDocumentInfoViewModeChangeListener listener)

Adds the listener for the editing mode changes on this document info view.

Parameters
listener Listener for mode changes to be added.

public void addOnDocumentInfoViewSaveListener (OnDocumentInfoViewSaveListener listener)

Adds the listener for saving the document info changes.

Parameters
listener Listener to be added.

public void addOnVisibilityChangedListener (OnVisibilityChangedListener listener)

Register a listener that would like to receive visibility change events. Whenever the visibility of a managed PSPDFKitViews.PSPDFView changes, all registered listeners will be notified.

Parameters
listener Listener to be added.

public void clearDocument ()

Called by the activity when the view should unbind the previously set document. This may be called in low-memory situations or prior to re-binding another document.

public DocumentListener getDocumentListener ()

Returns the document listener this PdfOutlineView uses.

public boolean getMayContainDocumentInfoView ()

public PSPDFKitViews.Type getPSPDFViewType ()

Returns the current type of this view.

Returns

public void hide ()

Hides the outline view (scroll up animation).

public boolean isDisplayed ()

Called when the activity needs to know the visibility of this view. Returns true if this view is visible, otherwise returns false.

public boolean onTouchEvent (MotionEvent event)

public void refreshViewPager ()

Refreshes the view pager adapter and binds it to the pager tabs. This has to be called on the main thread.

public void removeDrawableProvider (PdfDrawableProvider drawableProvider)

Removes a previously added PdfDrawableProvider. If the provider hasn't been added previously, this method will be a no-op.

Parameters
drawableProvider PdfDrawableProvider that should be removed. Must be non-null.

public void removeOnDocumentInfoViewModeChangeListener (OnDocumentInfoViewModeChangeListener listener)

Removes the listener for the editing mode changes on this document info view.

Parameters
listener Listener for mode changes to be removed.

public void removeOnDocumentInfoViewSaveListener (OnDocumentInfoViewSaveListener listener)

Removes the listener for saving the document info changes.

Parameters
listener Listener to be removed.

public void removeOnVisibilityChangedListener (OnVisibilityChangedListener listener)

Unregister a previously registered listener that no longer wants to receive visibility change events.

Parameters
listener Listener to be removed.

public void setAnnotationEditingEnabled (boolean annotationEditingEnabled)

Enables additional controls in the annotation outline view to delete annotations.

Parameters
annotationEditingEnabled If true additional buttons to delete single or all annotations are shown.

public void setAnnotationListReorderingEnabled (boolean enable)

Sets whether reordering of annotations in the annotation list is enabled. This defaults to true.

Parameters
enable true to enable reordering annotations in the annotation list.

public void setAnnotationListViewEnabled (boolean annotationListViewEnabled, boolean refreshViewPager)

Enables annotation list view.

Parameters
annotationListViewEnabled If true, annotation list view will be shown.
refreshViewPager If true, the view pager will be refreshed.

public void setAnnotationListViewEnabled (boolean annotationListViewEnabled)

Enables annotation list view.

Parameters
annotationListViewEnabled If true, annotation list view will be shown.

public void setBookmarkAdapter (BookmarkViewAdapter adapter)

Sets an adapter that handles actual bookmark data.

Parameters
adapter Adapter that providers bookmark view with data and handles data changes.

public void setBookmarkEditingEnabled (boolean bookmarkEditingEnabled)

Allows bookmark view to edit annotations.

Parameters
bookmarkEditingEnabled If true, bookmarks can be edited.

public void setBookmarkRenamingEnabled (boolean bookmarkRenamingEnabled)

Allows bookmark view to rename annotations.

Parameters
bookmarkRenamingEnabled If true, bookmarks can be renamed.

public void setBookmarkViewEnabled (boolean bookmarkViewEnabled)

Enables bookmark view.

Parameters
bookmarkViewEnabled If true, bookmark list view will be shown.

public void setBookmarkViewEnabled (boolean bookmarkViewEnabled, boolean refreshViewPager)

Enables bookmark view.

Parameters
bookmarkViewEnabled If true, bookmark list view will be shown.
refreshViewPager If true, the view pager will be refreshed.

public void setDocument (PdfDocument document, PdfConfiguration configuration)

Called when the document has been loaded and is going to be displayed. This has to be called on the main thread.

Parameters
document Loaded PdfDocument.
configuration Containing document and presentation settings.

public void setDocumentInfoViewEnabled (boolean documentInfoViewEnabled)

Enables document info view.

Parameters
documentInfoViewEnabled If true, document info view will be shown.

public void setDocumentInfoViewEnabled (boolean documentInfoViewEnabled, boolean refreshViewPager)

Enables document info view.

Parameters
documentInfoViewEnabled If true, document info view will be shown.
refreshViewPager If true, the view pager will be refreshed.

public void setDocumentOutlineProvider (PdfOutlineView.DocumentOutlineProvider outlineProvider)

Sets PdfOutlineView.DocumentOutlineProvider that should be used as a source of outline elements in the outline list instead of document outline.

Note that the PdfOutlineView.DocumentOutlineProvider is not retained when restarting the Activity to prevent memory leaks. It's responsibility of the caller of this API to make sure that the custom outline provider is restored after the activity is restarted.

Parameters
outlineProvider Outline provider to use or null to use default outline from the document.

public void setListedAnnotationTypes (EnumSet<AnnotationType> listedAnnotationTypes)

Sets annotation types to be listed (if the annotation list is enabled).

Parameters
listedAnnotationTypes List of annotation types to be displayed in the annotation list.

public void setMayContainDocumentInfoView (boolean may)

public void setOnAnnotationTapListener (PdfOutlineView.OnAnnotationTapListener onAnnotationTapListener)

Sets a listener to be notified of annotation tap events. Calling this method will replace any previously set listener. You may provide null to clear the listener.

Parameters
onAnnotationTapListener PdfOutlineView.OnAnnotationTapListener that should be notified, or null to clear the listener.

public void setOnOutlineElementTapListener (PdfOutlineView.OnOutlineElementTapListener onOutlineElementTapListener)

Sets a listener to be notified of outline tap events. Calling this method will replace any previously set listener. You may provide null to clear the listener.

Parameters
onOutlineElementTapListener PdfOutlineView.OnOutlineElementTapListener that should be notified, or null to clear the listener.

public void setOutlineViewEnabled (boolean outlineViewEnabled, boolean refreshViewPager)

Enables outline view.

Parameters
outlineViewEnabled If true, outline view will be shown.
refreshViewPager If true, the view pager will be refreshed.

public void setOutlineViewEnabled (boolean outlineViewEnabled)

Enables outline view.

Parameters
outlineViewEnabled If true, outline view will be shown.

public void setRedactionAnnotationPreviewEnabled (boolean redactionAnnotationPreviewEnabled)

public void setShowPageLabels (boolean showPageLabels)

Provide API for controlling content of the PdfOutlineView. Set should the outline view show page labels. If disabled, only page numbers are shown.

Parameters
showPageLabels If true, page labels will be displayed in outline (if any).

public void setUndoManager (UndoManager undoManager)

Sets the UndoManager used for tracking annotations removed from the annotation list.

public void setVisibility (int visibility)

public void show ()

Shows the outline view (scroll down animation).

Protected Methods

protected boolean fitSystemWindows (Rect insets)

protected void onAttachedToWindow ()

protected void onDetachedFromWindow ()

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)

protected boolean shouldDisplayAnnotationListView ()

protected boolean shouldDisplayBookmarkListView ()

protected boolean shouldDisplayDocumentInfoListView ()

protected boolean shouldDisplayOutlineView ()