Skip to content

Commit cf96f87

Browse files
committed
Code snippet for Compose doc at https://developer.android.com/quick-guides/content/display-nested-list?hl=en (nested horizontal scrolling in vertical list
). Snippet builds as-is from DAC page.
1 parent 351fcb4 commit cf96f87

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.example.compose.snippets.lists
2+
3+
import androidx.compose.foundation.layout.size
4+
import androidx.compose.foundation.lazy.LazyColumn
5+
import androidx.compose.foundation.lazy.LazyRow
6+
import androidx.compose.material3.Text
7+
import androidx.compose.runtime.Composable
8+
import androidx.compose.ui.Modifier
9+
import androidx.compose.ui.unit.dp
10+
import coil.compose.AsyncImage
11+
12+
// [START android_compose_layouts_nested_scrolling]
13+
@Composable
14+
fun NestedScrollingRowsList(urls: List<String>) {
15+
LazyColumn {
16+
items(10) {
17+
LazyRow {
18+
item { Text("Row: $it") }
19+
items(urls.size) { index ->
20+
// AsyncImage provided by Coil.
21+
AsyncImage(
22+
model = urls[index],
23+
modifier = Modifier.size(150.dp),
24+
contentDescription = null
25+
)
26+
}
27+
}
28+
}
29+
}
30+
}
31+
// [END android_compose_layouts_nested_scrolling]

0 commit comments

Comments
 (0)