From bb7b2cb9c357a585ec773b8cd457f29fb84e0ce0 Mon Sep 17 00:00:00 2001 From: MiMoHo <37556964+MiMoHo@users.noreply.github.com> Date: Fri, 3 Jul 2026 21:01:46 +0200 Subject: [PATCH] fix: hide non-functional "Move to" action in recycle bin In the fullscreen viewer, the overflow "Move to" item and the opt-in bottom-action Move button were shown for recycle-bin items, but moving is disabled from the bin (copyMoveTo only shows a "use Restore" toast). Guard both with !getIsInRecycleBin(), matching the adjacent rename/hide/ favorite items and the grid CAB, which already hide move in the bin. Copy stays visible since copying from the bin is functional. --- CHANGELOG.md | 3 +++ .../org/fossify/gallery/activities/ViewPagerActivity.kt | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f899049000..db503666d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Hide the non-functional "Move to" action when viewing items in the recycle bin ([#692]) ## [1.13.1] - 2026-02-14 ### Changed @@ -294,6 +296,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#648]: https://github.com/FossifyOrg/Gallery/issues/648 [#659]: https://github.com/FossifyOrg/Gallery/issues/659 [#666]: https://github.com/FossifyOrg/Gallery/issues/666 +[#692]: https://github.com/FossifyOrg/Gallery/issues/692 [#718]: https://github.com/FossifyOrg/Gallery/issues/718 [#734]: https://github.com/FossifyOrg/Gallery/issues/734 [#743]: https://github.com/FossifyOrg/Gallery/issues/743 diff --git a/app/src/main/kotlin/org/fossify/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/ViewPagerActivity.kt index 5c7ad4b5f4..bda18cebed 100644 --- a/app/src/main/kotlin/org/fossify/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/ViewPagerActivity.kt @@ -299,7 +299,8 @@ class ViewPagerActivity : BaseViewerActivity(), ViewPager.OnPageChangeListener, findItem(R.id.menu_set_as).isVisible = visibleBottomActions and BOTTOM_ACTION_SET_AS == 0 findItem(R.id.menu_copy_to_clipboard).isVisible = currentMedium.isImage() findItem(R.id.menu_copy_to).isVisible = visibleBottomActions and BOTTOM_ACTION_COPY == 0 - findItem(R.id.menu_move_to).isVisible = visibleBottomActions and BOTTOM_ACTION_MOVE == 0 + findItem(R.id.menu_move_to).isVisible = + visibleBottomActions and BOTTOM_ACTION_MOVE == 0 && !currentMedium.getIsInRecycleBin() findItem(R.id.menu_save_as).isVisible = rotationDegrees != 0 findItem(R.id.menu_print).isVisible = currentMedium.isImage() || currentMedium.isRaw() findItem(R.id.menu_resize).isVisible = visibleBottomActions and BOTTOM_ACTION_RESIZE == 0 && currentMedium.isImage() @@ -1038,7 +1039,9 @@ class ViewPagerActivity : BaseViewerActivity(), ViewPager.OnPageChangeListener, checkMediaManagementAndCopy(true) } - binding.bottomActions.bottomMove.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_MOVE != 0) + binding.bottomActions.bottomMove.beVisibleIf( + visibleBottomActions and BOTTOM_ACTION_MOVE != 0 && currentMedium?.getIsInRecycleBin() == false + ) binding.bottomActions.bottomMove.setOnLongClickListener { toast(org.fossify.commons.R.string.move); true } binding.bottomActions.bottomMove.setOnClickListener { moveFileTo()