add animations to image rotating via menu buttons

This commit is contained in:
tibbi 2019-02-07 14:42:59 +01:00
parent 076559aa9d
commit 64f0bd41b1
2 changed files with 9 additions and 5 deletions

View File

@ -75,7 +75,7 @@ dependencies {
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.caverock:androidsvg-aar:1.3'
implementation 'com.github.tibbi:gestureviews:985ba285fb'
implementation 'com.github.tibbi:subsampling-scale-image-view:51cb8f922c'
implementation 'com.github.tibbi:subsampling-scale-image-view:672777cb4d'
kapt 'com.github.bumptech.glide:compiler:4.8.0' // keep it here too, not just in Commons, else loading SVGs wont work
kapt 'androidx.room:room-compiler:2.0.0'

View File

@ -557,10 +557,14 @@ class PhotoFragment : ViewPagerFragment() {
}
fun rotateImageViewBy(degrees: Int) {
mCurrentRotationDegrees = (mCurrentRotationDegrees + degrees) % 360
mLoadZoomableViewHandler.removeCallbacksAndMessages(null)
mIsSubsamplingVisible = false
loadBitmap(degrees)
if (mIsSubsamplingVisible) {
mView.subsampling_view.rotateBy(degrees)
} else {
mCurrentRotationDegrees = (mCurrentRotationDegrees + degrees) % 360
mLoadZoomableViewHandler.removeCallbacksAndMessages(null)
mIsSubsamplingVisible = false
loadBitmap(degrees)
}
}
private fun initExtendedDetails() {