Created
November 16, 2022 21:29
-
-
Save Ifeo-A/68ea41711ef9b3c4c14c95e02a13dd67 to your computer and use it in GitHub Desktop.
Compose crossfade animation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Crossfade(targetState = currentText.isEmpty()) { isEmpty -> | |
if(isEmpty){ | |
Icon( | |
imageVector = Icons.Outlined.Search, | |
contentDescription = null, | |
modifier = Modifier | |
.clickable { | |
currentText = "" | |
} | |
) | |
} else { | |
Icon( | |
imageVector = Icons.Outlined.Close, | |
contentDescription = null, | |
modifier = Modifier | |
.clickable { | |
currentText = "" | |
} | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment