Skip to content

Instantly share code, notes, and snippets.

@syntialai
Last active Jan 10, 2023
Embed
What would you like to do?
Instagram home screen (Wrong example)
@Composable
fun HomeScreenWrong(modifier: Modifier = Modifier) {
val scrollState = rememberScrollState()
val context = LocalContext.current
Surface(modifier = modifier.fillMaxWidth()) {
Column(modifier = Modifier.verticalScroll(scrollState)) {
LazyRow(modifier = modifier.fillMaxWidth()) {
items(stories) { story ->
StoryThumbnail(story = story)
}
}
LazyColumn(modifier = modifier.fillMaxWidth()) {
items(posts) { post ->
PostCard(
post = safePost,
postCardListener = getPostCardListener(context),
modifier = Modifier.padding(vertical = 8.dp))
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment