also favorited files can be deleted locally

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2019-03-20 11:00:02 +01:00
parent 7c28461679
commit fd45854d65
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -22,7 +22,8 @@ package com.owncloud.android.ui.dialog;
import android.app.Dialog;
import android.os.Bundle;
import android.view.ActionMode;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.ui.activity.ComponentsGetter;
@ -32,9 +33,6 @@ import com.owncloud.android.utils.ThemeUtils;
import java.util.ArrayList;
import java.util.Collection;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
/**
* Dialog requiring confirmation before removing a collection of given OCFiles.
*
@ -75,11 +73,10 @@ public class RemoveFilesDialogFragment extends ConfirmationDialogFragment implem
boolean containsFolder = false;
boolean containsDown = false;
boolean containsFavorite = false;
for (OCFile file: files) {
containsFolder |= file.isFolder();
containsDown |= file.isDown();
containsFavorite |= file.isFavorite();
}
if (files.size() == SINGLE_SELECTION) {
@ -97,9 +94,7 @@ public class RemoveFilesDialogFragment extends ConfirmationDialogFragment implem
R.string.confirmation_remove_files_alert;
}
int localRemoveButton = (!containsFavorite && (containsFolder || containsDown)) ?
R.string.confirmation_remove_local :
-1;
int localRemoveButton = (containsFolder || containsDown) ? R.string.confirmation_remove_local : -1;
args.putInt(ARG_MESSAGE_RESOURCE_ID, messageStringId);
if (files.size() == SINGLE_SELECTION) {