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 6abee7975..b878c0d01 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -286,7 +286,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View R.id.menu_edit -> openEditor(Uri.fromFile(getCurrentFile())) R.id.menu_properties -> showProperties() R.id.menu_show_on_map -> showOnMap() - R.id.menu_rotate -> rotateImage() + R.id.menu_rotate_right -> rotateImage(90) + R.id.menu_rotate_left -> rotateImage(270) + R.id.menu_rotate_one_eighty -> rotateImage(180) R.id.menu_lock_orientation -> toggleLockOrientation() R.id.menu_save_as -> saveImageAs() R.id.menu_settings -> launchSettings() @@ -469,8 +471,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } } - private fun rotateImage() { - mRotationDegrees = (mRotationDegrees + 90) % 360 + private fun rotateImage(degrees: Int) { + mRotationDegrees = (mRotationDegrees + degrees) % 360 getCurrentFragment()?.let { (it as? PhotoFragment)?.rotateImageViewBy(mRotationDegrees) } diff --git a/app/src/main/res/menu/menu_viewpager.xml b/app/src/main/res/menu/menu_viewpager.xml index f22a0afb3..047c77d9f 100644 --- a/app/src/main/res/menu/menu_viewpager.xml +++ b/app/src/main/res/menu/menu_viewpager.xml @@ -21,7 +21,19 @@ android:id="@+id/menu_rotate" android:icon="@drawable/ic_rotate_right" android:title="@string/rotate" - app:showAsAction="ifRoom"/> + app:showAsAction="ifRoom"> +
+