import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
@Composable
fun SimpleListScreen() {
val itemsList = List(20) { index -> "Item ${index + 1}" }
LazyColumn {
items(itemsList) { item ->
Text(
text = item,
modifier = Modifier.padding(16.dp),
style = MaterialTheme.typography.bodyLarge
)
}
}
}We create a list of 20 strings labeled "Item 1" to "Item 20" using List constructor. Then, we use LazyColumn to display the list vertically and scrollable. The items() function iterates over the list and shows each item as a Text composable with padding for spacing. This approach is efficient because LazyColumn only renders visible items, making scrolling smooth even for large lists.