Skip to content
This repository has been archived by the owner on Jul 23, 2022. It is now read-only.

select multiple #84

Open
pateljigar7210 opened this issue Nov 26, 2019 · 1 comment
Open

select multiple #84

pateljigar7210 opened this issue Nov 26, 2019 · 1 comment

Comments

@pateljigar7210
Copy link

No description provided.

@pateljigar7210
Copy link
Author

pateljigar7210 commented Nov 26, 2019

ArrayList paths = new ArrayList<>();

    new ChooserDialog(getActivity())
            .withStartFile(Environment.getExternalStorageDirectory().getAbsolutePath().toString())
            .enableMultiple(true)

            .withChosenListener(new ChooserDialog.Result() {
                @Override
                public void onChoosePath(String path, File pathFile) {
                    if("/storage/emulated/0".equals(path)){
                        LogClass.e("FILEs", "list : "+paths);
                    }else {
                        if(paths.contains(path)){
                            paths.remove(path);
                        }else {
                            paths.add(path);
                        } 
                    }
                }
            })
            // to handle the back key pressed or clicked outside the dialog:
            .withOnCancelListener(new DialogInterface.OnCancelListener() {
                public void onCancel(DialogInterface dialog) {
                    LogClass.e("CANCEL", "CANCEL");
                    dialog.cancel(); // MUST have
                }
            })
            .withResources(R.string.title_choose_any_file, R.string.title_choose, R.string.dialog_cancel)
            .withStringResources("Title", "OK", "Cancel")
            .build()
            .show();

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant