mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 14:37:59 +01:00
use the default zoom level if the image matches the screen
This commit is contained in:
parent
30374930bd
commit
422b1fb690
1 changed files with 2 additions and 2 deletions
|
@ -37,7 +37,7 @@ import java.io.File
|
||||||
import java.io.FileOutputStream
|
import java.io.FileOutputStream
|
||||||
|
|
||||||
class PhotoFragment : ViewPagerFragment() {
|
class PhotoFragment : ViewPagerFragment() {
|
||||||
private var DEFAULT_DOUBLE_TAP_ZOOM = 5f
|
private var DEFAULT_DOUBLE_TAP_ZOOM = 2f
|
||||||
private var isFragmentVisible = false
|
private var isFragmentVisible = false
|
||||||
private var isFullscreen = false
|
private var isFullscreen = false
|
||||||
private var wasInit = false
|
private var wasInit = false
|
||||||
|
@ -283,7 +283,7 @@ class PhotoFragment : ViewPagerFragment() {
|
||||||
val bitmapAspectRatio = height / width.toFloat()
|
val bitmapAspectRatio = height / width.toFloat()
|
||||||
val screenAspectRatio = ViewPagerActivity.screenHeight / ViewPagerActivity.screenWidth.toFloat()
|
val screenAspectRatio = ViewPagerActivity.screenHeight / ViewPagerActivity.screenWidth.toFloat()
|
||||||
|
|
||||||
return if (context == null) {
|
return if (context == null || bitmapAspectRatio == screenAspectRatio) {
|
||||||
DEFAULT_DOUBLE_TAP_ZOOM
|
DEFAULT_DOUBLE_TAP_ZOOM
|
||||||
} else if (ViewPagerActivity.wasDecodedByGlide) {
|
} else if (ViewPagerActivity.wasDecodedByGlide) {
|
||||||
1f
|
1f
|
||||||
|
|
Loading…
Reference in a new issue