public class

PdfThumbnailBar

extends PdfFrameLayout
implements PSPDFKitViews.PSPDFView PdfDrawableManager
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.pspdfkit.ui.PdfFrameLayout
           ↳ com.pspdfkit.ui.PdfThumbnailBar

Class Overview

Bar showing thumbnails of pages for quick selection. This class is basically a wrapper view around the actual thumbnail bar implementations, like PdfStaticThumbnailBar and PdfScrollableThumbnailBar. It will handle all the logic for thumbnail bar implementations so it's recommended that you use it directly, if adding thumbnail bar as a component to your custom layout. To select the thumbnail bar mode/style, use setThumbnailBarMode(ThumbnailBarMode) method.

Summary

Nested Classes
interface PdfThumbnailBar.OnPageChangedListener Listener for receiving page changes caused by the user touching or dragging the PdfThumbnailBar
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
PdfThumbnailBar(Context context)
PdfThumbnailBar(Context context, AttributeSet attrs)
PdfThumbnailBar(Context context, AttributeSet attrs, int defStyleAttr)
PdfThumbnailBar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
void addDrawableProvider(PdfDrawableProvider drawableProvider)
Adds a PdfDrawableProvider to be managed by this object.
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.
boolean dispatchTouchEvent(MotionEvent ev)
DocumentListener getDocumentListener()
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 getThumbnailWidth()
Returns the width of the thumbnails in thumbnail bar.
void hide()
No-op for PdfThumbnailBar.
boolean isBackgroundTransparent()
boolean isDisplayed()
Called when the activity needs to know the visibility of this view.
boolean isRedactionAnnotationPreviewEnabled()
Returns whether the redaction annotation preview mode is enabled or not.
void removeDrawableProvider(PdfDrawableProvider drawableProvider)
Removes a previously added PdfDrawableProvider.
void removeOnVisibilityChangedListener(OnVisibilityChangedListener listener)
Unregister a previously registered listener that no longer wants to receive visibility change events.
void setBackgroundColor(int backgroundColor)
Sets the background color for the thumbnail bar.
void setDocument(PdfDocument document, PdfConfiguration configuration)
Called when the document has been loaded and is going to be displayed.
final void setOnPageChangedListener(PdfThumbnailBar.OnPageChangedListener onPageChangedListener)
Register a listener that is notified whenever the user changed the page on the thumbnail bar.
void setRedactionAnnotationPreviewEnabled(boolean enable)
Enables or disables redaction annotation preview mode.
void setSelectedThumbnailBorderColor(int borderColor)
Sets the border color for the selected thumbnail in the thumbnail bar.
void setThumbnailBarMode(ThumbnailBarMode thumbnailBarMode)
Sets thumbnail bar mode whether static or scrollable.
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()
No-op for PdfThumbnailBar.
Protected Methods
boolean fitSystemWindows(Rect insets)
[Expand]
Inherited Methods
From class com.pspdfkit.ui.PdfFrameLayout
From class android.widget.FrameLayout
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.ui.PSPDFKitViews.PSPDFView
From interface com.pspdfkit.ui.drawable.PdfDrawableManager

Public Constructors

public PdfThumbnailBar (Context context)

public PdfThumbnailBar (Context context, AttributeSet attrs)

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

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

Public Methods

public void addDrawableProvider (PdfDrawableProvider drawableProvider)

Adds a PdfDrawableProvider to be managed by this object. If the provider has been added previously, this method will be a no-op. Adding null is not allowed, and will result in an exception.

Parameters
drawableProvider PdfDrawableProvider whose drawable instances should be managed (e.g. rendered on screen).

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 boolean dispatchTouchEvent (MotionEvent ev)

public DocumentListener getDocumentListener ()

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

Returns the width of the thumbnails in thumbnail bar.

Returns
  • Width of thumbnails in pixels.

public void hide ()

No-op for PdfThumbnailBar.

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 whether the redaction annotation preview mode is enabled or not.

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

public void removeDrawableProvider (PdfDrawableProvider drawableProvider)

Removes a previously added PdfDrawableProvider. If the provider hasn't been added previously, this method will be a no-op.

Parameters
drawableProvider PdfDrawableProvider that should be removed. Must be non-null.

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)

Sets the background color for the thumbnail bar.

Parameters
backgroundColor Thumbnail bar background color.

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 final void setOnPageChangedListener (PdfThumbnailBar.OnPageChangedListener onPageChangedListener)

Register a listener that is notified whenever the user changed the page on the thumbnail bar.

Parameters
onPageChangedListener Listener to be registered.

public void setRedactionAnnotationPreviewEnabled (boolean enable)

Enables or disables redaction annotation preview mode.

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 setThumbnailBarMode (ThumbnailBarMode thumbnailBarMode)

Sets thumbnail bar mode whether static or scrollable.

Parameters
thumbnailBarMode Thumbnail bar mode to set.

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

No-op for PdfThumbnailBar.

Protected Methods

protected boolean fitSystemWindows (Rect insets)