Interface PdfThumbnailBarController
-
- All Implemented Interfaces:
public interface PdfThumbnailBarController
Thumbnail bar controller used to control properties and actions of scrollable and static thumbnail bar.
-
-
Method Summary
Modifier and Type Method Description abstract void
setDrawableProviders(List<PdfDrawableProvider> drawableProviders)
Sets PdfDrawableProviders to provide custom PdfDrawable to be displayed in a thumbnail bar page items. abstract DocumentListener
getDocumentListener()
abstract void
setDocument(@NonNull() PdfDocument document, @NonNull() PdfConfiguration configuration)
abstract void
addOnVisibilityChangedListener(@NonNull() OnVisibilityChangedListener listener)
Adds a listener to be notified of visibility change. abstract void
removeOnVisibilityChangedListener(@NonNull() OnVisibilityChangedListener listener)
Removes a previously added visibility change listener. abstract void
setOnPageChangedListener(@Nullable() PdfThumbnailBar.OnPageChangedListener onPageChangedListener)
Sets a listener to be notified of page changing events. abstract void
clearDocument()
abstract boolean
isBackgroundTransparent()
abstract int
getBackgroundColor()
abstract void
setBackgroundColor(@ColorInt() int backgroundColor)
Sets the background color for the thumbnail bar. abstract int
getThumbnailWidth()
Returns the width of the thumbnails in thumbnail bar. abstract void
setThumbnailWidth(@IntRange(from = 1) int thumbnailWidth)
Sets the width of the thumbnails in thumbnail bar. abstract int
getThumbnailHeight()
Returns the height of the thumbnails in thumbnail bar. abstract void
setThumbnailHeight(@IntRange(from = 1) int thumbnailHeight)
Sets the height of the thumbnails in thumbnail bar. abstract boolean
isUsingPageAspectRatio()
Returns whether the page aspect ratio is used to determine the thumbnail width. abstract void
setUsePageAspectRatio(boolean usePageAspectRatio)
Configures the thumbnail bar to use the page aspect ratio to calculate the thumbnail width. abstract int
getThumbnailBorderColor()
Returns the border color for the thumbnails in the thumbnail bar. abstract void
setThumbnailBorderColor(@ColorInt() int borderColor)
Sets the border color for the thumbnails in the thumbnail bar. abstract int
getSelectedThumbnailBorderColor()
Returns the border color for the selected thumbnail in the thumbnail bar. abstract void
setSelectedThumbnailBorderColor(@ColorInt() int borderColor)
Sets the border color for the selected thumbnail in the thumbnail bar. abstract boolean
isRedactionAnnotationPreviewEnabled()
Returns redaction annotation preview mode, false
by default.abstract void
setRedactionAnnotationPreviewEnabled(boolean enable)
Sets redaction annotations preview as redacted. -
-
Method Detail
-
setDrawableProviders
abstract void setDrawableProviders(List<PdfDrawableProvider> drawableProviders)
Sets PdfDrawableProviders to provide custom PdfDrawable to be displayed in a thumbnail bar page items.
-
getDocumentListener
@NonNull() abstract DocumentListener getDocumentListener()
-
setDocument
abstract void setDocument(@NonNull() PdfDocument document, @NonNull() PdfConfiguration configuration)
-
addOnVisibilityChangedListener
abstract void addOnVisibilityChangedListener(@NonNull() OnVisibilityChangedListener listener)
Adds a listener to be notified of visibility change. If the listener has already been added previously, this method will be a no-op. Adding
null
is not allowed, and will result in an exception.- Parameters:
listener
- OnVisibilityChangedListener that should be notified.
-
removeOnVisibilityChangedListener
abstract void removeOnVisibilityChangedListener(@NonNull() OnVisibilityChangedListener listener)
Removes a previously added visibility change listener. Upon calling this method the
listener
will no longer be notified of any changes. If the listener has not been added, this method will be a no-op. Addingnull
is not allowed,and will result in an exception.- Parameters:
listener
- OnVisibilityChangedListener that should be removed.
-
setOnPageChangedListener
abstract void setOnPageChangedListener(@Nullable() 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
- OnPageChangedListener that should be notified, ornull
to clear the listener.
-
clearDocument
abstract void clearDocument()
-
isBackgroundTransparent
abstract boolean isBackgroundTransparent()
-
getBackgroundColor
@ColorInt() abstract int getBackgroundColor()
-
setBackgroundColor
abstract void setBackgroundColor(@ColorInt() int backgroundColor)
Sets the background color for the thumbnail bar.
- Parameters:
backgroundColor
- Thumbnail bar background color.
-
getThumbnailWidth
@IntRange(from = 1) abstract 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.
-
setThumbnailWidth
abstract void setThumbnailWidth(@IntRange(from = 1) 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.
-
getThumbnailHeight
@IntRange(from = 1) abstract int getThumbnailHeight()
Returns the height of the thumbnails in thumbnail bar.
- Returns:
Height of thumbnails in pixels.
-
setThumbnailHeight
abstract void setThumbnailHeight(@IntRange(from = 1) int thumbnailHeight)
Sets the height of the thumbnails in thumbnail bar.
- Parameters:
thumbnailHeight
- Height of thumbnails in pixels.
-
isUsingPageAspectRatio
abstract 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.
-
setUsePageAspectRatio
abstract 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.
-
getThumbnailBorderColor
@ColorInt() abstract int getThumbnailBorderColor()
Returns the border color for the thumbnails in the thumbnail bar.
- Returns:
Border colors of thumbnails.
-
setThumbnailBorderColor
abstract void setThumbnailBorderColor(@ColorInt() int borderColor)
Sets the border color for the thumbnails in the thumbnail bar.
- Parameters:
borderColor
- Border colors of thumbnails.
-
getSelectedThumbnailBorderColor
@ColorInt() abstract int getSelectedThumbnailBorderColor()
Returns the border color for the selected thumbnail in the thumbnail bar.
- Returns:
Border colors of selected thumbnail.
-
setSelectedThumbnailBorderColor
abstract void setSelectedThumbnailBorderColor(@ColorInt() int borderColor)
Sets the border color for the selected thumbnail in the thumbnail bar.
- Parameters:
borderColor
- Border colors of selected thumbnail.
-
isRedactionAnnotationPreviewEnabled
abstract boolean isRedactionAnnotationPreviewEnabled()
Returns redaction annotation preview mode,
false
by default.- Returns:
true
if redaction annotation preview mode is enabled,false
otherwise.
-
setRedactionAnnotationPreviewEnabled
abstract 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.
-
-
-
-