Interface FilePicker
-
- All Implemented Interfaces:
public interface FilePicker
A file picker for retrieving a destination Uri. getDestinationUri can be called whenever access to an Uri is required, for example when trying to save a PDF document to a random location. Various implementations of file pickers can exist, such as default Android SAF that shows a file browser for selecting a destination file prior to creating the exported PDFs. One usage of the FilePicker is the selection of a destination
Uri
for saving documents when editing using the PdfDocumentEditor.
-
-
Method Summary
Modifier and Type Method Description Maybe<Uri>
getDestinationUri(@NonNull() String action)
The file picker opens a default Android SAF by an intent with a given action. abstract Maybe<Uri>
getDestinationUri(@NonNull() String action, @Nullable() String fileName)
The file picker opens a default Android SAF by an intent with a given action. -
-
Method Detail
-
getDestinationUri
@NonNull() Maybe<Uri> getDestinationUri(@NonNull() String action)
The file picker opens a default Android SAF by an intent with a given action. The file picker might cancel the operation, in which case the returned
Maybe
instance completes without emitting a value. Reasons for cancellation might be user interaction, like cancelling selection of a destination inside SAF picker. Supported intent actions are ACTION_OPEN_DOCUMENT, and ACTION_CREATE_DOCUMENT.- Parameters:
action
- Given action used to create an intent for opening Android SAF.
-
getDestinationUri
@NonNull() abstract Maybe<Uri> getDestinationUri(@NonNull() String action, @Nullable() String fileName)
The file picker opens a default Android SAF by an intent with a given action. The file picker might cancel the operation, in which case the returned
Maybe
instance completes without emitting a value. Reasons for cancellation might be user interaction, like cancelling selection of a destination inside SAF picker. Supported intent actions are ACTION_OPEN_DOCUMENT, and ACTION_CREATE_DOCUMENT.- Parameters:
action
- Given action used to create an intent for opening Android SAF.fileName
- File name (without the .pdf extension) that should be pre-filled in the file picker.
-
-
-
-