Skip to content

Instantly share code, notes, and snippets.

@mikkipastel
Created January 16, 2023 15:13
Show Gist options
  • Save mikkipastel/a41bfb0d7ddc080cd285a62721529b11 to your computer and use it in GitHub Desktop.
Save mikkipastel/a41bfb0d7ddc080cd285a62721529b11 to your computer and use it in GitHub Desktop.
LazyColumn with Jetpack Compose (LazyListScope)
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val names = listOf("Stocker DAO", "Bittoon DAO", "Apetimism", "LonelyPop")
setContent {
MyTheme {
// A surface container using the 'background' color from the theme
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colors.surface
) {
LazyColumn {
items(names) {
Greeting(name = it)
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment