From 9dad367f6f0f87974271f0917ca71e0d927b8c95 Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Sat, 28 Oct 2023 20:28:57 +0200 Subject: [PATCH] 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 --- app/src/main/java/app/pachli/fragment/ViewImageFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/app/pachli/fragment/ViewImageFragment.kt b/app/src/main/java/app/pachli/fragment/ViewImageFragment.kt index 40d6bd048..7989121f8 100644 --- a/app/src/main/java/app/pachli/fragment/ViewImageFragment.kt +++ b/app/src/main/java/app/pachli/fragment/ViewImageFragment.kt @@ -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() } } },