From 2561c96c9269ca1875004b7599ba503301d640c0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 18 Feb 2021 21:02:59 +0100 Subject: [PATCH] crop picasso thumbnails only if set so in the app settings --- .../simplemobiletools/gallery/pro/extensions/Context.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt index 2c3e5d2cd..3f58c2027 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt @@ -502,10 +502,14 @@ fun Context.tryLoadingWithPicasso(path: String, view: MySquareImageView, cropThu try { var builder = Picasso.get() .load(pathToLoad) - .centerCrop() - .fit() .stableKey(signature.toString()) + builder = if (cropThumbnails) { + builder.centerCrop().fit() + } else { + builder.centerInside() + } + if (roundCorners != ROUNDED_CORNERS_NONE) { val cornerSize = if (roundCorners == ROUNDED_CORNERS_SMALL) R.dimen.rounded_corner_radius_small else R.dimen.rounded_corner_radius_big val cornerRadius = resources.getDimension(cornerSize).toInt()