remove literals in conditional statements

This commit is contained in:
Andy Scherzinger 2020-06-25 18:37:28 +02:00 committed by tobiasKaminsky
parent 3c7fe3a405
commit 3848346f4a
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7
2 changed files with 4 additions and 2 deletions

View file

@ -94,6 +94,7 @@ public class FileDetailSharingFragment extends Fragment implements ShareeListAda
private static final String ARG_FILE = "FILE";
private static final String ARG_USER = "USER";
public static final int PERMISSION_EDITING_ALLOWED = 17;
// to show share with users/groups info
private List<OCShare> shares;
@ -390,7 +391,7 @@ public class FileDetailSharingFragment extends Fragment implements ShareeListAda
menu.findItem(R.id.action_share_send_note).setVisible(capabilities.getVersion().isNoteOnShareSupported());
if (publicShare.getPermissions() > 17) {
if (publicShare.getPermissions() > PERMISSION_EDITING_ALLOWED) {
menu.findItem(R.id.action_allow_editing).setChecked(true);
} else {
menu.findItem(R.id.action_allow_editing).setChecked(false);

View file

@ -118,6 +118,7 @@ public class FileOperationsHelper {
private static final String FILE_EXTENSION_URL = "url";
private static final String FILE_EXTENSION_DESKTOP = "desktop";
private static final String FILE_EXTENSION_WEBLOC = "webloc";
public static final int SINGLE_LINK_SIZE = 1;
private FileActivity fileActivity;
private CurrentAccountProvider currentAccount;
@ -482,7 +483,7 @@ public class FileOperationsHelper {
ShareType.PUBLIC_LINK,
"");
if (shares.size() == 1) {
if (shares.size() == SINGLE_LINK_SIZE) {
FileActivity.copyAndShareFileLink(fileActivity, file, shares.get(0).getShareLink());
} else {
if (fileActivity instanceof FileDisplayActivity) {