public class

PdfStaticThumbnailBar

extends DocumentListenerViewGroup
implements PSPDFKitViews.PSPDFView PdfThumbnailBarController
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ com.pspdfkit.framework.views.utils.DocumentListenerViewGroup
         ↳ com.pspdfkit.ui.thumbnail.PdfStaticThumbnailBar

Class Overview

Bar showing thumbnails of pages for quick selection.

Summary

[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
PdfStaticThumbnailBar(Context context)
PdfStaticThumbnailBar(Context context, AttributeSet attrs)
PdfStaticThumbnailBar(Context context, AttributeSet attrs, int defStyleAttr)
PdfStaticThumbnailBar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
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.
int getBackgroundColor()
DocumentListener getDocumentListener()
ImageView getLeftSelectedImage()
PSPDFKitViews.Type getPSPDFViewType()
Returns the type of this view.
int getSelectedThumbnailBorderColor()
Returns the border color for the selected thumbnail in the thumbnail bar.
int getThumbnailBorderColor()
Returns the border color for the thumbnails in the thumbnail bar.
int getThumbnailHeight()
Returns the height of the thumbnails in thumbnail bar.
int getThumbnailOffsetX(int pageIndex)
int getThumbnailWidth()
Returns the width of the thumbnails in thumbnail bar.
void hide()
boolean isBackgroundTransparent()
boolean isDisplayed()
Called when the activity needs to know the visibility of this view.
boolean isRedactionAnnotationPreviewEnabled()
Returns redaction annotation preview mode, false by default.
boolean onInterceptTouchEvent(MotionEvent ev)
void onPageChanged(PdfDocument document, int pageIndex)
Called when user scrolled to a new page.
void onPageUpdated(PdfDocument document, int pageIndex)
Called when content of page with pageIndex has changed (for example due to annotation or form field being updated).
boolean onTouchEvent(MotionEvent event)
void removeOnVisibilityChangedListener(OnVisibilityChangedListener listener)
Unregister a previously registered listener that no longer wants to receive visibility change events.
static List<Integer> selectDoublePagesToShowInThumbnails(int documentPageCount, int maxThumbnails, boolean firstPageSingle)
static List<Integer> selectPagesToShowInThumbnails(int documentPageCount, int maxThumbnails)
void setBackgroundColor(int backgroundColor)
void setDocument(PdfDocument document, PdfConfiguration configuration)
Called when the document has been loaded and is going to be displayed.
void setDrawableProviders(List<PdfDrawableProvider> drawableProviders)
Sets PdfDrawableProviders to provide custom PdfDrawable to be displayed in a thumbnail bar page items.
void setOnPageChangedListener(PdfThumbnailBar.OnPageChangedListener onPageChangedListener)
Set a listener to be notified of page changing events.
void setRedactionAnnotationPreviewEnabled(boolean enable)
Sets redaction annotations preview as redacted.
void setSelectedThumbnailBorderColor(int borderColor)
Sets the border color for the selected thumbnail in the thumbnail bar.
void setThumbnailBorderColor(int borderColor)
Sets the border color for the thumbnails in the thumbnail bar.
void setThumbnailHeight(int thumbnailHeight)
Sets the height of the thumbnails in thumbnail bar.
void setThumbnailWidth(int thumbnailWidth)
Sets the width of the thumbnails in thumbnail bar.
void show()
Protected Methods
boolean fitSystemWindows(Rect insets)
void onDetachedFromWindow()
void onLayout(boolean changed, int l, int t, int r, int b)
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
void onSizeChanged(int w, int h, int oldw, int oldh)
[Expand]
Inherited Methods
From class com.pspdfkit.framework.views.utils.DocumentListenerViewGroup
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.listeners.DocumentListener
From interface com.pspdfkit.ui.PSPDFKitViews.PSPDFView
From interface com.pspdfkit.ui.thumbnail.PdfThumbnailBarController

Public Constructors

public PdfStaticThumbnailBar (Context context)

public PdfStaticThumbnailBar (Context context, AttributeSet attrs)

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

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

Public Methods

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 int getBackgroundColor ()

public DocumentListener getDocumentListener ()

public ImageView getLeftSelectedImage ()

public PSPDFKitViews.Type getPSPDFViewType ()

Returns the type of this view.

Returns

public int getSelectedThumbnailBorderColor ()

Returns the border color for the selected thumbnail in the thumbnail bar.

Returns
  • Border colors of selected thumbnail.

public int getThumbnailBorderColor ()

Returns the border color for the thumbnails in the thumbnail bar.

Returns
  • Border colors of thumbnails.

public int getThumbnailHeight ()

Returns the height of the thumbnails in thumbnail bar.

Returns
  • Height of thumbnails in pixels.

public int getThumbnailOffsetX (int pageIndex)

public int getThumbnailWidth ()

Returns the width of the thumbnails in thumbnail bar.

Returns
  • Width of thumbnails in pixels.

public void hide ()

public boolean isBackgroundTransparent ()

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

Returns redaction annotation preview mode, false by default.

Returns
  • true if redaction annotation preview mode is enabled, false otherwise.

public boolean onInterceptTouchEvent (MotionEvent ev)

public void onPageChanged (PdfDocument document, int pageIndex)

Called when user scrolled to a new page.

Parameters
document Currently opened document.
pageIndex Page number of new page.

public void onPageUpdated (PdfDocument document, int pageIndex)

Called when content of page with pageIndex has changed (for example due to annotation or form field being updated). All views displaying this page need to refresh.

Parameters
pageIndex Page index of the updated page. Page index is 0-based.

public boolean onTouchEvent (MotionEvent event)

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 static List<Integer> selectDoublePagesToShowInThumbnails (int documentPageCount, int maxThumbnails, boolean firstPageSingle)

public static List<Integer> selectPagesToShowInThumbnails (int documentPageCount, int maxThumbnails)

public void setBackgroundColor (int backgroundColor)

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 setDrawableProviders (List<PdfDrawableProvider> drawableProviders)

Sets PdfDrawableProviders to provide custom PdfDrawable to be displayed in a thumbnail bar page items.

public void setOnPageChangedListener (PdfThumbnailBar.OnPageChangedListener onPageChangedListener)

Set a listener to be notified of page changing events. Calling this method will replace any previously set listener. You may provide null to clear the listener.

Parameters
onPageChangedListener PdfThumbnailBar.OnPageChangedListener that should be notified, or null to clear the listener.

public void setRedactionAnnotationPreviewEnabled (boolean enable)

Sets redaction annotations preview as redacted.

Parameters
enable true to show redaction annotations as redacted, false to show them as marks.

public void setSelectedThumbnailBorderColor (int borderColor)

Sets the border color for the selected thumbnail in the thumbnail bar.

Parameters
borderColor Border colors of selected thumbnail.

public void setThumbnailBorderColor (int borderColor)

Sets the border color for the thumbnails in the thumbnail bar.

Parameters
borderColor Border colors of thumbnails.

public void setThumbnailHeight (int thumbnailHeight)

Sets the height of the thumbnails in thumbnail bar.

Parameters
thumbnailHeight Height of thumbnails in pixels.

public void setThumbnailWidth (int thumbnailWidth)

Sets the width of the thumbnails in thumbnail bar.

Parameters
thumbnailWidth Width of thumbnails in pixels.

public void show ()

Protected Methods

protected boolean fitSystemWindows (Rect insets)

protected void onDetachedFromWindow ()

protected void onLayout (boolean changed, int l, int t, int r, int b)

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)

protected void onSizeChanged (int w, int h, int oldw, int oldh)