We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8af9131 + 24c3d22 commit 281f0cfCopy full SHA for 281f0cf
1 file changed
app/src/main/java/com/getcode/ui/components/Badge.kt
@@ -1,6 +1,10 @@
1
package com.getcode.ui.components
2
3
import androidx.compose.animation.AnimatedVisibility
4
+import androidx.compose.animation.fadeIn
5
+import androidx.compose.animation.fadeOut
6
+import androidx.compose.animation.scaleIn
7
+import androidx.compose.animation.scaleOut
8
import androidx.compose.material.Text
9
import androidx.compose.runtime.Composable
10
import androidx.compose.ui.Modifier
@@ -17,7 +21,7 @@ fun Badge(
17
21
color: Color = CodeTheme.colors.brand,
18
22
contentColor: Color = Color.White,
19
23
) {
20
- AnimatedVisibility(visible = count > 0) {
24
+ AnimatedVisibility(visible = count > 0, enter = scaleIn() + fadeIn(), exit = fadeOut() + scaleOut()) {
25
val text = when {
26
count in 1..99 -> "$count"
27
else -> "99+"
0 commit comments