Assigned
Status Update
Comments
ho...@google.com <ho...@google.com>
os...@google.com <os...@google.com> #2
Can you attach / share a project that reproduces the issue?
No update yet.
Can you attach / share a project that reproduces the issue?
Description
animate dp used in margin value of linkTo function in ConstrainScope works only for first animation, and with change of animatedBtnPadding , it doesnt apply new value to margin.
```
val isKeyOpen = WindowInsets.isImeVisible
val btnPadding by remember(key1 = isKeyOpen) {
mutableStateOf(if (isKeyOpen) 20.dp else 40.dp)
}
val animatedBtnPadding by animateDpAsState(targetValue = btnPadding, label = "")
SmartButton(modifier = Modifier
.constrainAs(submitBtn) {
bottom.linkTo(parent.bottom, margin = animatedBtnPadding)
width = Dimension.matchParent
}
.imePadding(), onClick = onSubmitClicked) {
Text(text = stringResource(id = R.string.submit))
}
```