Skip to content

Instantly share code, notes, and snippets.

@GianpaMX
Created April 28, 2022 09:39
Show Gist options
  • Save GianpaMX/77ae22c639f1ef0a061324f01e7847f4 to your computer and use it in GitHub Desktop.
Save GianpaMX/77ae22c639f1ef0a061324f01e7847f4 to your computer and use it in GitHub Desktop.
val transition = updateTransition(selectedExpense != null, label = "transition")
val height by transition.animateDp(
label = "height",
transitionSpec = { tween(bottomSheeAnimationInMillis) },
targetValueByState = { isItSelected ->
configuration.screenHeightDp.dp * if (isItSelected) 1.0f else 0.8f
}
)
val roundCornerRadio by transition.animateDp(
label = "roundCorners",
transitionSpec = { tween(bottomSheeAnimationInMillis) },
targetValueByState = { isItSelected ->
if (isItSelected) 0.dp else 12.dp
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment