Java Code Examples for com.github.angads25.filepicker.model.DialogConfigs#MULTI_MODE

The following examples show how to use com.github.angads25.filepicker.model.DialogConfigs#MULTI_MODE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Installer2Fragment.java    From SAI with GNU General Public License v3.0 5 votes vote down vote up
private void checkPermissionsAndPickFiles() {
    if (!PermissionsUtils.checkAndRequestStoragePermissions(this))
        return;

    DialogProperties properties = new DialogProperties();
    properties.selection_mode = DialogConfigs.MULTI_MODE;
    properties.selection_type = DialogConfigs.FILE_SELECT;
    properties.root = Environment.getExternalStorageDirectory();
    properties.offset = new File(mHelper.getHomeDirectory());
    properties.extensions = new String[]{"apk", "zip", "apks", "xapk"};
    properties.sortBy = mHelper.getFilePickerSortBy();
    properties.sortOrder = mHelper.getFilePickerSortOrder();

    FilePickerDialogFragment.newInstance(null, getString(R.string.installer_pick_apks), properties).show(getChildFragmentManager(), "dialog_files_picker");
}
 
Example 2
Source File: LegacyInstallerFragment.java    From SAI with GNU General Public License v3.0 5 votes vote down vote up
private void checkPermissionsAndPickFiles() {
    if (!PermissionsUtils.checkAndRequestStoragePermissions(this))
        return;

    DialogProperties properties = new DialogProperties();
    properties.selection_mode = DialogConfigs.MULTI_MODE;
    properties.selection_type = DialogConfigs.FILE_SELECT;
    properties.root = Environment.getExternalStorageDirectory();
    properties.offset = new File(mHelper.getHomeDirectory());
    properties.extensions = new String[]{"apk", "zip", "apks"};
    properties.sortBy = mHelper.getFilePickerSortBy();
    properties.sortOrder = mHelper.getFilePickerSortOrder();

    FilePickerDialogFragment.newInstance(null, getString(R.string.installer_pick_apks), properties).show(getChildFragmentManager(), "dialog_files_picker");
}
 
Example 3
Source File: InstallerXDialogFragment.java    From SAI with GNU General Public License v3.0 5 votes vote down vote up
private void checkPermissionsAndPickFiles() {
    if (!PermissionsUtils.checkAndRequestStoragePermissions(this))
        return;

    DialogProperties properties = new DialogProperties();
    properties.selection_mode = DialogConfigs.MULTI_MODE;
    properties.selection_type = DialogConfigs.FILE_SELECT;
    properties.root = Environment.getExternalStorageDirectory();
    properties.offset = new File(mHelper.getHomeDirectory());
    properties.extensions = new String[]{"zip", "apks", "xapk", "apk"};
    properties.sortBy = mHelper.getFilePickerSortBy();
    properties.sortOrder = mHelper.getFilePickerSortOrder();

    FilePickerDialogFragment.newInstance(null, getString(R.string.installer_pick_apks), properties).show(getChildFragmentManager(), "dialog_files_picker");
}
 
Example 4
Source File: OfflinePickerSample.java    From osmdroid with Apache License 2.0 5 votes vote down vote up
/**
 * step 1, users selects files
 */
private void promptForFiles() {
    DialogProperties properties = new DialogProperties();
    properties.selection_mode = DialogConfigs.MULTI_MODE;
    properties.selection_type = DialogConfigs.FILE_SELECT;
    properties.root = new File(DialogConfigs.DEFAULT_DIR);
    properties.error_dir = new File(DialogConfigs.DEFAULT_DIR);
    properties.offset = new File(DialogConfigs.DEFAULT_DIR);

    Set<String> registeredExtensions = ArchiveFileFactory.getRegisteredExtensions();
    //api check
    if (Build.VERSION.SDK_INT >= 14)
        registeredExtensions.add("gpkg");
    registeredExtensions.add("map");

    String[] ret = new String[registeredExtensions.size()];
    ret = registeredExtensions.toArray(ret);
    properties.extensions = ret;

    FilePickerDialog dialog = new FilePickerDialog(getContext(), properties);
    dialog.setTitle("Select a File");
    dialog.setDialogSelectionListener(new DialogSelectionListener() {
        @Override
        public void onSelectedFilePaths(String[] files) {
            //files is the array of the paths of files selected by the Application User.
            setProviderConfig(files);
        }

    });
    dialog.show();
}