From 3248ab3443741e0dfa24b96dc5afedd014710fbf Mon Sep 17 00:00:00 2001 From: Veyndan Stuart Date: Wed, 28 Jun 2023 11:53:39 +0200 Subject: [PATCH] Add `CrossAxisAlignment` property to `LazyList` (#1277) --- .../redwood/lazylayout/compose/LazyDsl.kt | 9 ++++ .../redwood/lazylayout/compose/LazyList.kt | 5 +++ .../layout/composeui/ComposeUiLazyListTest.kt | 9 ++++ .../lazylayout/composeui/ComposeUiLazyList.kt | 22 ++++++++++ ...olumnWithUpdatedAlignItems[LTR]_center.png | 4 +- ...lumnWithUpdatedAlignItems[LTR]_flexend.png | 4 +- ...olumnWithUpdatedAlignItems[RTL]_center.png | 4 +- ...lumnWithUpdatedAlignItems[RTL]_flexend.png | 4 +- ...ayoutWithAlignItems[LTR,Column,Center].png | 4 +- ...youtWithAlignItems[LTR,Column,FlexEnd].png | 4 +- ...t_layoutWithAlignItems[LTR,Row,Center].png | 4 +- ..._layoutWithAlignItems[LTR,Row,FlexEnd].png | 4 +- ...ayoutWithAlignItems[RTL,Column,Center].png | 4 +- ...youtWithAlignItems[RTL,Column,FlexEnd].png | 4 +- ...t_layoutWithAlignItems[RTL,Row,Center].png | 4 +- ..._layoutWithAlignItems[RTL,Row,FlexEnd].png | 4 +- .../app/cash/redwood/lazylayout/widgets.kt | 3 ++ .../lazylayout/uiview/UIViewLazyList.kt | 5 +++ .../redwood/lazylayout/view/ViewLazyList.kt | 42 +++++++++++++------ .../lazylayout/view/ViewLazyListTest.kt | 9 ++++ ...olumnWithUpdatedAlignItems[LTR]_center.png | 4 +- ...lumnWithUpdatedAlignItems[LTR]_flexend.png | 4 +- ...olumnWithUpdatedAlignItems[RTL]_center.png | 4 +- ...lumnWithUpdatedAlignItems[RTL]_flexend.png | 4 +- ...ayoutWithAlignItems[LTR,Column,Center].png | 4 +- ...youtWithAlignItems[LTR,Column,FlexEnd].png | 4 +- ...youtWithAlignItems[LTR,Column,Stretch].png | 4 +- ...t_layoutWithAlignItems[LTR,Row,Center].png | 4 +- ..._layoutWithAlignItems[LTR,Row,Stretch].png | 2 +- ...ayoutWithAlignItems[RTL,Column,Center].png | 4 +- ...youtWithAlignItems[RTL,Column,FlexEnd].png | 4 +- ...youtWithAlignItems[RTL,Column,Stretch].png | 4 +- ...t_layoutWithAlignItems[RTL,Row,Center].png | 4 +- ..._layoutWithAlignItems[RTL,Row,Stretch].png | 2 +- 34 files changed, 142 insertions(+), 62 deletions(-) diff --git a/redwood-lazylayout-compose/src/commonMain/kotlin/app/cash/redwood/lazylayout/compose/LazyDsl.kt b/redwood-lazylayout-compose/src/commonMain/kotlin/app/cash/redwood/lazylayout/compose/LazyDsl.kt index f2fd2b29a8..e16e66c720 100644 --- a/redwood-lazylayout-compose/src/commonMain/kotlin/app/cash/redwood/lazylayout/compose/LazyDsl.kt +++ b/redwood-lazylayout-compose/src/commonMain/kotlin/app/cash/redwood/lazylayout/compose/LazyDsl.kt @@ -19,6 +19,7 @@ import androidx.compose.runtime.Composable import app.cash.redwood.LayoutScopeMarker import app.cash.redwood.Modifier import app.cash.redwood.layout.api.Constraint +import app.cash.redwood.layout.api.CrossAxisAlignment import app.cash.redwood.ui.Margin @LayoutScopeMarker @@ -75,6 +76,7 @@ public fun LazyRow( width: Constraint = Constraint.Wrap, height: Constraint = Constraint.Wrap, margin: Margin = Margin.Zero, + verticalAlignment: CrossAxisAlignment = CrossAxisAlignment.Start, modifier: Modifier = Modifier, placeholder: @Composable () -> Unit, content: LazyListScope.() -> Unit, @@ -84,6 +86,7 @@ public fun LazyRow( width = width, height = height, margin = margin, + crossAxisAlignment = verticalAlignment, modifier = modifier, placeholder = placeholder, content = content, @@ -98,6 +101,7 @@ public fun LazyRow( width: Constraint = Constraint.Wrap, height: Constraint = Constraint.Wrap, margin: Margin = Margin.Zero, + verticalAlignment: CrossAxisAlignment = CrossAxisAlignment.Start, modifier: Modifier = Modifier, placeholder: @Composable () -> Unit, content: LazyListScope.() -> Unit, @@ -109,6 +113,7 @@ public fun LazyRow( width = width, height = height, margin = margin, + crossAxisAlignment = verticalAlignment, modifier = modifier, placeholder = placeholder, content = content, @@ -120,6 +125,7 @@ public fun LazyColumn( width: Constraint = Constraint.Wrap, height: Constraint = Constraint.Wrap, margin: Margin = Margin.Zero, + horizontalAlignment: CrossAxisAlignment = CrossAxisAlignment.Start, modifier: Modifier = Modifier, placeholder: @Composable () -> Unit, content: LazyListScope.() -> Unit, @@ -129,6 +135,7 @@ public fun LazyColumn( width = width, height = height, margin = margin, + crossAxisAlignment = horizontalAlignment, modifier = modifier, placeholder = placeholder, content = content, @@ -143,6 +150,7 @@ public fun LazyColumn( width: Constraint = Constraint.Wrap, height: Constraint = Constraint.Wrap, margin: Margin = Margin.Zero, + horizontalAlignment: CrossAxisAlignment = CrossAxisAlignment.Start, modifier: Modifier = Modifier, placeholder: @Composable () -> Unit, content: LazyListScope.() -> Unit, @@ -154,6 +162,7 @@ public fun LazyColumn( width = width, height = height, margin = margin, + crossAxisAlignment = horizontalAlignment, modifier = modifier, placeholder = placeholder, content = content, diff --git a/redwood-lazylayout-compose/src/commonMain/kotlin/app/cash/redwood/lazylayout/compose/LazyList.kt b/redwood-lazylayout-compose/src/commonMain/kotlin/app/cash/redwood/lazylayout/compose/LazyList.kt index 0e888f5ff5..b88abd73b6 100644 --- a/redwood-lazylayout-compose/src/commonMain/kotlin/app/cash/redwood/lazylayout/compose/LazyList.kt +++ b/redwood-lazylayout-compose/src/commonMain/kotlin/app/cash/redwood/lazylayout/compose/LazyList.kt @@ -25,6 +25,7 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import app.cash.redwood.Modifier import app.cash.redwood.layout.api.Constraint +import app.cash.redwood.layout.api.CrossAxisAlignment import app.cash.redwood.ui.Margin import kotlin.jvm.JvmName @@ -36,6 +37,7 @@ internal fun LazyList( width: Constraint, height: Constraint, margin: Margin, + crossAxisAlignment: CrossAxisAlignment, modifier: Modifier, placeholder: @Composable () -> Unit, content: LazyListScope.() -> Unit, @@ -63,6 +65,7 @@ internal fun LazyList( width = width, height = height, margin = margin, + crossAxisAlignment = crossAxisAlignment, modifier = modifier, placeholder = { repeat(placeholderPoolSize) { placeholder() } }, items = { @@ -83,6 +86,7 @@ internal fun RefreshableLazyList( width: Constraint, height: Constraint, margin: Margin, + crossAxisAlignment: CrossAxisAlignment, modifier: Modifier, placeholder: @Composable () -> Unit, content: LazyListScope.() -> Unit, @@ -112,6 +116,7 @@ internal fun RefreshableLazyList( width = width, height = height, margin = margin, + crossAxisAlignment = crossAxisAlignment, modifier = modifier, placeholder = { repeat(placeholderPoolSize) { placeholder() } }, items = { diff --git a/redwood-lazylayout-composeui/src/androidUnitTest/kotlin/app/cash/redwood/layout/composeui/ComposeUiLazyListTest.kt b/redwood-lazylayout-composeui/src/androidUnitTest/kotlin/app/cash/redwood/layout/composeui/ComposeUiLazyListTest.kt index 6a0c9629d7..f0c264c9b6 100644 --- a/redwood-lazylayout-composeui/src/androidUnitTest/kotlin/app/cash/redwood/layout/composeui/ComposeUiLazyListTest.kt +++ b/redwood-lazylayout-composeui/src/androidUnitTest/kotlin/app/cash/redwood/layout/composeui/ComposeUiLazyListTest.kt @@ -28,6 +28,7 @@ import app.cash.redwood.Modifier as RedwoodModifier import app.cash.redwood.layout.AbstractFlexContainerTest import app.cash.redwood.layout.TestFlexContainer import app.cash.redwood.layout.api.Constraint +import app.cash.redwood.layout.api.CrossAxisAlignment import app.cash.redwood.lazylayout.composeui.ComposeUiLazyList import app.cash.redwood.ui.Margin import app.cash.redwood.widget.Widget @@ -88,6 +89,14 @@ class ComposeUiLazyListTest( } override fun alignItems(alignItems: AlignItems) { + val crossAxisAlignment = when (alignItems) { + AlignItems.FlexStart -> CrossAxisAlignment.Start + AlignItems.Center -> CrossAxisAlignment.Center + AlignItems.FlexEnd -> CrossAxisAlignment.End + AlignItems.Stretch -> CrossAxisAlignment.Stretch + else -> throw AssertionError() + } + delegate.crossAxisAlignment(crossAxisAlignment) } override fun justifyContent(justifyContent: JustifyContent) { diff --git a/redwood-lazylayout-composeui/src/commonMain/kotlin/app/cash/redwood/lazylayout/composeui/ComposeUiLazyList.kt b/redwood-lazylayout-composeui/src/commonMain/kotlin/app/cash/redwood/lazylayout/composeui/ComposeUiLazyList.kt index 34d8d1e4f4..82ce9733fe 100644 --- a/redwood-lazylayout-composeui/src/commonMain/kotlin/app/cash/redwood/lazylayout/composeui/ComposeUiLazyList.kt +++ b/redwood-lazylayout-composeui/src/commonMain/kotlin/app/cash/redwood/lazylayout/composeui/ComposeUiLazyList.kt @@ -40,6 +40,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import app.cash.redwood.Modifier as RedwoodModifier import app.cash.redwood.layout.api.Constraint +import app.cash.redwood.layout.api.CrossAxisAlignment import app.cash.redwood.lazylayout.widget.LazyList import app.cash.redwood.lazylayout.widget.RefreshableLazyList import app.cash.redwood.ui.Margin @@ -59,6 +60,7 @@ internal class ComposeUiLazyList : private var width by mutableStateOf(Constraint.Wrap) private var height by mutableStateOf(Constraint.Wrap) private var margin by mutableStateOf(Margin.Zero) + private var crossAxisAlignment by mutableStateOf(CrossAxisAlignment.Start) override var modifier: RedwoodModifier = RedwoodModifier @@ -102,9 +104,14 @@ internal class ComposeUiLazyList : this.margin = margin } + override fun crossAxisAlignment(crossAxisAlignment: CrossAxisAlignment) { + this.crossAxisAlignment = crossAxisAlignment + } + override val value = @Composable { val content: LazyListScope.() -> Unit = { items(items.widgets) { item -> + // TODO If CrossAxisAlignment is Stretch, pass Modifier.fillParentMaxWidth() to child widget. item.value.invoke() } } @@ -148,15 +155,30 @@ internal class ComposeUiLazyList : ) .pullRefresh(state = refreshState, enabled = onRefresh != null) if (isVertical) { + val horizontalAlignment = when (crossAxisAlignment) { + CrossAxisAlignment.Start -> Alignment.Start + CrossAxisAlignment.Center -> Alignment.CenterHorizontally + CrossAxisAlignment.End -> Alignment.End + CrossAxisAlignment.Stretch -> Alignment.Start + else -> throw AssertionError() + } LazyColumn( modifier = modifier, state = state, + horizontalAlignment = horizontalAlignment, content = content, ) } else { LazyRow( modifier = modifier, state = state, + verticalAlignment = when (crossAxisAlignment) { + CrossAxisAlignment.Start -> Alignment.Top + CrossAxisAlignment.Center -> Alignment.CenterVertically + CrossAxisAlignment.End -> Alignment.Bottom + CrossAxisAlignment.Stretch -> Alignment.Top + else -> throw AssertionError() + }, content = content, ) } diff --git a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_columnWithUpdatedAlignItems[LTR]_center.png b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_columnWithUpdatedAlignItems[LTR]_center.png index df21e6ed8b..45ce7ea2cf 100644 --- a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_columnWithUpdatedAlignItems[LTR]_center.png +++ b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_columnWithUpdatedAlignItems[LTR]_center.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e84b8bdba6cbb2a84c8bcba44356c87dae452c405643e58367811249dd240fbc -size 54913 +oid sha256:9c5bb82394fe61f499b1fe32ba0117bfb64103ccc34dd40c4ecedb453c040318 +size 56235 diff --git a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_columnWithUpdatedAlignItems[LTR]_flexend.png b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_columnWithUpdatedAlignItems[LTR]_flexend.png index df21e6ed8b..5e9824dfd5 100644 --- a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_columnWithUpdatedAlignItems[LTR]_flexend.png +++ b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_columnWithUpdatedAlignItems[LTR]_flexend.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e84b8bdba6cbb2a84c8bcba44356c87dae452c405643e58367811249dd240fbc -size 54913 +oid sha256:686afb31ab505dbe2bc509c666682fcb8eaac91107112c7d754b092369165d72 +size 55324 diff --git a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_columnWithUpdatedAlignItems[RTL]_center.png b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_columnWithUpdatedAlignItems[RTL]_center.png index 3e611b071d..2cc6a59b93 100644 --- a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_columnWithUpdatedAlignItems[RTL]_center.png +++ b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_columnWithUpdatedAlignItems[RTL]_center.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:612880870579de43e0065500aa3d9d733f56ffbd3eac8c19bef1db9e7bc996c9 -size 55492 +oid sha256:4348134873ddefc8940de7a87cae1758bab953a45a1ae57fb21e9f331e54b156 +size 56525 diff --git a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_columnWithUpdatedAlignItems[RTL]_flexend.png b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_columnWithUpdatedAlignItems[RTL]_flexend.png index 3e611b071d..4b8d9f79fd 100644 --- a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_columnWithUpdatedAlignItems[RTL]_flexend.png +++ b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_columnWithUpdatedAlignItems[RTL]_flexend.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:612880870579de43e0065500aa3d9d733f56ffbd3eac8c19bef1db9e7bc996c9 -size 55492 +oid sha256:0c2a07542154cfc9d36995407a78591c258f68f60883006ed94d64c1b239480c +size 55210 diff --git a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[LTR,Column,Center].png b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[LTR,Column,Center].png index df21e6ed8b..45ce7ea2cf 100644 --- a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[LTR,Column,Center].png +++ b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[LTR,Column,Center].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e84b8bdba6cbb2a84c8bcba44356c87dae452c405643e58367811249dd240fbc -size 54913 +oid sha256:9c5bb82394fe61f499b1fe32ba0117bfb64103ccc34dd40c4ecedb453c040318 +size 56235 diff --git a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[LTR,Column,FlexEnd].png b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[LTR,Column,FlexEnd].png index df21e6ed8b..5e9824dfd5 100644 --- a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[LTR,Column,FlexEnd].png +++ b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[LTR,Column,FlexEnd].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e84b8bdba6cbb2a84c8bcba44356c87dae452c405643e58367811249dd240fbc -size 54913 +oid sha256:686afb31ab505dbe2bc509c666682fcb8eaac91107112c7d754b092369165d72 +size 55324 diff --git a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[LTR,Row,Center].png b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[LTR,Row,Center].png index 224a020671..bf31ab8ea2 100644 --- a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[LTR,Row,Center].png +++ b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[LTR,Row,Center].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3dc7e1e53ff11d4218119880ed50f0d92183776e396793232020f60e146b0a78 -size 10397 +oid sha256:a1652f78a07a1a8d754b1cd11eeb65ba129dd7e83715c7365594f26bac3ea5ec +size 10425 diff --git a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[LTR,Row,FlexEnd].png b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[LTR,Row,FlexEnd].png index 224a020671..ec82ebce0d 100644 --- a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[LTR,Row,FlexEnd].png +++ b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[LTR,Row,FlexEnd].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3dc7e1e53ff11d4218119880ed50f0d92183776e396793232020f60e146b0a78 -size 10397 +oid sha256:44224d9d9396ab6fc42e8734a84228a0b859834f743169b062e7fc0f08f22528 +size 10304 diff --git a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[RTL,Column,Center].png b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[RTL,Column,Center].png index 3e611b071d..2cc6a59b93 100644 --- a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[RTL,Column,Center].png +++ b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[RTL,Column,Center].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:612880870579de43e0065500aa3d9d733f56ffbd3eac8c19bef1db9e7bc996c9 -size 55492 +oid sha256:4348134873ddefc8940de7a87cae1758bab953a45a1ae57fb21e9f331e54b156 +size 56525 diff --git a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[RTL,Column,FlexEnd].png b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[RTL,Column,FlexEnd].png index 3e611b071d..4b8d9f79fd 100644 --- a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[RTL,Column,FlexEnd].png +++ b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[RTL,Column,FlexEnd].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:612880870579de43e0065500aa3d9d733f56ffbd3eac8c19bef1db9e7bc996c9 -size 55492 +oid sha256:0c2a07542154cfc9d36995407a78591c258f68f60883006ed94d64c1b239480c +size 55210 diff --git a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[RTL,Row,Center].png b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[RTL,Row,Center].png index 3402dacf7c..8fc2055cb3 100644 --- a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[RTL,Row,Center].png +++ b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[RTL,Row,Center].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ba735aece92b60770d70252df4c6bbca6ad3554c5a1955ef1b8396b76d51cc2e -size 10540 +oid sha256:914be7196964179a35c8d1272a882f5b24f19c3af2a88ebe401fd49342dce261 +size 10515 diff --git a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[RTL,Row,FlexEnd].png b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[RTL,Row,FlexEnd].png index 3402dacf7c..b3008bf445 100644 --- a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[RTL,Row,FlexEnd].png +++ b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_layoutWithAlignItems[RTL,Row,FlexEnd].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ba735aece92b60770d70252df4c6bbca6ad3554c5a1955ef1b8396b76d51cc2e -size 10540 +oid sha256:ead2c2597a780b430d2fb8c51398152553479fb1f00119b2402a205253a08e6a +size 10374 diff --git a/redwood-lazylayout-schema/src/main/kotlin/app/cash/redwood/lazylayout/widgets.kt b/redwood-lazylayout-schema/src/main/kotlin/app/cash/redwood/lazylayout/widgets.kt index 310823b86f..9c30a65bb1 100644 --- a/redwood-lazylayout-schema/src/main/kotlin/app/cash/redwood/lazylayout/widgets.kt +++ b/redwood-lazylayout-schema/src/main/kotlin/app/cash/redwood/lazylayout/widgets.kt @@ -16,6 +16,7 @@ package app.cash.redwood.lazylayout import app.cash.redwood.layout.api.Constraint +import app.cash.redwood.layout.api.CrossAxisAlignment import app.cash.redwood.schema.Children import app.cash.redwood.schema.Property import app.cash.redwood.schema.Widget @@ -30,6 +31,7 @@ public data class LazyList( @Property(5) val width: Constraint, @Property(6) val height: Constraint, @Property(7) val margin: Margin, + @Property(8) val crossAxisAlignment: CrossAxisAlignment, @Children(1) val placeholder: () -> Unit, @Children(2) val items: () -> Unit, ) @@ -45,6 +47,7 @@ public data class RefreshableLazyList( @Property(7) val width: Constraint, @Property(8) val height: Constraint, @Property(9) val margin: Margin, + @Property(10) val crossAxisAlignment: CrossAxisAlignment, @Children(1) val placeholder: () -> Unit, @Children(2) val items: () -> Unit, ) diff --git a/redwood-lazylayout-uiview/src/commonMain/kotlin/app/cash/redwood/lazylayout/uiview/UIViewLazyList.kt b/redwood-lazylayout-uiview/src/commonMain/kotlin/app/cash/redwood/lazylayout/uiview/UIViewLazyList.kt index 4fd76daa7e..31f98d2288 100644 --- a/redwood-lazylayout-uiview/src/commonMain/kotlin/app/cash/redwood/lazylayout/uiview/UIViewLazyList.kt +++ b/redwood-lazylayout-uiview/src/commonMain/kotlin/app/cash/redwood/lazylayout/uiview/UIViewLazyList.kt @@ -23,6 +23,7 @@ package app.cash.redwood.lazylayout.uiview import app.cash.redwood.Modifier import app.cash.redwood.layout.api.Constraint +import app.cash.redwood.layout.api.CrossAxisAlignment import app.cash.redwood.lazylayout.widget.LazyList import app.cash.redwood.lazylayout.widget.RefreshableLazyList import app.cash.redwood.ui.Margin @@ -237,6 +238,10 @@ internal open class UIViewLazyList() : LazyList, ChangeListener { collectionView.contentInset = UIEdgeInsetsMake(margin.top.value, margin.start.value, margin.end.value, margin.bottom.value) } + override fun crossAxisAlignment(crossAxisAlignment: CrossAxisAlignment) { + // TODO Support CrossAxisAlignment in `redwood-lazylayout-uiview` + } + override var modifier: Modifier = Modifier override val value: UIView get() = collectionView diff --git a/redwood-lazylayout-view/src/main/kotlin/app/cash/redwood/lazylayout/view/ViewLazyList.kt b/redwood-lazylayout-view/src/main/kotlin/app/cash/redwood/lazylayout/view/ViewLazyList.kt index bacf729e01..4249022e8b 100644 --- a/redwood-lazylayout-view/src/main/kotlin/app/cash/redwood/lazylayout/view/ViewLazyList.kt +++ b/redwood-lazylayout-view/src/main/kotlin/app/cash/redwood/lazylayout/view/ViewLazyList.kt @@ -19,6 +19,7 @@ package app.cash.redwood.lazylayout.view import android.annotation.SuppressLint import android.content.Context +import android.view.Gravity import android.view.View import android.view.ViewGroup import android.view.ViewGroup.LayoutParams.MATCH_PARENT @@ -32,6 +33,7 @@ import androidx.recyclerview.widget.RecyclerView import androidx.swiperefreshlayout.widget.SwipeRefreshLayout import app.cash.redwood.Modifier import app.cash.redwood.layout.api.Constraint +import app.cash.redwood.layout.api.CrossAxisAlignment import app.cash.redwood.lazylayout.widget.LazyList import app.cash.redwood.lazylayout.widget.RefreshableLazyList import app.cash.redwood.ui.Density @@ -104,9 +106,8 @@ internal open class ViewLazyList(context: Context) : LazyList { private val density = Density(context.resources) private val linearLayoutManager = object : LinearLayoutManager(recyclerView.context) { - // Identical to the implementation of [LinearLayout.generateDefaultLayoutParams]. override fun generateDefaultLayoutParams(): RecyclerView.LayoutParams? = when (orientation) { - RecyclerView.HORIZONTAL -> RecyclerView.LayoutParams(WRAP_CONTENT, WRAP_CONTENT) + RecyclerView.HORIZONTAL -> RecyclerView.LayoutParams(WRAP_CONTENT, MATCH_PARENT) RecyclerView.VERTICAL -> RecyclerView.LayoutParams(MATCH_PARENT, WRAP_CONTENT) else -> null } @@ -165,6 +166,11 @@ internal open class ViewLazyList(context: Context) : LazyList { } } + override fun crossAxisAlignment(crossAxisAlignment: CrossAxisAlignment) { + adapter.crossAxisAlignment = crossAxisAlignment + adapter.notifyItemRangeChanged(0, adapter.itemCount) + } + override fun isVertical(isVertical: Boolean) { linearLayoutManager.orientation = if (isVertical) RecyclerView.VERTICAL else RecyclerView.HORIZONTAL } @@ -208,6 +214,7 @@ internal open class ViewLazyList(context: Context) : LazyList { private class LazyContentItemListAdapter( val placeholders: Placeholders, ) : RecyclerView.Adapter() { + var crossAxisAlignment = CrossAxisAlignment.Start lateinit var items: Items /** @@ -233,7 +240,7 @@ internal open class ViewLazyList(context: Context) : LazyList { } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { - val container = Container(parent.context) + val container = FrameLayout(parent.context) // [onBindViewHolder] is invoked before the default layout params are set, so // [View.getLayoutParams] will be null unless explicitly set. container.layoutParams = (parent as RecyclerView).layoutManager!!.generateDefaultLayoutParams() @@ -246,11 +253,26 @@ internal open class ViewLazyList(context: Context) : LazyList { override fun onBindViewHolder(holder: ViewHolder, position: Int) { lastItemHeight = holder.itemView.height + val layoutParams = if (crossAxisAlignment == CrossAxisAlignment.Stretch) { + FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT) + } else { + FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT) + } + layoutParams.apply { + gravity = when (crossAxisAlignment) { + CrossAxisAlignment.Start -> Gravity.START + CrossAxisAlignment.Center -> Gravity.CENTER + CrossAxisAlignment.End -> Gravity.END + CrossAxisAlignment.Stretch -> Gravity.START + else -> throw AssertionError() + } + } when (holder) { is ViewHolder.Placeholder -> { if (holder.container.childCount == 0) { val placeholder = placeholders.takeOrNull() if (placeholder != null) { + placeholder.value.layoutParams = layoutParams holder.container.addView(placeholder.value) holder.itemView.updateLayoutParams { height = WRAP_CONTENT } } else if (holder.container.height == 0) { @@ -258,6 +280,8 @@ internal open class ViewLazyList(context: Context) : LazyList { // to a non-zero height so that it's visible. holder.itemView.updateLayoutParams { height = lastItemHeight } } + } else { + holder.container.getChildAt(0).layoutParams = layoutParams } } is ViewHolder.Item -> { @@ -265,22 +289,16 @@ internal open class ViewLazyList(context: Context) : LazyList { val view = items.widgets[index].value holder.container.removeAllViews() (view.parent as? FrameLayout)?.removeAllViews() + view.layoutParams = layoutParams holder.container.addView(view) } } } } - class Container(context: Context) : FrameLayout(context) { - // Identical to the implementation of [YogaLayout.generateDefaultLayoutParams]. - override fun generateDefaultLayoutParams(): LayoutParams { - return LayoutParams(WRAP_CONTENT, WRAP_CONTENT) - } - } - sealed class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { - class Placeholder(val container: Container) : ViewHolder(container) - class Item(val container: Container) : ViewHolder(container) + class Placeholder(val container: FrameLayout) : ViewHolder(container) + class Item(val container: FrameLayout) : ViewHolder(container) } } diff --git a/redwood-lazylayout-view/src/test/kotlin/app/cash/redwood/lazylayout/view/ViewLazyListTest.kt b/redwood-lazylayout-view/src/test/kotlin/app/cash/redwood/lazylayout/view/ViewLazyListTest.kt index 6a7b319a4a..67b17ae179 100644 --- a/redwood-lazylayout-view/src/test/kotlin/app/cash/redwood/lazylayout/view/ViewLazyListTest.kt +++ b/redwood-lazylayout-view/src/test/kotlin/app/cash/redwood/lazylayout/view/ViewLazyListTest.kt @@ -26,6 +26,7 @@ import app.cash.redwood.Modifier import app.cash.redwood.layout.AbstractFlexContainerTest import app.cash.redwood.layout.TestFlexContainer import app.cash.redwood.layout.api.Constraint +import app.cash.redwood.layout.api.CrossAxisAlignment import app.cash.redwood.ui.Margin import app.cash.redwood.widget.Widget import app.cash.redwood.yoga.AlignItems @@ -82,6 +83,14 @@ class ViewLazyListTest( } override fun alignItems(alignItems: AlignItems) { + val crossAxisAlignment = when (alignItems) { + AlignItems.FlexStart -> CrossAxisAlignment.Start + AlignItems.Center -> CrossAxisAlignment.Center + AlignItems.FlexEnd -> CrossAxisAlignment.End + AlignItems.Stretch -> CrossAxisAlignment.Stretch + else -> throw AssertionError() + } + delegate.crossAxisAlignment(crossAxisAlignment) } override fun justifyContent(justifyContent: JustifyContent) { diff --git a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_columnWithUpdatedAlignItems[LTR]_center.png b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_columnWithUpdatedAlignItems[LTR]_center.png index df21e6ed8b..41cd5bd675 100644 --- a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_columnWithUpdatedAlignItems[LTR]_center.png +++ b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_columnWithUpdatedAlignItems[LTR]_center.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e84b8bdba6cbb2a84c8bcba44356c87dae452c405643e58367811249dd240fbc -size 54913 +oid sha256:2aa5ff9c3492803d708d5e3251a080d56ea2891a5f00050640cfde5c318cac8f +size 56168 diff --git a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_columnWithUpdatedAlignItems[LTR]_flexend.png b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_columnWithUpdatedAlignItems[LTR]_flexend.png index df21e6ed8b..5e9824dfd5 100644 --- a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_columnWithUpdatedAlignItems[LTR]_flexend.png +++ b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_columnWithUpdatedAlignItems[LTR]_flexend.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e84b8bdba6cbb2a84c8bcba44356c87dae452c405643e58367811249dd240fbc -size 54913 +oid sha256:686afb31ab505dbe2bc509c666682fcb8eaac91107112c7d754b092369165d72 +size 55324 diff --git a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_columnWithUpdatedAlignItems[RTL]_center.png b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_columnWithUpdatedAlignItems[RTL]_center.png index 5e9824dfd5..41cd5bd675 100644 --- a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_columnWithUpdatedAlignItems[RTL]_center.png +++ b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_columnWithUpdatedAlignItems[RTL]_center.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:686afb31ab505dbe2bc509c666682fcb8eaac91107112c7d754b092369165d72 -size 55324 +oid sha256:2aa5ff9c3492803d708d5e3251a080d56ea2891a5f00050640cfde5c318cac8f +size 56168 diff --git a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_columnWithUpdatedAlignItems[RTL]_flexend.png b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_columnWithUpdatedAlignItems[RTL]_flexend.png index 5e9824dfd5..df21e6ed8b 100644 --- a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_columnWithUpdatedAlignItems[RTL]_flexend.png +++ b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_columnWithUpdatedAlignItems[RTL]_flexend.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:686afb31ab505dbe2bc509c666682fcb8eaac91107112c7d754b092369165d72 -size 55324 +oid sha256:e84b8bdba6cbb2a84c8bcba44356c87dae452c405643e58367811249dd240fbc +size 54913 diff --git a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Column,Center].png b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Column,Center].png index df21e6ed8b..41cd5bd675 100644 --- a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Column,Center].png +++ b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Column,Center].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e84b8bdba6cbb2a84c8bcba44356c87dae452c405643e58367811249dd240fbc -size 54913 +oid sha256:2aa5ff9c3492803d708d5e3251a080d56ea2891a5f00050640cfde5c318cac8f +size 56168 diff --git a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Column,FlexEnd].png b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Column,FlexEnd].png index df21e6ed8b..5e9824dfd5 100644 --- a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Column,FlexEnd].png +++ b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Column,FlexEnd].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e84b8bdba6cbb2a84c8bcba44356c87dae452c405643e58367811249dd240fbc -size 54913 +oid sha256:686afb31ab505dbe2bc509c666682fcb8eaac91107112c7d754b092369165d72 +size 55324 diff --git a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Column,Stretch].png b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Column,Stretch].png index df21e6ed8b..f031bc7797 100644 --- a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Column,Stretch].png +++ b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Column,Stretch].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e84b8bdba6cbb2a84c8bcba44356c87dae452c405643e58367811249dd240fbc -size 54913 +oid sha256:2f80cce4e0ddaba73364be1f77dbac26573785c44c83fda2bd2c3256b42528ee +size 53996 diff --git a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Row,Center].png b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Row,Center].png index 224a020671..d11764eeb9 100644 --- a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Row,Center].png +++ b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Row,Center].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3dc7e1e53ff11d4218119880ed50f0d92183776e396793232020f60e146b0a78 -size 10397 +oid sha256:8ce74cae941c57532b1117f0e3d68e050ac80def3285181a20adb17242cb8aab +size 10317 diff --git a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Row,Stretch].png b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Row,Stretch].png index 224a020671..9ddd06efac 100644 --- a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Row,Stretch].png +++ b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[LTR,Row,Stretch].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3dc7e1e53ff11d4218119880ed50f0d92183776e396793232020f60e146b0a78 +oid sha256:e109543f2813ef56631ca5a34aece6f2bc952936cd9ff17502e87ab3911efcc6 size 10397 diff --git a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Column,Center].png b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Column,Center].png index 5e9824dfd5..41cd5bd675 100644 --- a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Column,Center].png +++ b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Column,Center].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:686afb31ab505dbe2bc509c666682fcb8eaac91107112c7d754b092369165d72 -size 55324 +oid sha256:2aa5ff9c3492803d708d5e3251a080d56ea2891a5f00050640cfde5c318cac8f +size 56168 diff --git a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Column,FlexEnd].png b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Column,FlexEnd].png index 5e9824dfd5..df21e6ed8b 100644 --- a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Column,FlexEnd].png +++ b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Column,FlexEnd].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:686afb31ab505dbe2bc509c666682fcb8eaac91107112c7d754b092369165d72 -size 55324 +oid sha256:e84b8bdba6cbb2a84c8bcba44356c87dae452c405643e58367811249dd240fbc +size 54913 diff --git a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Column,Stretch].png b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Column,Stretch].png index 5e9824dfd5..f031bc7797 100644 --- a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Column,Stretch].png +++ b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Column,Stretch].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:686afb31ab505dbe2bc509c666682fcb8eaac91107112c7d754b092369165d72 -size 55324 +oid sha256:2f80cce4e0ddaba73364be1f77dbac26573785c44c83fda2bd2c3256b42528ee +size 53996 diff --git a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Row,Center].png b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Row,Center].png index 020938c85e..91f7e574f4 100644 --- a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Row,Center].png +++ b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Row,Center].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6c2d05e6dff253bd4deb0883df3d9a85a25277909d3e7b45c911033e7f454caa -size 10474 +oid sha256:25c172008cb973a12aeafaf5c2d14498160747e3d0a752bc677671f2574e840c +size 10322 diff --git a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Row,Stretch].png b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Row,Stretch].png index 020938c85e..584c5418b3 100644 --- a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Row,Stretch].png +++ b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListTest_layoutWithAlignItems[RTL,Row,Stretch].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6c2d05e6dff253bd4deb0883df3d9a85a25277909d3e7b45c911033e7f454caa +oid sha256:5a2f5e3ad4be9c8d42a774a4a5152d4600f8abdce5d8f136231c99e0e768e61e size 10474