How can i add transformation using picasso ? Pic...
# android
g
How can i add transformation using picasso ? Picasso.with(this.getContext()) .load(url) .centerCrop() .fit() .transform(??--what comes here--??) .into(this)
stackoverflow 8
c
I haven't used it yet, but it looks like it expects a class implementing the Transformation interface. Due to SAM, one should be able to use a lambda too
Since
transform(source : Bitmap)
only takes a single parameter, you can omit that and use
it
so it's
.transform {/* do stuff with 'it' */}.into(this)
g
It is works something like this:
val circle = CircleTransformation(); Picasso.with(this.getContext()) .load(R.drawable.display_pic_gtm) .centerCrop() .fit() .transform(circle) .into(this) My bad i don't know how to create an object .
c
there's also
Copy code
.transform( object() : Transformation {
     /* here goes the code */
}
)
g
yes, it takes list of transformations