fix: Restore image aspect ratio when drag ends (#207)

Previously, ending a drag on an image (that didn't result in dismissing
the fragment) animates the image back in to position restoring the X
axis scale factor.

The Y axis scale factor was not restored, potentially breaking the
image's aspect ratio. Restore the Y axis scale factor to fix this
(`ViewVideoFragment` already handles this correctly).

Fixes #202
This commit is contained in:
Nik Clayton 2023-10-28 20:28:57 +02:00 committed by GitHub
parent 523efa705c
commit 9dad367f6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -193,7 +193,7 @@ class ViewImageFragment : ViewMediaFragment() {
if (abs(view.translationY) > 180) {
photoActionsListener.onDismiss()
} else {
view.animate().translationY(0f).scaleX(1f).start()
view.animate().translationY(0f).scaleX(1f).scaleY(1f).start()
}
}
},