From d554f01407bc0a5aa3d21fe718b4745ab33f2c4b Mon Sep 17 00:00:00 2001 From: alperozturk Date: Thu, 14 Nov 2024 15:55:33 +0100 Subject: [PATCH] fix getShareIconIdAndContentDescriptionId logic Signed-off-by: alperozturk --- .../android/ui/adapter/OCFileListDelegate.kt | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/ui/adapter/OCFileListDelegate.kt b/app/src/main/java/com/owncloud/android/ui/adapter/OCFileListDelegate.kt index cd74ec3e47..e6844e3e8e 100644 --- a/app/src/main/java/com/owncloud/android/ui/adapter/OCFileListDelegate.kt +++ b/app/src/main/java/com/owncloud/android/ui/adapter/OCFileListDelegate.kt @@ -384,20 +384,16 @@ class OCFileListDelegate( } private fun getShareIconIdAndContentDescriptionId(holder: ListViewHolder, file: OCFile): Pair? { - if (!MDMConfig.sharingSupport(context) || file.isOfflineOperation || holder !is OCFileListItemViewHolder || file.unreadCommentsCount != 0) { - return null - } + if (file.isOfflineOperation) return null - return if (file.isSharedWithSharee || file.isSharedWithMe) { - if (showShareAvatar) { - null - } else { - R.drawable.shared_via_users to R.string.shared_icon_shared + if (holder !is OCFileListItemViewHolder && file.unreadCommentsCount != 0) return null + + return when { + file.isSharedWithSharee || file.isSharedWithMe -> { + if (showShareAvatar) null else R.drawable.shared_via_users to R.string.shared_icon_shared } - } else if (file.isSharedViaLink) { - R.drawable.shared_via_link to R.string.shared_icon_shared_via_link - } else { - R.drawable.ic_unshared to R.string.shared_icon_share + file.isSharedViaLink -> R.drawable.shared_via_link to R.string.shared_icon_shared_via_link + else -> R.drawable.ic_unshared to R.string.shared_icon_share } }