Package com.pspdfkit.ui
Class PdfOutlineView.OutlinePagerAdapter
-
- All Implemented Interfaces:
-
androidx.viewpager.widget.ViewPager.OnPageChangeListener
public final class PdfOutlineView.OutlinePagerAdapter extends ViewStatePagerAdapter implements ViewPager.OnPageChangeListener
A state pager adapter controlling the pager items (outline view and annotation list view) that saves and restores View states.
-
-
Method Summary
Modifier and Type Method Description boolean
isOutlineListViewAvailable()
boolean
isDocumentInfoListViewAvailable()
void
refreshItemsVisibility()
Refresh items visibility in the adapter. int
getItemTabButtonId(int position)
Returns item tab button id. int
getPositionOfItemWithTabButtonId(@IdRes() int tabButtonId)
Returns the position of item with given tab button id. void
setDocument(@Nullable() PdfDocument document, @Nullable() PdfConfiguration configuration, @NonNull() OutlinePagerBaseView.OnHideListener onHideListener)
Sets the document to the adapter. void
onShow()
Called when outline list gets shown. void
onHide()
int
getCount()
int
getItemPosition(@NonNull() Object object)
CharSequence
getPageTitle(int position)
void
onPageScrolled(int position, float positionOffset, int positionOffsetPixels)
void
onPageSelected(int position)
void
onPageScrollStateChanged(int state)
-
-
Method Detail
-
isOutlineListViewAvailable
boolean isOutlineListViewAvailable()
-
isDocumentInfoListViewAvailable
boolean isDocumentInfoListViewAvailable()
-
refreshItemsVisibility
@UiThread() void refreshItemsVisibility()
Refresh items visibility in the adapter. This has to be called on the main thread.
-
getItemTabButtonId
@IdRes() int getItemTabButtonId(int position)
Returns item tab button id.
- Parameters:
position
- Position of the desired tab button.- Returns:
Tab button's id.
-
getPositionOfItemWithTabButtonId
int getPositionOfItemWithTabButtonId(@IdRes() 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.
-
setDocument
void setDocument(@Nullable() PdfDocument document, @Nullable() PdfConfiguration configuration, @NonNull() OutlinePagerBaseView.OnHideListener onHideListener)
Sets the document to the adapter. Called on the main thread.
- Parameters:
document
- Document to be set.configuration
- The configurationonHideListener
- Outline pager callbacks.
-
onShow
void onShow()
Called when outline list gets shown.
-
onHide
void onHide()
-
getCount
int getCount()
-
getItemPosition
int getItemPosition(@NonNull() Object object)
-
getPageTitle
CharSequence getPageTitle(int position)
-
onPageScrolled
void onPageScrolled(int position, float positionOffset, int positionOffsetPixels)
-
onPageSelected
void onPageSelected(int position)
-
onPageScrollStateChanged
void onPageScrollStateChanged(int state)
-
-
-
-