A fully functional Android app built entirely with Kotlin and Jetpack Compose
Use animateItemPlacement() on feed
dahunsi77451779cd96
diff --git a/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt b/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.ktindex 85f9951b8..e2904afc3 100644--- a/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt+++ b/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt@@ -21,6 +21,7 @@ import android.net.Uriimport androidx.annotation.ColorIntimport androidx.browser.customtabs.CustomTabColorSchemeParamsimport androidx.browser.customtabs.CustomTabsIntent+import androidx.compose.foundation.ExperimentalFoundationApiimport androidx.compose.foundation.layout.paddingimport androidx.compose.foundation.lazy.LazyListScopeimport androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope@@ -47,6 +48,7 @@ import com.google.samples.apps.nowinandroid.core.model.data.UserNewsResource* An extension on [LazyListScope] defining a feed with news resources.* Depending on the [feedState], this might emit no items.*/+@OptIn(ExperimentalFoundationApi::class)fun LazyStaggeredGridScope.newsFeed(feedState: NewsFeedUiState,onNewsResourcesCheckedChanged: (String, Boolean) -> Unit,@@ -88,7 +90,9 @@ fun LazyStaggeredGridScope.newsFeed()},onTopicClick = onTopicClick,- modifier = Modifier.padding(horizontal = 8.dp),+ modifier = Modifier+ .padding(horizontal = 8.dp)+ .animateItemPlacement(),)}}