ForEach -> For loop in customItems, customItemsIndexed (v1.0.1)
This commit is contained in:
parent
62eeca017f
commit
b2df80daea
1 changed files with 3 additions and 3 deletions
|
|
@ -11,7 +11,7 @@ fun <T> LazyListScope.customItems(
|
||||||
key: (T) -> Any?,
|
key: (T) -> Any?,
|
||||||
content: @Composable LazyItemScope.(T) -> Unit
|
content: @Composable LazyItemScope.(T) -> Unit
|
||||||
) {
|
) {
|
||||||
items.forEach {
|
for (it in items) {
|
||||||
item(key = key(it)) {
|
item(key = key(it)) {
|
||||||
content(it)
|
content(it)
|
||||||
}
|
}
|
||||||
|
|
@ -23,7 +23,7 @@ fun <T> LazyListScope.customItemsIndexed(
|
||||||
key: (T) -> Any?,
|
key: (T) -> Any?,
|
||||||
content: @Composable LazyItemScope.(Int, T) -> Unit
|
content: @Composable LazyItemScope.(Int, T) -> Unit
|
||||||
) {
|
) {
|
||||||
items.forEachIndexed { index, item ->
|
for ((index, item) in items.withIndex()) {
|
||||||
item(key = key(item)) {
|
item(key = key(item)) {
|
||||||
content(index, item)
|
content(index, item)
|
||||||
}
|
}
|
||||||
|
|
@ -35,7 +35,7 @@ fun <T> LazyGridScope.customItems(
|
||||||
key: (T) -> Any?,
|
key: (T) -> Any?,
|
||||||
content: @Composable LazyGridItemScope.(T) -> Unit
|
content: @Composable LazyGridItemScope.(T) -> Unit
|
||||||
) {
|
) {
|
||||||
items.forEach {
|
for (it in items) {
|
||||||
item(key = key(it)) {
|
item(key = key(it)) {
|
||||||
content(it)
|
content(it)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue