From 1aa9ebe2862bfd31bf2127a185567cf570339d70 Mon Sep 17 00:00:00 2001 From: Guillaume Date: Fri, 3 Nov 2017 21:36:17 +0100 Subject: [PATCH 1/2] 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('.') From b4e43d1c21a52d995de82806030899f0c06d1ef6 Mon Sep 17 00:00:00 2001 From: Guillaume Date: Fri, 3 Nov 2017 22:05:56 +0100 Subject: [PATCH 2/2] Brackets and position fixed --- .../gallery/activities/ViewPagerActivity.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 85d7ca53a..73fd3750e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -236,14 +236,15 @@ 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('.') + findItem(R.id.menu_rotate).setShowAsAction( + if (mRotationDegrees !== 0f) { + MenuItem.SHOW_AS_ACTION_ALWAYS + } else { + MenuItem.SHOW_AS_ACTION_IF_ROOM + }) } return true