https://kotlinlang.org logo
r

Ravi

06/23/2021, 9:22 PM
I’m unable to find
CircleCropTransformation
for glide lib mentioned in the accompanist documentation.
Copy code
import androidx.compose.foundation.Image
import com.google.accompanist.glide.rememberGlidePainter

Image(
    painter = rememberGlidePainter(
        request = "<https://picsum.photos/300/300>",
        requestBuilder = {
            transformations(CircleCropTransformation())
        },
    ),
    contentDescription = stringResource(R.string.image_content_desc),
)
e

Eric Ampire [MOD]

06/23/2021, 9:24 PM
It only works with coil, if you are using glide you have to use Modifier.clip(CircleShap)
r

Ravi

06/23/2021, 9:37 PM
image wont transform to circle shape, if contentScale is fit
n

Nthily

06/23/2021, 11:20 PM
Yes, there are no
transformations(CircleCropTransformation())
in glide
try to { Modifier.clip(CircleShape), contentScale = ContentScale.Crop } ?
👍 1
a

Akash Amin

06/24/2021, 1:03 PM
Copy code
requestBuilder = { circleCrop() }
Can work too.
9 Views