mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2024-12-23 06:36:27 +01:00
check if we are trying to rotate a photo fragment
This commit is contained in:
parent
c0fcb48d9c
commit
814b0cc3b6
@ -218,11 +218,17 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||
|
||||
private fun rotateImage(degrees: Float) {
|
||||
mRotationDegrees = (mRotationDegrees + degrees) % 360
|
||||
getCurrentFragment().rotateImageViewBy(mRotationDegrees)
|
||||
getCurrentFragment()?.rotateImageViewBy(mRotationDegrees)
|
||||
supportInvalidateOptionsMenu()
|
||||
}
|
||||
|
||||
private fun getCurrentFragment() = ((view_pager.adapter as MyPagerAdapter).getCurrentFragment(view_pager.currentItem) as PhotoFragment)
|
||||
private fun getCurrentFragment(): PhotoFragment? {
|
||||
val fragment = (view_pager.adapter as MyPagerAdapter).getCurrentFragment(view_pager.currentItem)
|
||||
return if (fragment is PhotoFragment)
|
||||
fragment
|
||||
else
|
||||
null
|
||||
}
|
||||
|
||||
private fun showProperties() {
|
||||
if (getCurrentMedium() != null)
|
||||
|
Loading…
Reference in New Issue
Block a user