Status Update
Comments
al...@gmail.com <al...@gmail.com> #2
Can you try with the latest snapshot? Not reproducible for me on androidx-main.
ti...@google.com <ti...@google.com> #3
Ok, after trying a couple more versions, realized this is a duplicate of
From the release notes:
AndroidView's update callback's first invocation will now be defered until the view is attached, instead of running when the composition that introduces the AndroidView is applied. This fixes a bug where the update callback wouldn't be invalidated if a state it read was changed immediately by an effect. (Ie9438,
) b/291094055
Sorry for the confusion!
sg...@google.com <sg...@google.com> #4
Of course :)
I've tried this code, but could not recreate the issue as observed in the video (see attached video).
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
var isPlaying by remember { mutableStateOf(false) }
val radius = if (isPlaying) 16.dp else 64.dp / 2f
val cornerRadius = animateDpAsState(targetValue = radius, label = "")
Surface(
modifier = Modifier
.size(64.dp)
.aspectRatio(1f)
.clip(RoundedCornerShape(cornerRadius.value))
.combinedClickable(onClick = { isPlaying = !isPlaying }, onLongClick = { }),
color = MaterialTheme.colorScheme.primary,
shape = RoundedCornerShape(cornerRadius.value),
) { }
}
The latest change to Surface
was done on May 29, 2023, and it was only dealing with colors, so I don't think the issue was a Surface related one.
What I noticed is that the issue was filed against Material 3 1.2.0-alpha01
, while we already have alpha09
out there. Also, the specified Compose version is 1.5.0-alpha04
, while we already have a stable 1.5.3
and a 1.6.0-alpha07
out.
My advise would be to try an update your dependencies and see if this issue still occurs.
Thanks!
sg...@google.com <sg...@google.com> #5
Attached video
to...@gmail.com <to...@gmail.com> #6
It was in May and forgotten as not triaged with a workaround, will test again next week and confirm.
Description
Jetpack Compose version: 1.5.0 alpha 4
Jetpack Compose component used: Material 3 1.2 alpha 1
Android Studio Build: Giraffe B2
Kotlin version: 1.8.21
Starting with the last versions of compose surface shape animations are broken when using clipping.
Given the following code:
The shape is broken an no more animate properly see the broken video. (It worked before).
Removing the
shape=
part of the code does fix the shape. See work video.The play / pause button on the video is the above code.