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.
This commit is contained in:
Guillaume 2017-11-03 21:36:17 +01:00 committed by GitHub
parent d0e4fd1df7
commit 1aa9ebe286
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -236,6 +236,11 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
findItem(R.id.menu_share_1).isVisible = !config.replaceShare findItem(R.id.menu_share_1).isVisible = !config.replaceShare
findItem(R.id.menu_share_2).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).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_save_as).isVisible = mRotationDegrees != 0f
findItem(R.id.menu_hide).isVisible = !currentMedium.name.startsWith('.') findItem(R.id.menu_hide).isVisible = !currentMedium.name.startsWith('.')
findItem(R.id.menu_unhide).isVisible = currentMedium.name.startsWith('.') findItem(R.id.menu_unhide).isVisible = currentMedium.name.startsWith('.')