From ab06f366f8b4fb21b1111ff30168b2ada9ef03ad Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 2 Oct 2018 18:18:11 +0200 Subject: [PATCH] fix #967, do not allow toggling file visibility in the recycle bin --- .../com/simplemobiletools/gallery/adapters/MediaAdapter.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index 6ff454a58..6ec1bd548 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -177,8 +177,9 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList 0 - menu.findItem(R.id.cab_unhide).isVisible = hiddenCnt > 0 + val isInRecycleBin = getSelectedMedia().firstOrNull()?.getIsInRecycleBin() == true + menu.findItem(R.id.cab_hide).isVisible = unhiddenCnt > 0 && !isInRecycleBin + menu.findItem(R.id.cab_unhide).isVisible = hiddenCnt > 0 && !isInRecycleBin } private fun checkFavoriteBtnVisibility(menu: Menu) {