Skip to content

Commit 069124d

Browse files
authored
Merge pull request #349 from android/nested-scrolling-item
Code snippet for Compose doc at https://developer.android.com/quick-g…
2 parents 0fd02a1 + 244eab6 commit 069124d

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright 2024 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.example.compose.snippets.lists
18+
19+
import androidx.compose.foundation.layout.size
20+
import androidx.compose.foundation.lazy.LazyColumn
21+
import androidx.compose.foundation.lazy.LazyRow
22+
import androidx.compose.material3.Text
23+
import androidx.compose.runtime.Composable
24+
import androidx.compose.ui.Modifier
25+
import androidx.compose.ui.unit.dp
26+
import coil.compose.AsyncImage
27+
28+
// [START android_compose_layouts_nested_scrolling]
29+
@Composable
30+
fun NestedScrollingRowsList(urls: List<String>) {
31+
LazyColumn {
32+
items(10) {
33+
LazyRow {
34+
item { Text("Row: $it") }
35+
items(urls.size) { index ->
36+
// AsyncImage provided by Coil.
37+
AsyncImage(
38+
model = urls[index],
39+
modifier = Modifier.size(150.dp),
40+
contentDescription = null
41+
)
42+
}
43+
}
44+
}
45+
}
46+
}
47+
// [END android_compose_layouts_nested_scrolling]

0 commit comments

Comments
 (0)