public class

ThumbnailSlider

extends LinearLayout
implements View.OnClickListener PDFViewCtrl.DocumentLoadListener PDFViewCtrl.PageChangeListener PDFViewCtrl.ThumbAsyncListener
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.LinearLayout
         ↳ com.pdftron.pdf.controls.ThumbnailSlider
Known Direct Subclasses

Class Overview

The ThumbnailSlider uses the getThumbAsync(int) API to show thumbnails of the current page as the slider moves.

Summary

Nested Classes
@interface ThumbnailSlider.MenuItemPosition  
interface ThumbnailSlider.OnMenuItemClickedListener Callback interface to be invoked when a menu item in thumbnail slider clicked  
interface ThumbnailSlider.OnThumbnailSliderTrackingListener Callback interface to be invoked when a tracking touch event occurs. 
Constants
int POSITION_LEFT
int POSITION_RIGHT
[Expand]
Inherited Constants
From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
ThumbnailSlider(Context context)
Class constructor
ThumbnailSlider(Context context, AttributeSet attrs)
Class constructor
ThumbnailSlider(Context context, AttributeSet attrs, int defStyleAttr)
Class constructor
ThumbnailSlider(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Class constructor
Public Methods
void clearResources()
This method will free any bitmaps and other resources that are used internally by the control.
void dismiss(boolean isAnimate)
void dismiss()
void handleDocumentLoaded()
Handles when the document is loaded.
boolean isProgressChanging()
boolean isReversed()
void onClick(View v)
void onDocumentLoaded()
The overload implementation of onDocumentLoaded().
void onPageChange(int old_page, int cur_page, PDFViewCtrl.PageChangeState state)
Called in UI thread when the current page changes.
void onThumbReceived(int page, int[] buf, int width, int height)
The overload implementation of onThumbReceived(int, int[], int, int).
void refreshPageCount()
Refreshes the page count
void setMenuItem(Drawable icon, int position)
void setMenuItem(int drawableRes, int position)
void setMenuItemContentDescription(int position, String content)
void setMenuItemVisibility(int position, int visiblity)
void setOnMenuItemClickedListener(ThumbnailSlider.OnMenuItemClickedListener listener)
void setPdfViewCtrl(PDFViewCtrl pdfViewCtrl)
Sets the PDFViewCtrl.
void setProgress(int currentPage)
Sets the progress based on the current page.
void setReversed(boolean isReversed)
Reverses the seek bar.
void setThumbSliderListener(ThumbnailSlider.OnThumbnailSliderTrackingListener listener)
Sets the thumb slider listener.
void show()
void show(boolean isAnimate)
[Expand]
Inherited Methods
From class android.widget.LinearLayout
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.View.OnClickListener
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource
From interface com.pdftron.pdf.PDFViewCtrl.DocumentLoadListener
From interface com.pdftron.pdf.PDFViewCtrl.PageChangeListener
From interface com.pdftron.pdf.PDFViewCtrl.ThumbAsyncListener

Constants

public static final int POSITION_LEFT

Constant Value: 0 (0x00000000)

public static final int POSITION_RIGHT

Constant Value: 1 (0x00000001)

Public Constructors

public ThumbnailSlider (Context context)

Class constructor

public ThumbnailSlider (Context context, AttributeSet attrs)

Class constructor

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

Class constructor

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

Class constructor

Public Methods

public void clearResources ()

This method will free any bitmaps and other resources that are used internally by the control. Only call this method when the control is not going to be used anymore (e.g., on the onDestroy() of your Activity).

public void dismiss (boolean isAnimate)

public void dismiss ()

public void handleDocumentLoaded ()

Handles when the document is loaded.

public boolean isProgressChanging ()

Returns
  • True if progress is changing

public boolean isReversed ()

Returns
  • True if the seek bar is reversed

public void onClick (View v)

public void onDocumentLoaded ()

The overload implementation of onDocumentLoaded().

public void onPageChange (int old_page, int cur_page, PDFViewCtrl.PageChangeState state)

Called in UI thread when the current page changes.

Note: If state is BEGIN or END, values of old_page and cur_page are the same, which is the current page number. In continuous page presentation mode, state parameter is always END.

Parameters
old_page the old page number
cur_page the current (new) page number
state in non-continuous page presentation modes and when the built-in page sliding is in process, this flag is used to indicate the state of page change.

public void onThumbReceived (int page, int[] buf, int width, int height)

The overload implementation of onThumbReceived(int, int[], int, int).

Parameters
page the page number which this thumbnail refers to
buf the image data buffer
width the width of the bitmap
height the height of the bitmap

public void refreshPageCount ()

Refreshes the page count

public void setMenuItem (Drawable icon, int position)

public void setMenuItem (int drawableRes, int position)

public void setMenuItemContentDescription (int position, String content)

public void setMenuItemVisibility (int position, int visiblity)

public void setOnMenuItemClickedListener (ThumbnailSlider.OnMenuItemClickedListener listener)

public void setPdfViewCtrl (PDFViewCtrl pdfViewCtrl)

Sets the PDFViewCtrl.

Parameters
pdfViewCtrl The PDFViewCtrl

public void setProgress (int currentPage)

Sets the progress based on the current page.

Parameters
currentPage The current page

public void setReversed (boolean isReversed)

Reverses the seek bar.

Parameters
isReversed True if the seek bar should be reversed

public void setThumbSliderListener (ThumbnailSlider.OnThumbnailSliderTrackingListener listener)

Sets the thumb slider listener.

Parameters
listener The listener

public void show ()

public void show (boolean isAnimate)