From cf72f7bf782884d2ebd72f87b8229b584d8f8d3b Mon Sep 17 00:00:00 2001 From: kosenda Date: Sat, 16 Sep 2023 15:36:57 +0900 Subject: [PATCH 1/2] feature: change fade favorite animation end --- .../sessions/component/BookmarkIcon.kt | 24 ++++++++++++------- .../sessions/component/TimetableTopArea.kt | 1 + 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/feature/sessions/src/main/java/io/github/droidkaigi/confsched2023/sessions/component/BookmarkIcon.kt b/feature/sessions/src/main/java/io/github/droidkaigi/confsched2023/sessions/component/BookmarkIcon.kt index df038ee4d..e681210fb 100644 --- a/feature/sessions/src/main/java/io/github/droidkaigi/confsched2023/sessions/component/BookmarkIcon.kt +++ b/feature/sessions/src/main/java/io/github/droidkaigi/confsched2023/sessions/component/BookmarkIcon.kt @@ -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 @@ -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 }, @@ -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, + ) } } diff --git a/feature/sessions/src/main/java/io/github/droidkaigi/confsched2023/sessions/component/TimetableTopArea.kt b/feature/sessions/src/main/java/io/github/droidkaigi/confsched2023/sessions/component/TimetableTopArea.kt index 69087e337..6cd0d18f0 100644 --- a/feature/sessions/src/main/java/io/github/droidkaigi/confsched2023/sessions/component/TimetableTopArea.kt +++ b/feature/sessions/src/main/java/io/github/droidkaigi/confsched2023/sessions/component/TimetableTopArea.kt @@ -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 From ae0f40a47223a9e962e394cffaacc8787b0d6c13 Mon Sep 17 00:00:00 2001 From: kosenda Date: Sat, 16 Sep 2023 15:43:00 +0900 Subject: [PATCH 2/2] fix: auto correct --- .../confsched2023/sessions/component/TimetableTopArea.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/feature/sessions/src/main/java/io/github/droidkaigi/confsched2023/sessions/component/TimetableTopArea.kt b/feature/sessions/src/main/java/io/github/droidkaigi/confsched2023/sessions/component/TimetableTopArea.kt index 6cd0d18f0..69087e337 100644 --- a/feature/sessions/src/main/java/io/github/droidkaigi/confsched2023/sessions/component/TimetableTopArea.kt +++ b/feature/sessions/src/main/java/io/github/droidkaigi/confsched2023/sessions/component/TimetableTopArea.kt @@ -1,6 +1,5 @@ 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