renaming the rounded corners transformer for picasso
This commit is contained in:
parent
e940b6813b
commit
46d298596a
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue