Class ThumbnailAdapter
-
- All Implemented Interfaces:
public class ThumbnailAdapter extends RecyclerView.Adapter<VH>
Recycler adapter for creating thumbnail views inside the PdfScrollableThumbnailBar.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
ThumbnailAdapter.OnThumbnailClickListener
Listener for receiving page changes caused by the user touching the ThumbnailAdapter.
-
Field Summary
Fields Modifier and Type Field Description public int
thumbnailHeight
public int
thumbnailWidth
-
Method Summary
Modifier and Type Method Description int
getThumbnailHeight()
Returns the height of the thumbnails in thumbnail bar. void
setThumbnailHeight(@IntRange(from = 1) int thumbnailHeight)
Sets the height of the thumbnails in thumbnail bar. int
getThumbnailWidth()
Returns the width of the thumbnails in thumbnail bar. void
setThumbnailWidth(@IntRange(from = 1) int thumbnailWidth)
Sets the width of the thumbnails in thumbnail bar. int
getThumbnailBorderColor()
Returns the border color for the thumbnails in the thumbnail bar. void
setThumbnailBorderColor(@ColorInt() int borderColor)
Sets the border color for the thumbnails in the thumbnail bar. int
getSelectedThumbnailBorderColor()
Returns the border color for the selected thumbnail in the thumbnail bar. void
setSelectedThumbnailBorderColor(@ColorInt() int borderColor)
Sets the border color for the selected thumbnail in the thumbnail bar. ThumbnailAdapter.ThumbnailViewHolder
onCreateViewHolder(@NonNull() ViewGroup parent, int viewType)
void
onBindViewHolder(@NonNull() ThumbnailAdapter.ThumbnailViewHolder holder, int pageIndex)
int
getItemCount()
void
selectPage(@IntRange(from = 0) int currentPageIndex)
Sets selected page to highlight. void
setDrawableProviders(@NonNull() List<PdfDrawableProvider> drawableProviders)
-
-
Method Detail
-
getThumbnailHeight
@IntRange(from = 1) int getThumbnailHeight()
Returns the height of the thumbnails in thumbnail bar.
- Returns:
Height of thumbnails in pixels.
-
setThumbnailHeight
void setThumbnailHeight(@IntRange(from = 1) int thumbnailHeight)
Sets the height of the thumbnails in thumbnail bar.
- Parameters:
thumbnailHeight
- Height of thumbnails in pixels.
-
getThumbnailWidth
@IntRange(from = 1) int getThumbnailWidth()
Returns the width of the thumbnails in thumbnail bar.
- Returns:
Width of thumbnails in pixels.
-
setThumbnailWidth
void setThumbnailWidth(@IntRange(from = 1) int thumbnailWidth)
Sets the width of the thumbnails in thumbnail bar.
- Parameters:
thumbnailWidth
- Width of thumbnails in pixels.
-
getThumbnailBorderColor
@ColorInt() int getThumbnailBorderColor()
Returns the border color for the thumbnails in the thumbnail bar.
- Returns:
Border colors of thumbnails.
-
setThumbnailBorderColor
void setThumbnailBorderColor(@ColorInt() int borderColor)
Sets the border color for the thumbnails in the thumbnail bar.
- Parameters:
borderColor
- Border colors of thumbnails.
-
getSelectedThumbnailBorderColor
@ColorInt() int getSelectedThumbnailBorderColor()
Returns the border color for the selected thumbnail in the thumbnail bar.
- Returns:
Border colors of selected thumbnail.
-
setSelectedThumbnailBorderColor
void setSelectedThumbnailBorderColor(@ColorInt() int borderColor)
Sets the border color for the selected thumbnail in the thumbnail bar.
- Parameters:
borderColor
- Border colors of selected thumbnail.
-
onCreateViewHolder
ThumbnailAdapter.ThumbnailViewHolder onCreateViewHolder(@NonNull() ViewGroup parent, int viewType)
-
onBindViewHolder
void onBindViewHolder(@NonNull() ThumbnailAdapter.ThumbnailViewHolder holder, int pageIndex)
-
getItemCount
int getItemCount()
-
selectPage
void selectPage(@IntRange(from = 0) int currentPageIndex)
Sets selected page to highlight.
- Parameters:
currentPageIndex
- current page to highlight.
-
setDrawableProviders
void setDrawableProviders(@NonNull() List<PdfDrawableProvider> drawableProviders)
-
-
-
-