Skip to content

Commit

Permalink
feature: change fade favorite animation end
Browse files Browse the repository at this point in the history
  • Loading branch information
kosenda committed Sep 16, 2023
1 parent 3ed1da1 commit cf72f7b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package io.github.droidkaigi.confsched2023.sessions.component

import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.core.tween
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
Expand Down Expand Up @@ -53,7 +57,11 @@ fun BookmarkIcon(
modifier = modifier,
contentAlignment = Alignment.Center,
) {
if (lottieState.isPlaying && !lottieState.isAtEnd) {
AnimatedVisibility(
visible = lottieState.isPlaying,
enter = fadeIn(animationSpec = tween(0)),
exit = fadeOut(),
) {
LottieAnimation(
composition = lottieComposition,
progress = { lottieState.progress },
Expand All @@ -62,13 +70,13 @@ fun BookmarkIcon(
onClick(label = contentDescription, action = null)
},
)
} else {
Icon(
modifier = Modifier
.padding(12.dp),
imageVector = Icons.Outlined.Bookmarks,
contentDescription = contentDescription,
)
}

Icon(
modifier = Modifier
.padding(12.dp),
imageVector = Icons.Outlined.Bookmarks,
contentDescription = contentDescription,
)
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.droidkaigi.confsched2023.sessions.component

import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.clickable
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Search
Expand Down

0 comments on commit cf72f7b

Please sign in to comment.