diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt index ac06ffe53..4fe3f6e03 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt @@ -141,7 +141,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View currentMedium.isFavorite = mFavoritePaths.contains(currentMedium.path) val visibleBottomActions = if (config.bottomActions) config.visibleBottomActions else 0 - val rotationDegrees = getCurrentPhotoFragment()?.mCurrentRotationDegrees + val rotationDegrees = getCurrentPhotoFragment()?.mCurrentRotationDegrees ?: 1 menu.apply { findItem(R.id.menu_show_on_map).isVisible = visibleBottomActions and BOTTOM_ACTION_SHOW_ON_MAP == 0 findItem(R.id.menu_slideshow).isVisible = visibleBottomActions and BOTTOM_ACTION_SLIDESHOW == 0 @@ -593,6 +593,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View val photoFragment = getCurrentPhotoFragment() ?: return@Thread saveRotatedImageToFile(currPath, it, photoFragment.mCurrentRotationDegrees, true) { toast(R.string.file_saved) + getCurrentPhotoFragment()?.mCurrentRotationDegrees = 0 invalidateOptionsMenu() } }.start() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt index 86770742d..23f1aca8c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt @@ -481,6 +481,7 @@ class PhotoFragment : ViewPagerFragment() { override fun onImageRotation(degrees: Int) { if (mCurrentRotationDegrees != degrees) { loadBitmap(degrees, false) + activity?.invalidateOptionsMenu() } mCurrentRotationDegrees = degrees }