Corner radius is not working in Jetpack Glance Widget

444 Views Asked by At

My Glance image is set like this:

Image(
    provider = ImageProvider(
        bitmap
    ),
    contentDescription = "Image",
    modifier = GlanceModifier
        .size(70.dp)
        .imageCornerRadius()
        .clickable(
             actionRunCallback<StartAppCallback>(
                 parameters = actionParametersOf(
                     StartAppCallback.WIDGET_TYPE to type.value,
                     StartAppCallback.ID to model.id
                 )
             )
       ),
)

and image corner radius is set like:

fun GlanceModifier.imageCornerRadius(): GlanceModifier {
    return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
        this.cornerRadius(android.R.dimen.system_app_widget_inner_radius)
    } else {
        this.cornerRadius(8.dp)
    }
}

If it is a bug, and there are no workarounds, I will edit my question with the issue tracker link. Thanks for any advice.

0

There are 0 best solutions below