java.lang.Object
   ↳ AppCompatActivity
     ↳ com.pdftron.demo.app.AdvancedReaderActivity

Class Overview

AdvancedReaderActivity is derived from AppCompatActivity and is an all-in-one document reader, PDF editor and file manager.

Summary

Constants
int MAX_PASSWORD_ATTEMPTS
int MENU_ITEM_NONE
int PDFDOC_TYPE_ENCRYPTED
int PDFDOC_TYPE_FILE
int PDFDOC_TYPE_PORTFOLIO
int PDFDOC_TYPE_UNKNOWN
int PDFDOC_TYPE_XFA
Public Constructors
AdvancedReaderActivity()
Public Methods
boolean canRecreateActivity()
Called when about the re-create Activity for day/night mode
boolean canShowFileCloseSnackbar()
The implementation should determine whether closing a tab should show re-open snackbar.
boolean canShowFileInFolder()
The implementation should determine whether the long press on tab widget should show file info.
int checkPdfDocTypeAndClose(PDFDoc tempDoc, String password)
void dismissDialogFragment(String tag)
Dismisses a dialog fragment (if visible) in the fragment manager via its tag.
boolean dispatchKeyShortcutEvent(KeyEvent event)
String getContentUriName(Uri dataUri)
Returns the file name (including the file extension) of the given content Uri.
void gotoExternalTab()
void onActivityResult(int requestCode, int resultCode, Intent data)
void onBackPressed()
void onConfigurationChanged(Configuration newConfig)
boolean onCreateOptionsMenu(Menu menu)
void onEditPdfIntentReceived(Uri dataUri, boolean skipPermission)
Opens a Uri that points to a PDF file in the document viewer.
void onEditUriSelected(String fileUri)
void onExitSearchMode()
Called when search view collapsed
void onExternalFileSelected(String encodedUri, String password)
void onExternalFolderSelected(String folderUri)
void onFileSelected(File file, String password, boolean skipPasswordCheck)
Opens a local document in the document viewer.
void onFileSelected(File file, String password)
A file (item) was selected (single tap) from the list.
void onFolderSelected(String absolutePath)
void onJumpToSdCardFolder()
Called when an SD card file is opened as a local file
boolean onKeyUp(int keyCode, KeyEvent event)
void onLastTabClosed()
Called when the last tab in the tab host has been closed, and therefore there is no more tab.
void onLowMemory()
void onNavButtonPressed()
Called when navigation button has been pressed.
boolean onNavigationItemSelected(MenuItem menuItem)
void onNewIntent(Intent intent)
void onOfficeUriSelected(Uri fileUri)
boolean onOpenDocError()
Called when an error has been happened when opening a document.
boolean onOptionsItemSelected(MenuItem item)
void onPasswordDialogDismiss(boolean forcedDismiss)
Called when dialog is dismissed
void onPasswordDialogNegativeClick(int fileType, File file, String path)
Called when Cancel button has been clicked.
void onPasswordDialogPositiveClick(int fileType, File file, String path, String password, String id)
Called when OK button has been clicked.
void onPortfolioDialogFragmentFileClicked(int fileType, PortfolioDialogFragment dialog, String fileName)
void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)
void onShowFileInFolder(String filename, String filepath, int itemSource)
The implementation should browse to the specified file in the folder.
void onStartSearchMode()
Called when search view expanded
void onTabChanged(String tag)
Called when a new tab has been selected excluding the initial tab.
void onTabDocumentLoaded(String tag)
Called when document associated with a tab is loaded
void onTabHostHidden()
Called when the tab host has been hidden.
void onTabHostShown()
Called when the tab host has been shown.
void onTabPaused(FileInfo fileInfo, boolean isDocModifiedAfterOpening)
Called when the fragment is paused.
boolean onToolbarCreateOptionsMenu(Menu menu, MenuInflater inflater)
Called when creating Toolbar options menu
boolean onToolbarOptionsItemSelected(MenuItem item)
Called when Toolbar options menu selected
boolean onToolbarPrepareOptionsMenu(Menu menu)
Called when preparing Toolbar options menu
void onTrimMemory(int level)
static void open(Context packageContext)
Opens the CompleteReader demo app.
void selectNavigationItem(MenuItem menuItem)
Selects a drawer navigation menu item.
static void setDebug(boolean debug)
Used to enable debug mode to show verbose debug Logcat messages.
FileInfoDrawer showFileInfoDrawer(FileInfoDrawer.Callback callback)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pdftron.demo.navigation.callbacks.FilePickerCallbacks
From interface com.pdftron.demo.navigation.callbacks.FileUtilCallbacks
From interface com.pdftron.demo.navigation.callbacks.JumpNavigationCallbacks
From interface com.pdftron.pdf.controls.PasswordDialogFragment.PasswordDialogFragmentListener
From interface com.pdftron.pdf.controls.PdfViewCtrlTabHostBaseFragment.TabHostListener
From interface com.pdftron.pdf.dialog.PortfolioDialogFragment.PortfolioDialogFragmentListener

Constants

public static final int MAX_PASSWORD_ATTEMPTS

Constant Value: 3 (0x00000003)

public static final int MENU_ITEM_NONE

Constant Value: -1 (0xffffffff)

public static final int PDFDOC_TYPE_ENCRYPTED

Constant Value: 1 (0x00000001)

public static final int PDFDOC_TYPE_FILE

Constant Value: 0 (0x00000000)

public static final int PDFDOC_TYPE_PORTFOLIO

Constant Value: 3 (0x00000003)

public static final int PDFDOC_TYPE_UNKNOWN

Constant Value: -1 (0xffffffff)

public static final int PDFDOC_TYPE_XFA

Constant Value: 2 (0x00000002)

Public Constructors

public AdvancedReaderActivity ()

Public Methods

public boolean canRecreateActivity ()

Called when about the re-create Activity for day/night mode

public boolean canShowFileCloseSnackbar ()

The implementation should determine whether closing a tab should show re-open snackbar.

Returns
  • true if can show snackbar, false otherwise

public boolean canShowFileInFolder ()

The implementation should determine whether the long press on tab widget should show file info.

Returns
  • true if long press shows file info, false otherwise

public int checkPdfDocTypeAndClose (PDFDoc tempDoc, String password)

Parameters
tempDoc PDFDoc to check
password password used to open the PDFDoc
Returns
  • the file type of the given PDFDoc

public void dismissDialogFragment (String tag)

Dismisses a dialog fragment (if visible) in the fragment manager via its tag.

Parameters
tag of the dialog fragment to dismiss

public boolean dispatchKeyShortcutEvent (KeyEvent event)

public String getContentUriName (Uri dataUri)

Returns the file name (including the file extension) of the given content Uri.

Parameters
dataUri content uri to get the file name
Returns
  • the file name of the given content Uri.

public void gotoExternalTab ()

public void onActivityResult (int requestCode, int resultCode, Intent data)

public void onBackPressed ()

public void onConfigurationChanged (Configuration newConfig)

public boolean onCreateOptionsMenu (Menu menu)

public void onEditPdfIntentReceived (Uri dataUri, boolean skipPermission)

Opens a Uri that points to a PDF file in the document viewer. If skip permission is enabled, the content Uri will be converted to a local file before being opened.

Parameters
dataUri content Uri to a PDF document
skipPermission true to save the Uri as a file locally before viewing the file, false to open the content Uri directly

public void onEditUriSelected (String fileUri)

public void onExitSearchMode ()

Called when search view collapsed

public void onExternalFileSelected (String encodedUri, String password)

public void onExternalFolderSelected (String folderUri)

public void onFileSelected (File file, String password, boolean skipPasswordCheck)

Opens a local document in the document viewer.

Parameters
file that represents a local document
password password used to open document, can be null
skipPasswordCheck true to skip password check when opening the document

public void onFileSelected (File file, String password)

A file (item) was selected (single tap) from the list.

public void onFolderSelected (String absolutePath)

public void onJumpToSdCardFolder ()

Called when an SD card file is opened as a local file

public boolean onKeyUp (int keyCode, KeyEvent event)

public void onLastTabClosed ()

Called when the last tab in the tab host has been closed, and therefore there is no more tab.

public void onLowMemory ()

public void onNavButtonPressed ()

Called when navigation button has been pressed.

public boolean onNavigationItemSelected (MenuItem menuItem)

public void onNewIntent (Intent intent)

public void onOfficeUriSelected (Uri fileUri)

public boolean onOpenDocError ()

Called when an error has been happened when opening a document.

public boolean onOptionsItemSelected (MenuItem item)

public void onPasswordDialogDismiss (boolean forcedDismiss)

Called when dialog is dismissed

Parameters
forcedDismiss True if the dialog is forced to dismiss

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

Called when Cancel button has been clicked.

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)

Called when OK button has been clicked.

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

public void onPortfolioDialogFragmentFileClicked (int fileType, PortfolioDialogFragment dialog, String fileName)

public void onRequestPermissionsResult (int requestCode, String[] permissions, int[] grantResults)

public void onShowFileInFolder (String filename, String filepath, int itemSource)

The implementation should browse to the specified file in the folder.

Parameters
filename The file name
filepath The file path
itemSource The item source of the file

public void onStartSearchMode ()

Called when search view expanded

public void onTabChanged (String tag)

Called when a new tab has been selected excluding the initial tab.

Parameters
tag the tab tag changed to

public void onTabDocumentLoaded (String tag)

Called when document associated with a tab is loaded

Parameters
tag the document tag

public void onTabHostHidden ()

Called when the tab host has been hidden.

public void onTabHostShown ()

Called when the tab host has been shown.

public void onTabPaused (FileInfo fileInfo, boolean isDocModifiedAfterOpening)

Called when the fragment is paused.

Parameters
fileInfo The file shown when tab has been paused
isDocModifiedAfterOpening True if document has been modified after opening; False otherwise

public boolean onToolbarCreateOptionsMenu (Menu menu, MenuInflater inflater)

Called when creating Toolbar options menu

Parameters
menu the menu
inflater the inflater

public boolean onToolbarOptionsItemSelected (MenuItem item)

Called when Toolbar options menu selected

Parameters
item the menu item

public boolean onToolbarPrepareOptionsMenu (Menu menu)

Called when preparing Toolbar options menu

Parameters
menu the menu

public void onTrimMemory (int level)

public static void open (Context packageContext)

Opens the CompleteReader demo app.

Parameters
packageContext the context

public void selectNavigationItem (MenuItem menuItem)

Selects a drawer navigation menu item. A list of side navigation menu item ids can be found in the ids.xml file.

Parameters
menuItem the selected drawer navigation menu item that that this activity will navigate to

public static void setDebug (boolean debug)

Used to enable debug mode to show verbose debug Logcat messages.

Parameters
debug true to enable debug mode, false otherwise

public FileInfoDrawer showFileInfoDrawer (FileInfoDrawer.Callback callback)