renaming the rounded corners transformer for picasso

This commit is contained in:
tibbi 2021-02-19 16:04:39 +01:00
parent e940b6813b
commit 46d298596a
2 changed files with 2 additions and 2 deletions

View file

@ -577,7 +577,7 @@ fun Context.tryLoadingWithPicasso(path: String, view: MySquareImageView, cropThu
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()
builder = builder.transform(RoundedCornersTransformation(cornerRadius.toFloat()))
builder = builder.transform(PicassoRoundedCornersTransformation(cornerRadius.toFloat()))
}
builder.into(view)

View file

@ -4,7 +4,7 @@ import android.graphics.*
import com.squareup.picasso.Transformation
// taken from https://stackoverflow.com/a/35241525/1967672
class RoundedCornersTransformation(private val radius: Float) : Transformation {
class PicassoRoundedCornersTransformation(private val radius: Float) : Transformation {
override fun transform(source: Bitmap): Bitmap {
val size = Math.min(source.width, source.height)