Skip to content

Instantly share code, notes, and snippets.

@syntialai
Last active January 10, 2023 02:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save syntialai/56f7e4657ec010cc116fc9de4cd74dac to your computer and use it in GitHub Desktop.
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