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

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.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.
PSPDFKitViews.Type getPSPDFViewType()
Returns the 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 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 setListedAnnotationTypes(EnumSet<AnnotationType> listedAnnotationTypes)
Sets annotation types to be listed (if the annotation list is enabled).
void setOnAnnotationTapListener(PdfOutlineView.OnAnnotationTapListener onAnnotationTapListener)
Set a listener to be notified of annotation tap events.
void setOnOutlineElementTapListener(PdfOutlineView.OnOutlineElementTapListener onOutlineElementTapListener)
Set 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 enable)
void setShowPageLabels(boolean showPageLabels)
Provide API for controlling content of the PdfOutlineView.
void show()
Shows the outline view (scroll down animation).
Protected Methods
boolean fitSystemWindows(Rect insets)
void onDraw(Canvas canvas)
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
[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.framework.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 PSPDFKitViews.Type getPSPDFViewType ()

Returns the 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 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 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 setOnAnnotationTapListener (PdfOutlineView.OnAnnotationTapListener onAnnotationTapListener)

Set 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)

Set 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 enable)

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 show ()

Shows the outline view (scroll down animation).

Protected Methods

protected boolean fitSystemWindows (Rect insets)

protected void onDraw (Canvas canvas)

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)