From 038ac7b3c5d1959d2ab0bfff26e137bed0fbde2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Brey=20Vilas?= Date: Fri, 3 Dec 2021 16:16:16 +0100 Subject: [PATCH 1/7] FileDetailSharingFragment: remove misleading "Open in..." option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This only triggered the share file dialog, which should be opened elsewhere. Signed-off-by: Álvaro Brey Vilas --- .../fragment/FileDetailSharingFragment.java | 5 --- ...ileDetailSharingMenuBottomSheetDialog.java | 11 ------ ...eDetailsSharingMenuBottomSheetActions.java | 4 --- ...ils_sharing_menu_bottom_sheet_fragment.xml | 36 +------------------ 4 files changed, 1 insertion(+), 55 deletions(-) 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"> Date: Fri, 3 Dec 2021 16:17:11 +0100 Subject: [PATCH 2/7] FileMenuFilter: Allow "Send" for single files if in file detail fragment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Álvaro Brey Vilas --- .../owncloud/android/files/FileMenuFilter.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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); } } From 9cc1a5c803774550e013461cb11cfcaae2852310 Mon Sep 17 00:00:00 2001 From: drone Date: Fri, 10 Dec 2021 13:06:09 +0000 Subject: [PATCH 3/7] Drone: update Lint results to reflect reduced error/warning count [skip ci] Signed-off-by: drone --- scripts/analysis/lint-results.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/analysis/lint-results.txt b/scripts/analysis/lint-results.txt index 6c384b6af2..c1847a6cad 100644 --- a/scripts/analysis/lint-results.txt +++ b/scripts/analysis/lint-results.txt @@ -1,2 +1,2 @@ DO NOT TOUCH; GENERATED BY DRONE - Lint Report: 122 warnings + Lint Report: 125 warnings From 195b8484bd6087c3adabc5991af526cd99768550 Mon Sep 17 00:00:00 2001 From: drone Date: Tue, 14 Dec 2021 17:07:51 +0000 Subject: [PATCH 4/7] Drone: update Lint results to reflect reduced error/warning count [skip ci] Signed-off-by: drone --- scripts/analysis/lint-results.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/analysis/lint-results.txt b/scripts/analysis/lint-results.txt index c1847a6cad..9edcc776e1 100644 --- a/scripts/analysis/lint-results.txt +++ b/scripts/analysis/lint-results.txt @@ -1,2 +1,2 @@ DO NOT TOUCH; GENERATED BY DRONE - Lint Report: 125 warnings + Lint Report: 123 warnings From a86aa1985192d3d46e41fbad3c45f070fb3bd938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Brey=20Vilas?= Date: Wed, 15 Dec 2021 12:59:13 +0100 Subject: [PATCH 5/7] Fix tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Álvaro Brey Vilas --- .../android/ui/fragment/FileDetailSharingFragmentIT.kt | 4 ---- 1 file changed, 4 deletions(-) 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()))) From 13ddc3ddc6e13ba1deb6f6e1ce490c55f1cf93e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Brey=20Vilas?= Date: Wed, 15 Dec 2021 12:59:58 +0100 Subject: [PATCH 6/7] Delete unused string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Álvaro Brey Vilas --- src/main/res/values/strings.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 6007bdf28b..c13c9aa969 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -974,7 +974,6 @@ Please select at least one permission to share. Share & Copy Link Set Note - Open in… Send new email Link Name Delete Link From cde27672efdc1298ebb2c536c6d6b221e7726b8a Mon Sep 17 00:00:00 2001 From: drone Date: Wed, 15 Dec 2021 12:04:22 +0000 Subject: [PATCH 7/7] Drone: update Lint results to reflect reduced error/warning count [skip ci] Signed-off-by: drone --- scripts/analysis/lint-results.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/analysis/lint-results.txt b/scripts/analysis/lint-results.txt index 9edcc776e1..6c384b6af2 100644 --- a/scripts/analysis/lint-results.txt +++ b/scripts/analysis/lint-results.txt @@ -1,2 +1,2 @@ DO NOT TOUCH; GENERATED BY DRONE - Lint Report: 123 warnings + Lint Report: 122 warnings