PdfThumbnailBar

class PdfThumbnailBar @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = R.attr.pspdf__thumbnailBarStyle) : AbstractComposeView, PSPDFKitViews.PSPDFView, PdfDrawableManager

Bar showing thumbnails of pages for quick selection. This view extends AbstractComposeView and uses Jetpack Compose for rendering the static thumbnail bar modes (FLOATING and PINNED). For SCROLLABLE mode, it wraps the existing PdfScrollableThumbnailBar implementation.

To select the thumbnail bar mode/style, use setThumbnailBarMode method.

Constructors

Link copied to clipboard
constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = R.attr.pspdf__thumbnailBarStyle)

Types

Link copied to clipboard
fun interface OnPageChangedListener

Listener for receiving page changes caused by the user touching or dragging the PdfThumbnailBar.

Properties

Link copied to clipboard

The document listener for the thumbnail bar.

Link copied to clipboard

Returns whether the thumbnail bar background is transparent.

Link copied to clipboard
open override val isDisplayed: Boolean
Link copied to clipboard

Whether the redaction annotation preview mode is enabled or not. When true, redaction annotations are shown as redacted. When false, redaction annotations are shown as marks.

Link copied to clipboard

Functions

Link copied to clipboard
open override fun addDrawableProvider(drawableProvider: PdfDrawableProvider)

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.

Link copied to clipboard

Register a listener that would like to receive visibility change events. Whenever the visibility of a managed PSPDFView changes, all registered listeners will be notified.

Link copied to clipboard
open override fun 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.

Link copied to clipboard
open override fun Content()

Compose content that renders the thumbnail bar based on the current ThumbnailBarMode.

Link copied to clipboard
open override fun dispatchTouchEvent(ev: MotionEvent): Boolean

Dispatches touch events, consuming all events when the view is disabled.

Link copied to clipboard

Returns the current type of this view.

Link copied to clipboard

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

Link copied to clipboard
fun getThumbnailBarMode(): ERROR CLASS: Symbol not found for ThumbnailBarMode

Returns the current thumbnail bar mode.

Link copied to clipboard

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

Link copied to clipboard

Returns the height of the thumbnails in thumbnail bar.

Link copied to clipboard
@IntRange(from = 1)
fun getThumbnailWidth(): Int

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.

Link copied to clipboard
open override fun hide()

No-op for PdfThumbnailBar.

Link copied to clipboard
open override fun isDisplayed(): Boolean

Called when the activity needs to know the visibility of this view. Returns true if this view is visible, otherwise returns false.

Link copied to clipboard
open override fun removeDrawableProvider(drawableProvider: PdfDrawableProvider)

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

Link copied to clipboard

Unregister a previously registered listener that no longer wants to receive visibility change events.

Link copied to clipboard
open override fun setBackgroundColor(@ColorInt backgroundColor: Int)

Sets the background color for the thumbnail bar.

Link copied to clipboard
open override fun setDocument(document: PdfDocument, configuration: PdfConfiguration)

Called when the document has been loaded and is going to be displayed. This has to be called on the main thread.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard
fun setThumbnailBarMode(mode: ERROR CLASS: Symbol not found for ThumbnailBarMode)

Sets thumbnail bar mode whether static or scrollable.

Link copied to clipboard

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

Link copied to clipboard
fun setThumbnailHeight(@IntRange(from = 1) thumbnailHeight: Int)

Sets the height of the thumbnails in thumbnail bar.

Link copied to clipboard
fun setThumbnailWidth(@IntRange(from = 1) thumbnailWidth: Int)

Sets the width of the thumbnails in thumbnail bar. This has no effect if isUsingPageAspectRatio is set to true.

Link copied to clipboard
open override fun show()

No-op for PdfThumbnailBar.