public class

PdfStaticThumbnailBar

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

Class Overview

Bar showing thumbnails of pages for quick selection.

Summary

Nested Classes
enum PdfStaticThumbnailBar.LayoutStyle A PdfStaticThumbnailBar has two possible layout styles, depending on how it's planned to be used. 
[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.
View focusSearch(View focused, int direction)
int getBackgroundColor()
DocumentListener getDocumentListener()
PdfStaticThumbnailBar.LayoutStyle getLayoutStyle()
Gets layout style of this thumbnail bar.
ImageView getLeftSelectedImage()
PSPDFKitViews.Type getPSPDFViewType()
Returns the current 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 isUsingPageAspectRatio()
Returns whether the page aspect ratio is used to determine the thumbnail width.
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.
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 setLayoutStyle(PdfStaticThumbnailBar.LayoutStyle layoutStyle)
Sets layout style of the thumbnail bar.
void setOnPageChangedListener(PdfThumbnailBar.OnPageChangedListener onPageChangedListener)
Sets 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 setUsePageAspectRatio(boolean usePageAspectRatio)
Configures the thumbnail bar to use the page aspect ratio to calculate the thumbnail width.
void show()
Protected Methods
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.internal.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 View focusSearch (View focused, int direction)

public int getBackgroundColor ()

public DocumentListener getDocumentListener ()

public PdfStaticThumbnailBar.LayoutStyle getLayoutStyle ()

Gets layout style of this thumbnail bar.

Returns
  • Layout style used in this thumbnail bar.

public ImageView getLeftSelectedImage ()

public PSPDFKitViews.Type getPSPDFViewType ()

Returns the current 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. In the case where isUsingPageAspectRatio() is true this will return the actual width of the first thumbnail.

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

Returns whether the page aspect ratio is used to determine the thumbnail width.

Returns
  • true if the thumbnail width is calculated based on the page aspect ratio and thumbnail height, false if the thumbnail width is used as configured.

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 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 setLayoutStyle (PdfStaticThumbnailBar.LayoutStyle layoutStyle)

Sets layout style of the thumbnail bar.

Parameters
layoutStyle Layout style to be set on this thumbnail bar.

public void setOnPageChangedListener (PdfThumbnailBar.OnPageChangedListener onPageChangedListener)

Sets 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. This has no effect if isUsingPageAspectRatio() is set to true.

Parameters
thumbnailWidth Width of thumbnails in pixels.

public void setUsePageAspectRatio (boolean usePageAspectRatio)

Configures the thumbnail bar to use the page aspect ratio to calculate the thumbnail width.

Parameters
usePageAspectRatio true to automatically calculate the thumbnail width based on the page aspect ratio and thumbnail height, false to use the configured thumbnail width.

public void show ()

Protected Methods

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)