public class

ThumbnailsViewAdapter

extends SimpleRecyclerViewAdapter<T, VH extends ViewHolder>
implements PDFViewCtrl.ThumbAsyncListener PasswordDialogFragment.PasswordDialogFragmentListener
java.lang.Object
   ↳
     ↳ com.pdftron.pdf.widget.recyclerview.SimpleRecyclerViewAdapter<T, VH extends RecyclerView.ViewHolder>
       ↳ com.pdftron.pdf.controls.ThumbnailsViewAdapter

Class Overview

A Recycler view adapter for loading thumbnail views

Summary

Nested Classes
enum ThumbnailsViewAdapter.DocumentFormat The format of document  
interface ThumbnailsViewAdapter.EditPagesListener Callback interface to be invoked when pages of the document have been edited. 
Public Constructors
ThumbnailsViewAdapter(Context context, ThumbnailsViewAdapter.EditPagesListener listener, FragmentManager fragmentManager, PDFViewCtrl pdfViewCtrl, List<Integer> dataList, int spanCount, ViewHolderBindListener bindListener)
Class constructor
Public Methods
void add(Integer item)
The overload implementation of add(Object).
void addAll(List<Integer> data)
void addDocPages(int position, ThumbnailsViewAdapter.DocumentFormat documentFormat, Object data, String password)
Adds document pages at the specified (zero-indexed) position, or to end of file if position is -1.
void addDocPages(int position, ThumbnailsViewAdapter.DocumentFormat documentFormat, Object data)
Adds document pages at the specified (zero-indexed) position, or to end of file if position is -1.
void clear()
void clearResources()
Clears resources.
void duplicateDocPages(List<Integer> pageList)
Duplicates pages.
void finish()
Cleans up resources
int getCurrentPage()
boolean getDocPagesModified()
Integer getItem(int position)
The overload implementation of getItem(int).
int getItemCount()
The overload implementation of SimpleRecyclerViewAdapter#getItemCount().
int getPositionForPage(int pageNum)
void insert(Integer item, int position)
The overload implementation of insert(Object, int).
void onBindViewHolder(ThumbnailsViewAdapter.PageViewHolder holder, int position)
The overload implementation of onBindViewHolder(RecyclerView.ViewHolder, int).
ThumbnailsViewAdapter.PageViewHolder onCreateViewHolder(ViewGroup parent, int viewType)
The overload implementation of SimpleRecyclerViewAdapter#onCreateViewHolder(ViewGroup, int).
void onDetachedFromRecyclerView(RecyclerView recyclerView)
The overload implementation of onDetachedFromRecyclerView(RecyclerView).
void onItemDismiss(int position)
The overload implementation of ItemTouchHelperAdapter#onItemDismiss(int).
void onItemDrop(int fromPosition, int toPosition)
The overload implementation of ItemTouchHelperAdapter#onItemDrop(int, int).
boolean onItemMove(int fromPosition, int toPosition)
The overload implementation of ItemTouchHelperAdapter#onItemMove(int, int).
void onPasswordDialogDismiss(boolean forcedDismiss)
void onPasswordDialogNegativeClick(int fileType, File file, String path)
void onPasswordDialogPositiveClick(int fileType, File file, String path, String password, String id)
void onThumbReceived(int page, int[] buf, int width, int height)
The overload implementation of onThumbReceived(int, int[], int, int).
boolean remove(Integer item)
The overload implementation of remove(Object).
Integer removeAt(int location)
The overload implementation of removeAt(int).
void removeDocPage(int pageNum)
Removes a document page.
void rotateDocPage(int pageNum)
Rotates the document page.
void setCurrentPage(int pageNum)
Sets the current page.
void setData(List<Integer> data)
static void setDebug(boolean debug)
void setItem(int position, int data)
void updateAfterAddition(List<Integer> pageList)
Updates the adapter after pages addition.
void updateAfterDeletion(List<Integer> pageList)
Updates the adapter after pages deletion.
void updateAfterMove(int fromPageNum, int toPageNum)
Updates the adapter after page movement.
void updateAfterPageLabelEdit()
Updates the adapter after editing page labels.
void updateAfterRotation(List<Integer> pageList)
Updates the adapter after pages rotation.
void updateMainViewWidth(int width)
Updates the main view width
int updatePageNumberOnDelete(int deletedPage)
Updates the page numbers after deleting a page
void updateSpanCount(int count)
The overload implementation of updateSpanCount(int).
[Expand]
Inherited Methods
From class com.pdftron.pdf.widget.recyclerview.SimpleRecyclerViewAdapter
From class java.lang.Object
From interface com.pdftron.pdf.PDFViewCtrl.ThumbAsyncListener
From interface com.pdftron.pdf.controls.PasswordDialogFragment.PasswordDialogFragmentListener

Public Constructors

public ThumbnailsViewAdapter (Context context, ThumbnailsViewAdapter.EditPagesListener listener, FragmentManager fragmentManager, PDFViewCtrl pdfViewCtrl, List<Integer> dataList, int spanCount, ViewHolderBindListener bindListener)

Class constructor

Public Methods

public void add (Integer item)

The overload implementation of add(Object).

Parameters
item The item

public void addAll (List<Integer> data)

public void addDocPages (int position, ThumbnailsViewAdapter.DocumentFormat documentFormat, Object data, String password)

Adds document pages at the specified (zero-indexed) position, or to end of file if position is -1. Lastly scroll to newly created page, if necessary

Parameters
position The position where the pages are inserted to
documentFormat The document format
data The extra data including page(s)
password The document password

public void addDocPages (int position, ThumbnailsViewAdapter.DocumentFormat documentFormat, Object data)

Adds document pages at the specified (zero-indexed) position, or to end of file if position is -1. Lastly scroll to newly created page, if necessary

Parameters
position The position where the pages are added on
documentFormat The document format
data The extra data including page(s)

public void clear ()

public void clearResources ()

Clears resources.

public void duplicateDocPages (List<Integer> pageList)

Duplicates pages.

Parameters
pageList The list of pages to be duplicated

public void finish ()

Cleans up resources

public int getCurrentPage ()

Returns
  • The current page

public boolean getDocPagesModified ()

Returns
  • True if the the pages of the document have been modified

public Integer getItem (int position)

The overload implementation of getItem(int).

Parameters
position The position
Returns
  • The item

public int getItemCount ()

The overload implementation of SimpleRecyclerViewAdapter#getItemCount().

public int getPositionForPage (int pageNum)

public void insert (Integer item, int position)

The overload implementation of insert(Object, int).

Parameters
item The item
position The position

public void onBindViewHolder (ThumbnailsViewAdapter.PageViewHolder holder, int position)

The overload implementation of onBindViewHolder(RecyclerView.ViewHolder, int).

public ThumbnailsViewAdapter.PageViewHolder onCreateViewHolder (ViewGroup parent, int viewType)

The overload implementation of SimpleRecyclerViewAdapter#onCreateViewHolder(ViewGroup, int).

public void onDetachedFromRecyclerView (RecyclerView recyclerView)

The overload implementation of onDetachedFromRecyclerView(RecyclerView).

public void onItemDismiss (int position)

The overload implementation of ItemTouchHelperAdapter#onItemDismiss(int).

public void onItemDrop (int fromPosition, int toPosition)

The overload implementation of ItemTouchHelperAdapter#onItemDrop(int, int).

public boolean onItemMove (int fromPosition, int toPosition)

The overload implementation of ItemTouchHelperAdapter#onItemMove(int, int).

public void onPasswordDialogDismiss (boolean forcedDismiss)

Parameters
forcedDismiss True if the dialog is forced to dismiss

public void onPasswordDialogNegativeClick (int fileType, File file, String path)

Parameters
fileType The file type
file The file
path The file path

public void onPasswordDialogPositiveClick (int fileType, File file, String path, String password, String id)

Parameters
fileType The file type
file The file
path The file path
password The entered password
id The ID

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 boolean remove (Integer item)

The overload implementation of remove(Object).

Parameters
item The item
Returns
  • True if the item is removed

public Integer removeAt (int location)

The overload implementation of removeAt(int).

Parameters
location The position
Returns
  • The removed item

public void removeDocPage (int pageNum)

Removes a document page.

Parameters
pageNum The page number to be removed

public void rotateDocPage (int pageNum)

Rotates the document page.

Parameters
pageNum The page number to be rotated

public void setCurrentPage (int pageNum)

Sets the current page.

Parameters
pageNum The page number to be set as the current

public void setData (List<Integer> data)

public static void setDebug (boolean debug)

public void setItem (int position, int data)

public void updateAfterAddition (List<Integer> pageList)

Updates the adapter after pages addition.

Parameters
pageList The list of pages added to the document

public void updateAfterDeletion (List<Integer> pageList)

Updates the adapter after pages deletion.

Parameters
pageList The list of pages removed from the document

public void updateAfterMove (int fromPageNum, int toPageNum)

Updates the adapter after page movement.

Parameters
fromPageNum The page number from which the page was moved
toPageNum The page number to which the page was moved

public void updateAfterPageLabelEdit ()

Updates the adapter after editing page labels.

public void updateAfterRotation (List<Integer> pageList)

Updates the adapter after pages rotation.

Parameters
pageList The list of rotated pages

public void updateMainViewWidth (int width)

Updates the main view width

Parameters
width The width

public int updatePageNumberOnDelete (int deletedPage)

Updates the page numbers after deleting a page

Parameters
deletedPage The page number of the page deleted
Returns
  • The deleted position

public void updateSpanCount (int count)

The overload implementation of updateSpanCount(int).

Parameters
count The span count