Created
January 6, 2026 13:21
-
-
Save linreal/05182d1ff018e41d1f00b37cdd6a7302 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @OptIn(ExperimentalFoundationApi::class) | |
| @Composable | |
| fun ShowCarousels(sections: List<Section>) { | |
| LazyColumn( | |
| modifier = Modifier.fillMaxSize() | |
| ) { | |
| items(sections, key = { it.id }) { section -> | |
| val rowState = rememberLazyListState( | |
| prefetchStrategy = LazyListPrefetchStrategy( | |
| nestedPrefetchItemCount = 6) | |
| ) | |
| Text( | |
| text = section.title, | |
| style = MaterialTheme.typography.titleMedium, | |
| modifier = Modifier.padding(start = 16.dp, top = 8.dp) | |
| ) | |
| LazyRow( | |
| state = rowState, | |
| contentPadding = PaddingValues(horizontal = 16.dp), | |
| horizontalArrangement = Arrangement.spacedBy(12.dp) | |
| ) { | |
| items( | |
| items = section.cards, | |
| key = { it.id }, | |
| contentType = { "card" } | |
| ) { card -> | |
| CardItem(card) | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment