crop picasso thumbnails only if set so in the app settings

This commit is contained in:
tibbi 2021-02-18 21:02:59 +01:00
parent 15e7c72104
commit 2561c96c92

View file

@ -502,10 +502,14 @@ fun Context.tryLoadingWithPicasso(path: String, view: MySquareImageView, cropThu
try { try {
var builder = Picasso.get() var builder = Picasso.get()
.load(pathToLoad) .load(pathToLoad)
.centerCrop()
.fit()
.stableKey(signature.toString()) .stableKey(signature.toString())
builder = if (cropThumbnails) {
builder.centerCrop().fit()
} else {
builder.centerInside()
}
if (roundCorners != ROUNDED_CORNERS_NONE) { 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 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() val cornerRadius = resources.getDimension(cornerSize).toInt()