Skip to content

Commit

Permalink
Animate home row appearance and disappearance
Browse files Browse the repository at this point in the history
  • Loading branch information
imashnake0 committed Mar 28, 2024
1 parent 43a3c1f commit 5cf99ab
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
package com.imashnake.animite.features.home

import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.animateColorAsState
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.tween
import androidx.compose.animation.expandVertically
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.shrinkVertically
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
Expand Down Expand Up @@ -206,7 +211,11 @@ fun HomeRow(
onItemClicked: (Media.Medium) -> Unit,
modifier: Modifier = Modifier
) {
if (list.isNotEmpty()) {
AnimatedVisibility(
visible = list.isNotEmpty(),
enter = fadeIn() + expandVertically(),
exit = fadeOut() + shrinkVertically()
) {
Column(
modifier = modifier,
verticalArrangement = Arrangement.spacedBy(LocalPaddings.current.medium)
Expand Down

0 comments on commit 5cf99ab

Please sign in to comment.