https://kotlinlang.org logo
Title
t

Tolriq

05/11/2023, 6:19 AM
With the last releases a surface with a clip can no more animate it's shape.
val radius = if (isPlaying) 16.dp else 64.dp / 2f
val cornerRadius = animateDpAsState(targetValue = radius, label = "")
Surface(
	modifier = Modifier
		.size(64.dp)
		.clip(RoundedCornerShape(cornerRadius.value))
		.combinedClickable(onClick = { viewModel.playPause() }, onLongClick = { viewModel.stop() }),
	color = MaterialTheme.colorScheme.primary,
	shape = RoundedCornerShape(cornerRadius.value),
)
Removing the shape fix this and the shape was probably not necessary in this case (But the clip necessary for the combinedclickable and the shape was left here for consistency and clarity of intent). Is this normal and was a bug before or should I open an issue ?
r

Rebecca Franks

05/12/2023, 8:48 AM
This sounds like a bug, could you file an issue with screenshots?
t

Tolriq

05/12/2023, 9:14 AM
@Rebecca Franks https://issuetracker.google.com/issues/282025223 (Seeing the last reactions on my last reports, would be nice if you could ensure this is triaged, thanks)