From 1aa9ebe2862bfd31bf2127a185567cf570339d70 Mon Sep 17 00:00:00 2001 From: Guillaume Date: Fri, 3 Nov 2017 21:36:17 +0100 Subject: [PATCH] Rotation button fix When rotating is initiated, show rotate button permanently to facilitate further rotation. Also, prevent accidental click on Delete when the option "replace share with rotate" is enabled. --- .../gallery/activities/ViewPagerActivity.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 177f0b38d..85d7ca53a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -236,6 +236,11 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View findItem(R.id.menu_share_1).isVisible = !config.replaceShare findItem(R.id.menu_share_2).isVisible = config.replaceShare findItem(R.id.menu_rotate).isVisible = currentMedium.isImage() + findItem(R.id.menu_rotate).setShowAsAction( + if (mRotationDegrees !== 0f) + MenuItem.SHOW_AS_ACTION_ALWAYS + else + MenuItem.SHOW_AS_ACTION_IF_ROOM) findItem(R.id.menu_save_as).isVisible = mRotationDegrees != 0f findItem(R.id.menu_hide).isVisible = !currentMedium.name.startsWith('.') findItem(R.id.menu_unhide).isVisible = currentMedium.name.startsWith('.')