From 422b1fb6903b35ab9d24040338ee011b6db2b9a3 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 29 Dec 2017 21:42:25 +0100 Subject: [PATCH] use the default zoom level if the image matches the screen --- .../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 35796660a..b99ac8867 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -37,7 +37,7 @@ import java.io.File import java.io.FileOutputStream class PhotoFragment : ViewPagerFragment() { - private var DEFAULT_DOUBLE_TAP_ZOOM = 5f + private var DEFAULT_DOUBLE_TAP_ZOOM = 2f private var isFragmentVisible = false private var isFullscreen = false private var wasInit = false @@ -283,7 +283,7 @@ class PhotoFragment : ViewPagerFragment() { val bitmapAspectRatio = height / width.toFloat() val screenAspectRatio = ViewPagerActivity.screenHeight / ViewPagerActivity.screenWidth.toFloat() - return if (context == null) { + return if (context == null || bitmapAspectRatio == screenAspectRatio) { DEFAULT_DOUBLE_TAP_ZOOM } else if (ViewPagerActivity.wasDecodedByGlide) { 1f