Skip to content

Commit d616f3d

Browse files
committed
fix(notifications): banner inline list animation flicking
1 parent 7a81dfe commit d616f3d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

feature/notification/api/src/androidMain/kotlin/net/thunderbird/feature/notification/api/ui/BannerInlineNotificationListHost.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package net.thunderbird.feature.notification.api.ui
22

33
import androidx.compose.animation.AnimatedContent
4+
import androidx.compose.animation.animateContentSize
45
import androidx.compose.foundation.layout.Arrangement
56
import androidx.compose.foundation.layout.Column
67
import androidx.compose.foundation.layout.fillMaxWidth
@@ -69,6 +70,7 @@ fun BannerInlineNotificationListHost(
6970
targetState = bannerInlineSet,
7071
modifier = modifier.testTagAsResourceId(TEST_TAG_HOST_PARENT),
7172
transitionSpec = { bannerSlideInSlideOutAnimationSpec() },
73+
contentKey = { it.isEmpty() },
7274
) { bannerInlineSet ->
7375
if (bannerInlineSet.isNotEmpty()) {
7476
BannerInlineNotificationListHostLayout(
@@ -121,6 +123,7 @@ private fun BannerInlineNotificationListHostLayout(
121123
}
122124
},
123125
behaviour = BannerInlineNotificationCardBehaviour.Clipped,
126+
modifier = Modifier.animateContentSize(),
124127
)
125128
}
126129

@@ -139,7 +142,9 @@ private fun BannerInlineNotificationListHostLayout(
139142
modifier = Modifier.testTagAsResourceId(TEST_TAG_CHECK_ERROR_NOTIFICATIONS_ACTION),
140143
)
141144
},
142-
modifier = Modifier.testTagAsResourceId(TEST_TAG_CHECK_ERROR_NOTIFICATIONS),
145+
modifier = Modifier
146+
.testTagAsResourceId(TEST_TAG_CHECK_ERROR_NOTIFICATIONS)
147+
.animateContentSize(),
143148
)
144149
}
145150
}

0 commit comments

Comments
 (0)