diff --git a/src/androidTest/java/com/owncloud/android/ui/fragment/FileDetailSharingFragmentIT.kt b/src/androidTest/java/com/owncloud/android/ui/fragment/FileDetailSharingFragmentIT.kt index b00ad0da2b..7fa96fa520 100644 --- a/src/androidTest/java/com/owncloud/android/ui/fragment/FileDetailSharingFragmentIT.kt +++ b/src/androidTest/java/com/owncloud/android/ui/fragment/FileDetailSharingFragmentIT.kt @@ -252,7 +252,6 @@ class FileDetailSharingFragmentIT : AbstractIT() { waitForIdleSync() // check if items are visible - onView(ViewMatchers.withId(R.id.menu_share_open_in)).check(matches(not(isDisplayed()))) onView(ViewMatchers.withId(R.id.menu_share_advanced_permissions)).check(matches(isDisplayed())) onView(ViewMatchers.withId(R.id.menu_share_send_new_email)).check(matches(isDisplayed())) onView(ViewMatchers.withId(R.id.menu_share_send_link)).check(matches(isDisplayed())) @@ -379,7 +378,6 @@ class FileDetailSharingFragmentIT : AbstractIT() { waitForIdleSync() // check if items are visible - onView(ViewMatchers.withId(R.id.menu_share_open_in)).check(matches(isDisplayed())) onView(ViewMatchers.withId(R.id.menu_share_advanced_permissions)).check(matches(isDisplayed())) onView(ViewMatchers.withId(R.id.menu_share_send_new_email)).check(matches(isDisplayed())) onView(ViewMatchers.withId(R.id.menu_share_send_link)).check(matches(isDisplayed())) @@ -495,7 +493,6 @@ class FileDetailSharingFragmentIT : AbstractIT() { waitForIdleSync() // check if items are visible - onView(ViewMatchers.withId(R.id.menu_share_open_in)).check(matches(isDisplayed())) onView(ViewMatchers.withId(R.id.menu_share_advanced_permissions)).check(matches(isDisplayed())) onView(ViewMatchers.withId(R.id.menu_share_send_new_email)).check(matches(isDisplayed())) onView(ViewMatchers.withId(R.id.menu_share_send_link)).check(matches(not(isDisplayed()))) @@ -621,7 +618,6 @@ class FileDetailSharingFragmentIT : AbstractIT() { waitForIdleSync() // check if items are visible - onView(ViewMatchers.withId(R.id.menu_share_open_in)).check(matches(not(isDisplayed()))) onView(ViewMatchers.withId(R.id.menu_share_advanced_permissions)).check(matches(isDisplayed())) onView(ViewMatchers.withId(R.id.menu_share_send_new_email)).check(matches(isDisplayed())) onView(ViewMatchers.withId(R.id.menu_share_send_link)).check(matches(not(isDisplayed()))) diff --git a/src/main/java/com/owncloud/android/files/FileMenuFilter.java b/src/main/java/com/owncloud/android/files/FileMenuFilter.java index 2b34394bdf..cc93c007d0 100644 --- a/src/main/java/com/owncloud/android/files/FileMenuFilter.java +++ b/src/main/java/com/owncloud/android/files/FileMenuFilter.java @@ -193,7 +193,7 @@ public class FileMenuFilter { filterCancelSync(toShow, toHide, synchronizing); filterSync(toShow, toHide, synchronizing); filterShareFile(toShow, toHide, capability); - filterSendFiles(toShow, toHide); + filterSendFiles(toShow, toHide, inSingleFileFragment); filterDetails(toShow, toHide); filterFavorite(toShow, toHide, synchronizing); filterUnfavorite(toShow, toHide, synchronizing); @@ -213,12 +213,18 @@ public class FileMenuFilter { } } - private void filterSendFiles(List toShow, List toHide) { - if (containsEncryptedFile() || isSingleSelection() || overflowMenu || !anyFileDown() || - SEND_OFF.equalsIgnoreCase(context.getString(R.string.send_files_to_other_apps))) { - toHide.add(R.id.action_send_file); - } else { + private void filterSendFiles(List toShow, List toHide, boolean inSingleFileFragment) { + boolean show = true; + if (containsEncryptedFile() || overflowMenu || SEND_OFF.equalsIgnoreCase(context.getString(R.string.send_files_to_other_apps))) { + show = false; + } + if (!inSingleFileFragment && (isSingleSelection() || !anyFileDown())) { + show = false; + } + if (show) { toShow.add(R.id.action_send_file); + } else { + toHide.add(R.id.action_send_file); } } diff --git a/src/main/java/com/owncloud/android/ui/fragment/FileDetailSharingFragment.java b/src/main/java/com/owncloud/android/ui/fragment/FileDetailSharingFragment.java index b58827e421..3897aea981 100644 --- a/src/main/java/com/owncloud/android/ui/fragment/FileDetailSharingFragment.java +++ b/src/main/java/com/owncloud/android/ui/fragment/FileDetailSharingFragment.java @@ -462,11 +462,6 @@ public class FileDetailSharingFragment extends Fragment implements ShareeListAda return file; } - @Override - public void openIn(OCShare share) { - fileOperationsHelper.sendShareFile(file); - } - @Override public void advancedPermissions(OCShare share) { modifyExistingShare(share, FileDetailsSharingProcessFragment.SCREEN_TYPE_PERMISSION); diff --git a/src/main/java/com/owncloud/android/ui/fragment/FileDetailSharingMenuBottomSheetDialog.java b/src/main/java/com/owncloud/android/ui/fragment/FileDetailSharingMenuBottomSheetDialog.java index a41bc50670..83dd05421a 100644 --- a/src/main/java/com/owncloud/android/ui/fragment/FileDetailSharingMenuBottomSheetDialog.java +++ b/src/main/java/com/owncloud/android/ui/fragment/FileDetailSharingMenuBottomSheetDialog.java @@ -69,12 +69,6 @@ public class FileDetailSharingMenuBottomSheetDialog extends BottomSheetDialog { } private void updateUI() { - if (ocShare.isFolder()) { - binding.menuShareOpenIn.setVisibility(View.GONE); - } else { - binding.menuShareOpenIn.setVisibility(View.VISIBLE); - } - if (ocShare.getShareType() == ShareType.PUBLIC_LINK) { binding.menuShareAddAnotherLink.setVisibility(View.VISIBLE); binding.menuShareSendLink.setVisibility(View.VISIBLE); @@ -85,11 +79,6 @@ public class FileDetailSharingMenuBottomSheetDialog extends BottomSheetDialog { } private void setupClickListener() { - binding.menuShareOpenIn.setOnClickListener(v -> { - actions.openIn(ocShare); - dismiss(); - }); - binding.menuShareAdvancedPermissions.setOnClickListener(v -> { actions.advancedPermissions(ocShare); dismiss(); diff --git a/src/main/java/com/owncloud/android/ui/fragment/FileDetailsSharingMenuBottomSheetActions.java b/src/main/java/com/owncloud/android/ui/fragment/FileDetailsSharingMenuBottomSheetActions.java index 6986d8d73c..8e6ab6a1ac 100644 --- a/src/main/java/com/owncloud/android/ui/fragment/FileDetailsSharingMenuBottomSheetActions.java +++ b/src/main/java/com/owncloud/android/ui/fragment/FileDetailsSharingMenuBottomSheetActions.java @@ -29,10 +29,6 @@ import com.owncloud.android.lib.resources.shares.ShareType; * Actions interface to be implemented by any class that makes use of {@link FileDetailSharingMenuBottomSheetDialog}. */ public interface FileDetailsSharingMenuBottomSheetActions { - /** - * open sharing options only applicable for files - */ - void openIn(OCShare share); /** * open advanced permission for selected share diff --git a/src/main/res/layout/file_details_sharing_menu_bottom_sheet_fragment.xml b/src/main/res/layout/file_details_sharing_menu_bottom_sheet_fragment.xml index 4062c3ba2f..d8e48e5fdc 100644 --- a/src/main/res/layout/file_details_sharing_menu_bottom_sheet_fragment.xml +++ b/src/main/res/layout/file_details_sharing_menu_bottom_sheet_fragment.xml @@ -25,41 +25,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:background="@color/bg_default" - android:paddingTop="@dimen/standard_padding"> - - - - - - - - + android:background="@color/bg_default"> Please select at least one permission to share. Share & Copy Link Set Note - Open in… Send new email Link Name Delete Link