Skip to content

Instantly share code, notes, and snippets.

@cp-radhika-s
Created October 5, 2022 11:41
Show Gist options
  • Save cp-radhika-s/349984e4e37ef0b98065d987bfca9644 to your computer and use it in GitHub Desktop.
Save cp-radhika-s/349984e4e37ef0b98065d987bfca9644 to your computer and use it in GitHub Desktop.
val interactionSource = remember { MutableInteractionSource() }
val isPressed = interactionSource.collectIsPressedAsState()
val cornerRadius by animateDpAsState(targetValue = if (isPressed.value) 10.dp else 50.dp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment