public final class

PdfOutlineView.OutlinePagerAdapter

extends ViewStatePagerAdapter
implements ViewPager.OnPageChangeListener
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 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 onPageScrollStateChanged(int state)
void onPageScrolled(int position, float positionOffset, int positionOffsetPixels)
void onPageSelected(int position)
void onShow()
Called when outline list gets shown.
void refreshItemsVisibility()
Refresh items visibility in the adapter.
void setDocument(PdfDocument document, PdfConfiguration configuration, OutlinePagerBaseView.OnHideListener onHideListener)
Sets the document to the adapter.
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
From interface androidx.viewpager.widget.ViewPager.OnPageChangeListener

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 onPageScrollStateChanged (int state)

public void onPageScrolled (int position, float positionOffset, int positionOffsetPixels)

public void onPageSelected (int position)

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

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.