fixing some manual rotation related glitch

This commit is contained in:
tibbi 2019-02-06 21:40:33 +01:00
parent d55c9bb2cb
commit 0d6c9589e3
2 changed files with 3 additions and 1 deletions

View File

@ -141,7 +141,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
currentMedium.isFavorite = mFavoritePaths.contains(currentMedium.path) currentMedium.isFavorite = mFavoritePaths.contains(currentMedium.path)
val visibleBottomActions = if (config.bottomActions) config.visibleBottomActions else 0 val visibleBottomActions = if (config.bottomActions) config.visibleBottomActions else 0
val rotationDegrees = getCurrentPhotoFragment()?.mCurrentRotationDegrees val rotationDegrees = getCurrentPhotoFragment()?.mCurrentRotationDegrees ?: 1
menu.apply { menu.apply {
findItem(R.id.menu_show_on_map).isVisible = visibleBottomActions and BOTTOM_ACTION_SHOW_ON_MAP == 0 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 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 val photoFragment = getCurrentPhotoFragment() ?: return@Thread
saveRotatedImageToFile(currPath, it, photoFragment.mCurrentRotationDegrees, true) { saveRotatedImageToFile(currPath, it, photoFragment.mCurrentRotationDegrees, true) {
toast(R.string.file_saved) toast(R.string.file_saved)
getCurrentPhotoFragment()?.mCurrentRotationDegrees = 0
invalidateOptionsMenu() invalidateOptionsMenu()
} }
}.start() }.start()

View File

@ -481,6 +481,7 @@ class PhotoFragment : ViewPagerFragment() {
override fun onImageRotation(degrees: Int) { override fun onImageRotation(degrees: Int) {
if (mCurrentRotationDegrees != degrees) { if (mCurrentRotationDegrees != degrees) {
loadBitmap(degrees, false) loadBitmap(degrees, false)
activity?.invalidateOptionsMenu()
} }
mCurrentRotationDegrees = degrees mCurrentRotationDegrees = degrees
} }