fix getShareIconIdAndContentDescriptionId logic

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-11-14 15:55:33 +01:00 committed by Alper Öztürk
parent 19ac34e299
commit d554f01407

View file

@ -384,20 +384,16 @@ class OCFileListDelegate(
} }
private fun getShareIconIdAndContentDescriptionId(holder: ListViewHolder, file: OCFile): Pair<Int, Int>? { private fun getShareIconIdAndContentDescriptionId(holder: ListViewHolder, file: OCFile): Pair<Int, Int>? {
if (!MDMConfig.sharingSupport(context) || file.isOfflineOperation || holder !is OCFileListItemViewHolder || file.unreadCommentsCount != 0) { if (file.isOfflineOperation) return null
return null
}
return if (file.isSharedWithSharee || file.isSharedWithMe) { if (holder !is OCFileListItemViewHolder && file.unreadCommentsCount != 0) return null
if (showShareAvatar) {
null return when {
} else { file.isSharedWithSharee || file.isSharedWithMe -> {
R.drawable.shared_via_users to R.string.shared_icon_shared if (showShareAvatar) null else R.drawable.shared_via_users to R.string.shared_icon_shared
} }
} else if (file.isSharedViaLink) { file.isSharedViaLink -> R.drawable.shared_via_link to R.string.shared_icon_shared_via_link
R.drawable.shared_via_link to R.string.shared_icon_shared_via_link else -> R.drawable.ic_unshared to R.string.shared_icon_share
} else {
R.drawable.ic_unshared to R.string.shared_icon_share
} }
} }