mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 04:57:59 +01:00
renaming the rounded corners transformer for picasso
This commit is contained in:
parent
e940b6813b
commit
46d298596a
2 changed files with 2 additions and 2 deletions
|
@ -577,7 +577,7 @@ fun Context.tryLoadingWithPicasso(path: String, view: MySquareImageView, cropThu
|
||||||
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()
|
||||||
builder = builder.transform(RoundedCornersTransformation(cornerRadius.toFloat()))
|
builder = builder.transform(PicassoRoundedCornersTransformation(cornerRadius.toFloat()))
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.into(view)
|
builder.into(view)
|
||||||
|
|
|
@ -4,7 +4,7 @@ import android.graphics.*
|
||||||
import com.squareup.picasso.Transformation
|
import com.squareup.picasso.Transformation
|
||||||
|
|
||||||
// taken from https://stackoverflow.com/a/35241525/1967672
|
// 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 {
|
override fun transform(source: Bitmap): Bitmap {
|
||||||
val size = Math.min(source.width, source.height)
|
val size = Math.min(source.width, source.height)
|
||||||
|
|
Loading…
Reference in a new issue