java.lang.Object | |
↳ | com.pdftron.demo.utils.MiscUtils |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
MiscUtils() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static SpannableString | appendFavoriteHeart(Context context, String title) | ||||||||||
static int | copy(InputStream input, OutputStream output, CustomAsyncTask task) | ||||||||||
static ExternalFileInfo | extractFileFromFileSpec(Context context, ExternalFileInfo extractFolder, FileSpec fileSpec, String fileName) | ||||||||||
static void | extractFileFromFileSpec(Context context, Uri destFileUri, FileSpec fileSpec) | ||||||||||
static String | extractFileFromPortfolio(File portfolioFile, String fileName) | ||||||||||
static String | extractFileFromPortfolio(Context context, Uri portfolioFileUri, String fileName) | ||||||||||
static Intent | getAppSettingsIntent(Context context) | ||||||||||
static SpannableStringBuilder |
getFileDescriptionFromUri(String uriString, Context context)
Returns description of a file a given content uri
| ||||||||||
static Uri | getUriParent(Uri uri) | ||||||||||
static void |
handleDocumentTreePickerResult(Activity activity, Uri treeUri, ContentResolver contentResolver, Handles the document tree picker intent, typically in onActivityResult.
| ||||||||||
static void | handleLowMemory(Context context, BaseFileAdapter adapter) | ||||||||||
static void | handleLowMemory(Context context) | ||||||||||
static boolean | isExternalFileUri(Context context, Uri uri) | ||||||||||
static boolean | isExternalStorageDocument(Uri uri) | ||||||||||
static boolean | isIntentActionMain(Intent intent) | ||||||||||
static boolean | isPDFFile(String filename) | ||||||||||
static void |
launchDocumentTreePicker(Fragment fragment)
Launches the document tree picker via intent.
| ||||||||||
static void | manageOOM(Context context, PDFViewCtrl pdfViewCtrl) | ||||||||||
static void | manageOOM(Context context) | ||||||||||
static File |
parseIntentGetPdfFile(Context context, Intent intent)
Given an Intent, try to parse it and get a File for the PDF document.
| ||||||||||
static void | removeFiles(ArrayList<FileInfo> filesToDelete) | ||||||||||
static void | restartWithTransition(Activity activity) | ||||||||||
static void | showPermissionResultSnackbar(Activity activity, View layout, boolean hasPermission, int requestCode) | ||||||||||
static boolean | showSDCardActionErrorDialog(Context context, JumpNavigationCallbacks jumpNavigationCallbacks, String action) | ||||||||||
static void |
sortDocumentFileList(List<DocumentFile> list, Comparator<DocumentFile> sortMode)
Sorts DocumentFile list according to sort setting
| ||||||||||
static void |
sortFileInfoList(List<FileInfo> list, Comparator<FileInfo> sortMode)
Sorts file info list according to sort setting
| ||||||||||
static void | updateAdapterViewWidthAfterGlobalLayout(RecyclerView recyclerView, BaseFileAdapter adapter) | ||||||||||
static boolean | validateStringFilenameUsingIO(Context context, String filename) | ||||||||||
static boolean | verifyPermissions(int[] grantResults) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
IOException |
---|
Exception |
---|
Exception |
---|
Returns description of a file a given content uri
uriString | uri to a file |
---|---|
context | context to get string resources and content resolver |
Handles the document tree picker intent, typically in onActivityResult.
activity | used to show toast |
---|---|
treeUri | Tree Uri obtains from Intent.ACTION_OPEN_DOCUMENT_TREE |
contentResolver | used to obtain persistable permission |
onComplete | callback after document tree uri is added to database |
Launches the document tree picker via intent.
fragment | used to start the activity |
---|
Given an Intent, try to parse it and get a File for the PDF document. This will only work if the Intent action is ACTION_VIEW or ACTION_EDIT, and the Intent data is a valid PDF file scheme.
intent | the Intent that holds the data |
---|
Sorts DocumentFile list according to sort setting
list | A list of DocumentFile |
---|---|
sortMode | The sort mode |
Sorts file info list according to sort setting
list | A list of file info |
---|---|
sortMode | The sort mode |