From 0af1df7f8c6e913a5f51277776ad9b7c79394bc3 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Tue, 23 May 2023 15:47:56 +0200 Subject: [PATCH 1/3] Prevent having double entries after rotate Signed-off-by: tobiasKaminsky --- .../java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt b/app/src/main/java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt index b366c6435145..f3b2e4910bfa 100644 --- a/app/src/main/java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt +++ b/app/src/main/java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt @@ -199,6 +199,8 @@ class FileActionsBottomSheet : BottomSheetDialogFragment(), Injectable { private fun displayActions( actions: List ) { + binding.fileActionsList.removeAllViews() + actions.forEach { action -> val view = inflateActionView(action) binding.fileActionsList.addView(view) From c3e88144a06ef4b6901dbbfae3aa9fdab69719fd Mon Sep 17 00:00:00 2001 From: Tobias Kaminsky Date: Wed, 24 May 2023 15:25:50 +0200 Subject: [PATCH 2/3] Update app/src/main/java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt Co-authored-by: Tom <70907959+ZetaTom@users.noreply.github.com> Signed-off-by: Tobias Kaminsky --- .../nextcloud/ui/fileactions/FileActionsBottomSheet.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt b/app/src/main/java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt index f3b2e4910bfa..037426a878a8 100644 --- a/app/src/main/java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt +++ b/app/src/main/java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt @@ -199,11 +199,11 @@ class FileActionsBottomSheet : BottomSheetDialogFragment(), Injectable { private fun displayActions( actions: List ) { - binding.fileActionsList.removeAllViews() - - actions.forEach { action -> - val view = inflateActionView(action) - binding.fileActionsList.addView(view) + if (binding.fileActionsList.isEmpty()) { + actions.forEach { action -> + val view = inflateActionView(action) + binding.fileActionsList.addView(view) + } } } From 4572114b807d205872a9d837686f24dd344e99c4 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 1 Jun 2023 11:09:35 +0200 Subject: [PATCH 3/3] add missing import Signed-off-by: tobiasKaminsky --- .../java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt b/app/src/main/java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt index 037426a878a8..64dbc259d8f6 100644 --- a/app/src/main/java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt +++ b/app/src/main/java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt @@ -35,6 +35,7 @@ import android.widget.Toast import androidx.annotation.IdRes import androidx.appcompat.content.res.AppCompatResources import androidx.core.os.bundleOf +import androidx.core.view.isEmpty import androidx.core.view.isVisible import androidx.fragment.app.FragmentManager import androidx.fragment.app.setFragmentResult