-
Notifications
You must be signed in to change notification settings - Fork 139
FilePicker Dialog
public class FilePickerDialog
extends Dialog implements AdapterView.OnItemClickListener
FilePickerDialog shows the list of files and directories in the device storage, based on properties they can be selected.
Constants | |
---|---|
static final int |
EXTERNAL_READ_PERMISSION_GRANT Use this constant as requestCode for granting external read permission. |
Public constructors |
---|
FilePickerDialog(Context context) Creates dialog window with default DialogProperties. |
FilePickerDialog(Context context, DialogPropertiesproperties) Creates a dialog window with custom DialogProperties. |
FilePickerDialog(Context context, DialogProperties properties, int themeResId) Creates a dialog window with custom DialogProperties. |
Inherited Methods | |
---|---|
void |
show() Start the dialog and display it on screen. |
void |
dismiss() Dismiss this dialog, removing it from the screen.. |
void |
setTitle(CharSequence title) Set the title text for this dialog's window. |
Public Methods | |
---|---|
DialogProperties |
getProperties() Retrieve the Properties this Dialog is using. |
void |
setProperties(DialogProperties properties) Set properties dialog would be using. |
void |
setDialogSelectionListener(DialogSelectionListener callbacks) Set a listener to be invoked when SELECT button is pressed. |
void |
setPositiveBtnName(CharSequence positiveBtnNameStr) CharSequence to be shown on positive action button. |
void |
setNegativeBtnName(CharSequence negativeBtnNameStr) CharSequence to be shown on negative action button. |
void |
markFiles(List<String> paths) File Paths specified in list are pre marked in the dialog before showing. |
Use this constant as requestCode for granting external read permission.
Constant Value: 112
FilePickerDialog(Context context)
Creates dialog window with default DialogProperties.
The supplied context
is used to obtain the window manager, populate dialog list and checking permissions.
Parameters | |
---|---|
context | Context: the context in which the dialog should run |
FilePickerDialog(Context context, DialogProperties properties)
Creates a dialog window with custom DialogProperties.
The supplied context
is used to obtain the window manager, populate dialog list and checking permissions.
The supplied properties
is used to define selection modes, types and directories.
Parameters | |
---|---|
context |
Context : the context in which the dialog should run |
properties |
DialogProperties : the properties dialog would be using |
FilePickerDialog(Context context, DialogProperties properties, int themeResId)
Creates a dialog window with custom DialogProperties.
The supplied context
is used to obtain the window manager, populate dialog list and checking permissions.
The supplied properties
is used to define selection modes, types and directories.
Parameters | |
---|---|
context |
Context : the context in which the dialog should run |
properties |
DialogProperties : the properties dialog would be using |
themeResId |
int : a style resource describing the theme to use for the window, or 0 to use the default dialog theme |
void show ()
Start the dialog and display it on screen. The window is placed in the application layer and opaque. Note that you should not override this method to do initialization when the dialog is shown, instead implement that in onStart().
void dismiss ()
Dismiss this dialog, removing it from the screen. This method can be invoked safely from any thread. Note that you should not override this method to do cleanup when the dialog is dismissed, instead implement that in onStop().
void setTitle(CharSequence titleStr) Set the title text for this dialog's window.
Parameters | |
---|---|
titleStr |
CharSequence: The new text to display in the title. |
DialogProperties getProperties()
Retrieve the Properties this Dialog is using.
Returns | |
---|---|
DialogProperties | properties dialog is using. |
void setProperties(DialogProperties properties)
Set properties dialog would be using.
Parameters | |
---|---|
properties |
DialogProperties: properties dialog will be using. |
void setDialogSelectionListener(DialogSelectionListener callbacks)
Set a listener to be invoked when SELECT button is pressed.
Parameters | |
---|---|
callbacks |
DialogSelectionListener: listener to be invoked when SELECT button is pressed. |