public final class

PdfOutlineView.OutlinePagerAdapter

extends ViewStatePagerAdapter
java.lang.Object
   ↳ androidx.viewpager.widget.PagerAdapter
     ↳ com.pspdfkit.ui.ViewStatePagerAdapter
       ↳ com.pspdfkit.ui.PdfOutlineView.OutlinePagerAdapter

Class Overview

A state pager adapter controlling the pager items (outline view and annotation list view) that saves and restores View states.

Summary

[Expand]
Inherited Constants
From class androidx.viewpager.widget.PagerAdapter
Public Constructors
OutlinePagerAdapter()
Public Methods
int getCount()
int getItemPosition(Object object)
int getItemTabButtonId(int position)
Returns item tab button id.
CharSequence getPageTitle(int position)
int getPositionOfItemWithTabButtonId(int tabButtonId)
Returns the position of item with given tab button id.
void onHide()
Called when outline list gets hidden.
void onShow()
Called when outline list gets shown.
void refreshItemsVisibility()
Refresh items visibility in the adapter.
void setAnnotationEditingEnabled(boolean annotationEditingEnabled)
Enables or disables the annotation editing controls for the annotation list view.
void setBookmarkEditingEnabled(boolean bookmarkEditingEnabled)
Enables or disables bookmark editing controls for the bookmarks list view.
void setBookmarkRenamingEnabled(boolean bookmarkRenamingEnabled)
Enables or disables bookmark renaming.
void setCurrentPageIndex(int pageIndex)
void setDocument(PdfDocument document, PdfConfiguration configuration, OutlinePagerBaseView.OnHideListener onHideListener)
Sets the document to the adapter.
void setListedAnnotationTypes(EnumSet<AnnotationType> listedAnnotationTypes)
Set annotation types to be listed in the annotation list view.
void setRedactionAnnotationPreviewEnabled(boolean redactionAnnotationPreviewEnabled)
void setShowPageLabels(boolean showPageLabels)
Sets whether to show page labels or not.
Protected Methods
View createView(ViewGroup container, int position)
Creates the page for the given position to be attached to its container.
void destroyView(ViewGroup container, int position, View view)
Removes a page for the given position.
[Expand]
Inherited Methods
From class com.pspdfkit.ui.ViewStatePagerAdapter
From class androidx.viewpager.widget.PagerAdapter
From class java.lang.Object

Public Constructors

public OutlinePagerAdapter ()

Public Methods

public int getCount ()

public int getItemPosition (Object object)

public int getItemTabButtonId (int position)

Returns item tab button id.

Parameters
position Position of the desired tab button.
Returns
  • Tab button's id.

public CharSequence getPageTitle (int position)

public int getPositionOfItemWithTabButtonId (int tabButtonId)

Returns the position of item with given tab button id.

Parameters
tabButtonId Tab button id we're looking for.
Returns
  • Position or -1 if not found.

public void onHide ()

Called when outline list gets hidden.

public void onShow ()

Called when outline list gets shown.

public void refreshItemsVisibility ()

Refresh items visibility in the adapter. This has to be called on the main thread.

public void setAnnotationEditingEnabled (boolean annotationEditingEnabled)

Enables or disables the annotation editing controls for the annotation list view.

public void setBookmarkEditingEnabled (boolean bookmarkEditingEnabled)

Enables or disables bookmark editing controls for the bookmarks list view.

public void setBookmarkRenamingEnabled (boolean bookmarkRenamingEnabled)

Enables or disables bookmark renaming.

public void setCurrentPageIndex (int pageIndex)

public void setDocument (PdfDocument document, PdfConfiguration configuration, OutlinePagerBaseView.OnHideListener onHideListener)

Sets the document to the adapter. Called on the main thread.

Parameters
document Document to be set.
configuration The configuration
onHideListener Outline pager callbacks.

public void setListedAnnotationTypes (EnumSet<AnnotationType> listedAnnotationTypes)

Set annotation types to be listed in the annotation list view.

Parameters
listedAnnotationTypes Annotation types to be listed in the view.

public void setRedactionAnnotationPreviewEnabled (boolean redactionAnnotationPreviewEnabled)

public void setShowPageLabels (boolean showPageLabels)

Sets whether to show page labels or not.

Parameters
showPageLabels true to show page labels, false otherwise.

Protected Methods

protected View createView (ViewGroup container, int position)

Creates the page for the given position to be attached to its container.

Parameters
container The containing View in which the page will be shown.
position The page position to be instantiated.
Returns
  • Returns a View representing the new page, must not be null.

protected void destroyView (ViewGroup container, int position, View view)

Removes a page for the given position.

Parameters
container The containing View from which the page will be removed.
position The page position to be removed.
view The page to be removed.