mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 15:15:51 +03:00
Clear selection when deleting local files
The selection was not cleared when deleting a file locally. Now the selection mode is cleared after deleting files locally.
This commit is contained in:
parent
ada2f4698a
commit
17b7bfb459
1 changed files with 13 additions and 7 deletions
|
@ -158,13 +158,7 @@ public class RemoveFilesDialogFragment extends ConfirmationDialogFragment implem
|
|||
public void onConfirmation(String callerTag) {
|
||||
ComponentsGetter cg = (ComponentsGetter) getActivity();
|
||||
cg.getFileOperationsHelper().removeFiles(mTargetFiles, false, false);
|
||||
|
||||
// This is used when finishing an actionMode,
|
||||
// for example if we want to exit the selection mode
|
||||
// after deleting the target files.
|
||||
if (actionMode != null) {
|
||||
actionMode.finish();
|
||||
}
|
||||
finishActionMode();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -174,6 +168,7 @@ public class RemoveFilesDialogFragment extends ConfirmationDialogFragment implem
|
|||
public void onCancel(String callerTag) {
|
||||
ComponentsGetter cg = (ComponentsGetter) getActivity();
|
||||
cg.getFileOperationsHelper().removeFiles(mTargetFiles, true, false);
|
||||
finishActionMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -184,4 +179,15 @@ public class RemoveFilesDialogFragment extends ConfirmationDialogFragment implem
|
|||
private void setActionMode(ActionMode actionMode) {
|
||||
this.actionMode = actionMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is used when finishing an actionMode,
|
||||
* for example if we want to exit the selection mode
|
||||
* after deleting the target files.
|
||||
*/
|
||||
private void finishActionMode() {
|
||||
if (actionMode != null) {
|
||||
actionMode.finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue