Skip to content

Instantly share code, notes, and snippets.

@arriolac
Created June 10, 2024 20:57
Show Gist options
  • Save arriolac/a4573c062a1352cb2dbd08ce85372d09 to your computer and use it in GitHub Desktop.
Save arriolac/a4573c062a1352cb2dbd08ce85372d09 to your computer and use it in GitHub Desktop.
// Copyright 2023 Google LLC.
// SPDX-License-Identifier: Apache-2.0
@Composable
private fun HomeContentGrid(/* ... */) {
LazyVerticalGrid(
// Adapt number of columns wherein each column has at least 362.dp of space
columns = GridCells.Adaptive(362.dp),
modifier = modifier.fillMaxSize()
) {
if (featuredPodcasts.isNotEmpty()) {
item(span = { GridItemSpan(this.maxLineSpan) }) {
FollowedPodcastItem(
pagerState = pagerState,
items = featuredPodcasts,
onPodcastUnfollowed = onPodcastUnfollowed,
navigateToPodcastDetails = navigateToPodcastDetails,
modifier = Modifier
.fillMaxWidth()
)
}
}
// Additional Grid items here
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment