Search in sources :

Example 1 with FolderState

use of com.amaze.filemanager.file_operations.filesystem.FolderState in project AmazeFileManager by TeamAmaze.

the class MainActivityHelper method deleteFiles.

public void deleteFiles(ArrayList<HybridFileParcelable> files) {
    if (files == null || files.size() == 0)
        return;
    if (files.get(0).isSmb()) {
        new DeleteTask(mainActivity).execute((files));
        return;
    }
    @FolderState int mode = checkFolder(files.get(0).getParent(mainActivity), files.get(0).getMode(), mainActivity);
    if (mode == CAN_CREATE_FILES) {
        mainActivity.oparrayList = (files);
        mainActivity.operation = DELETE;
    } else if (mode == WRITABLE_OR_ON_SDCARD || mode == DOESNT_EXIST)
        new DeleteTask(mainActivity).execute((files));
    else
        Toast.makeText(mainActivity, R.string.not_allowed, Toast.LENGTH_SHORT).show();
}
Also used : FolderState(com.amaze.filemanager.file_operations.filesystem.FolderState) DeleteTask(com.amaze.filemanager.asynchronous.asynctasks.DeleteTask)

Aggregations

DeleteTask (com.amaze.filemanager.asynchronous.asynctasks.DeleteTask)1 FolderState (com.amaze.filemanager.file_operations.filesystem.FolderState)1