Skip to content

Commit

Permalink
Merge pull request #1258 from kosenda/feature/change-fade-favorite-an…
Browse files Browse the repository at this point in the history
…imation-end

Fade favorite animation end
  • Loading branch information
takahirom authored Sep 16, 2023
2 parents 7c5da28 + ae0f40a commit 62ac7dd
Showing 1 changed file with 16 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,
)
}
}

0 comments on commit 62ac7dd

Please sign in to comment.