I want to build a great lockscreen using compose like stock Android 12 like this:

I managed to do something similar, however i have 2 issues, one is when I use pointerInteropFilter to get the action events I use a remember value to change the shape, returning true in this function I got a similar animation, however the click listener is not called, if I return false the shape stays in "square", What I'm missing? is any way to animate the "shape"? I found for DP, color and size but not for shapes.
here is the code
@Composable
fun RoundedPinBackground(
modifier: Modifier = Modifier,
backgroundColor: Color,
onClicked: () -> Unit,
content: @Composable () -> Unit,
) {
var selected by remember { mutableStateOf(false) }
val shape = if (selected) {
RoundedCornerShape(10.dp)
} else {
CircleShape
}
Surface(
tonalElevation = 10.dp,
modifier = Modifier
.clip(shape)
) {
Box(modifier = modifier
.size(80.dp)
.clip(shape)
.background(color = backgroundColor)
.clickable { onClicked.invoke() }
.pointerInteropFilter {
when (it.action) {
MotionEvent.ACTION_DOWN -> {
selected = true
}
MotionEvent.ACTION_UP -> {
selected = false
}
}
true
},
contentAlignment = Alignment.Center
) {
content()
}
}
}
This are my results


