diff --git a/redwood-layout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiFlexContainerTest_testCrossAxisAlignmentStart[LTR].png b/redwood-layout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiFlexContainerTest_testCrossAxisAlignmentStart[LTR].png new file mode 100644 index 0000000000..e9ea95482c --- /dev/null +++ b/redwood-layout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiFlexContainerTest_testCrossAxisAlignmentStart[LTR].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6434735494e93857c1c65ea9fcd6403c5f131038fa56e2e338dcf2becac067cb +size 7732 diff --git a/redwood-layout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiFlexContainerTest_testCrossAxisAlignmentStart[RTL].png b/redwood-layout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiFlexContainerTest_testCrossAxisAlignmentStart[RTL].png new file mode 100644 index 0000000000..efaffede47 --- /dev/null +++ b/redwood-layout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiFlexContainerTest_testCrossAxisAlignmentStart[RTL].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67777c4c70f3f283b258376ba99d865368ce8e13d41503616149ad7794cfa988 +size 7722 diff --git a/redwood-layout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiFlexContainerTest_testTextWrapsInsideRow[LTR].png b/redwood-layout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiFlexContainerTest_testTextWrapsInsideRow[LTR].png new file mode 100644 index 0000000000..118634df8f --- /dev/null +++ b/redwood-layout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiFlexContainerTest_testTextWrapsInsideRow[LTR].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ef643b0098d727e443d9fcc94c0017c1ff2e57ae734e62b4a65843eff9c8e15 +size 10205 diff --git a/redwood-layout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiFlexContainerTest_testTextWrapsInsideRow[RTL].png b/redwood-layout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiFlexContainerTest_testTextWrapsInsideRow[RTL].png new file mode 100644 index 0000000000..b33f47cbd1 --- /dev/null +++ b/redwood-layout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiFlexContainerTest_testTextWrapsInsideRow[RTL].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ddb08dba991a3e9e2eb27b56f953dcc935a826e60ee6973a410b9dd21fbb746 +size 10240 diff --git a/redwood-layout-shared-test/src/commonMain/kotlin/app/cash/redwood/layout/AbstractFlexContainerTest.kt b/redwood-layout-shared-test/src/commonMain/kotlin/app/cash/redwood/layout/AbstractFlexContainerTest.kt index 02b7a15d31..3e576b5ebb 100644 --- a/redwood-layout-shared-test/src/commonMain/kotlin/app/cash/redwood/layout/AbstractFlexContainerTest.kt +++ b/redwood-layout-shared-test/src/commonMain/kotlin/app/cash/redwood/layout/AbstractFlexContainerTest.kt @@ -871,6 +871,44 @@ abstract class AbstractFlexContainerTest { snapshotter(root.value).snapshot() } + + /** + * CrossAxisAlignment.Start forces child to wrap its size on Android + * https://github.com/cashapp/redwood/issues/2093 + */ + @Test fun testCrossAxisAlignmentStart() { + val root = flexContainer(FlexDirection.Column).apply { + width(Constraint.Fill) + crossAxisAlignment(CrossAxisAlignment.Start) + } + + val row = row().apply { + width(Constraint.Fill) + horizontalAlignment(MainAxisAlignment.SpaceBetween) + root.add(this) + } + + row.children.insert(0, widgetFactory.text("Something")) + row.children.insert(1, widgetFactory.text("Something else")) + + snapshotter(root.value).snapshot() + } + + /** + * Text not wrapping inside a row. + * https://github.com/cashapp/redwood/issues/2011 + */ + @Test fun testTextWrapsInsideRow() { + val root = flexContainer(FlexDirection.Row) + + root.add( + widgetFactory.text( + "This is a long piece of text that will wrap the screen. ".repeat(3), + ), + ) + + snapshotter(root.value).snapshot() + } } interface TestFlexContainer : diff --git a/redwood-layout-uiview/RedwoodLayoutUIViewTests/__Snapshots__/UIViewFlexContainerTestHost/testCrossAxisAlignmentStart.1.png b/redwood-layout-uiview/RedwoodLayoutUIViewTests/__Snapshots__/UIViewFlexContainerTestHost/testCrossAxisAlignmentStart.1.png new file mode 100644 index 0000000000..e5efe40300 --- /dev/null +++ b/redwood-layout-uiview/RedwoodLayoutUIViewTests/__Snapshots__/UIViewFlexContainerTestHost/testCrossAxisAlignmentStart.1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3041a08ac048d99128dcc92579f0c7530f7605c3271298c24b487bc44039a3b6 +size 72499 diff --git a/redwood-layout-uiview/RedwoodLayoutUIViewTests/__Snapshots__/UIViewFlexContainerTestHost/testTextWrapsInsideRow.1.png b/redwood-layout-uiview/RedwoodLayoutUIViewTests/__Snapshots__/UIViewFlexContainerTestHost/testTextWrapsInsideRow.1.png new file mode 100644 index 0000000000..fec708ffd8 --- /dev/null +++ b/redwood-layout-uiview/RedwoodLayoutUIViewTests/__Snapshots__/UIViewFlexContainerTestHost/testTextWrapsInsideRow.1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c2d97267d067eba9f5db84042873d2eb7a2a82a5c594f38b224831f05f29172 +size 100546 diff --git a/redwood-layout-view/src/test/snapshots/images/app.cash.redwood.layout.view_ViewFlexContainerTest_testCrossAxisAlignmentStart[LTR].png b/redwood-layout-view/src/test/snapshots/images/app.cash.redwood.layout.view_ViewFlexContainerTest_testCrossAxisAlignmentStart[LTR].png new file mode 100644 index 0000000000..d727d1791f --- /dev/null +++ b/redwood-layout-view/src/test/snapshots/images/app.cash.redwood.layout.view_ViewFlexContainerTest_testCrossAxisAlignmentStart[LTR].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7ce7fc457a66f6236e6c4a4714e2bd7d75a8cb861a39159d7addebc396089b0 +size 7751 diff --git a/redwood-layout-view/src/test/snapshots/images/app.cash.redwood.layout.view_ViewFlexContainerTest_testCrossAxisAlignmentStart[RTL].png b/redwood-layout-view/src/test/snapshots/images/app.cash.redwood.layout.view_ViewFlexContainerTest_testCrossAxisAlignmentStart[RTL].png new file mode 100644 index 0000000000..ef9c739f12 --- /dev/null +++ b/redwood-layout-view/src/test/snapshots/images/app.cash.redwood.layout.view_ViewFlexContainerTest_testCrossAxisAlignmentStart[RTL].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ae576cfc43e32e50587fb5c16084b725fb3ff6537fe7af240a82be9c7bf5026 +size 7774 diff --git a/redwood-layout-view/src/test/snapshots/images/app.cash.redwood.layout.view_ViewFlexContainerTest_testTextWrapsInsideRow[LTR].png b/redwood-layout-view/src/test/snapshots/images/app.cash.redwood.layout.view_ViewFlexContainerTest_testTextWrapsInsideRow[LTR].png new file mode 100644 index 0000000000..7e4274e81a --- /dev/null +++ b/redwood-layout-view/src/test/snapshots/images/app.cash.redwood.layout.view_ViewFlexContainerTest_testTextWrapsInsideRow[LTR].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17fb941c33f7f095b36ece205827b3b1f420dd8bbef4ad77658f83cf2e99d3e4 +size 21544 diff --git a/redwood-layout-view/src/test/snapshots/images/app.cash.redwood.layout.view_ViewFlexContainerTest_testTextWrapsInsideRow[RTL].png b/redwood-layout-view/src/test/snapshots/images/app.cash.redwood.layout.view_ViewFlexContainerTest_testTextWrapsInsideRow[RTL].png new file mode 100644 index 0000000000..66ba507982 --- /dev/null +++ b/redwood-layout-view/src/test/snapshots/images/app.cash.redwood.layout.view_ViewFlexContainerTest_testTextWrapsInsideRow[RTL].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c074ccb086bb0b49930f66dbfe985530707eb0ef125140a490d5bf5fc97610e +size 21683 diff --git a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_testCrossAxisAlignmentStart[LTR].png b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_testCrossAxisAlignmentStart[LTR].png new file mode 100644 index 0000000000..b062c86c7f --- /dev/null +++ b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_testCrossAxisAlignmentStart[LTR].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69eb04065379b5fc650e6cad6b9fc6969aaae8768f6f461de08815ca741393cb +size 7728 diff --git a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_testCrossAxisAlignmentStart[RTL].png b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_testCrossAxisAlignmentStart[RTL].png new file mode 100644 index 0000000000..a3f3cf69b5 --- /dev/null +++ b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_testCrossAxisAlignmentStart[RTL].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80e4b588173b1b3eefdd83b12e69399c1b43862e8691332e7246e42f55227e01 +size 7722 diff --git a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_testTextWrapsInsideRow[LTR].png b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_testTextWrapsInsideRow[LTR].png new file mode 100644 index 0000000000..118634df8f --- /dev/null +++ b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_testTextWrapsInsideRow[LTR].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ef643b0098d727e443d9fcc94c0017c1ff2e57ae734e62b4a65843eff9c8e15 +size 10205 diff --git a/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_testTextWrapsInsideRow[RTL].png b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_testTextWrapsInsideRow[RTL].png new file mode 100644 index 0000000000..b33f47cbd1 --- /dev/null +++ b/redwood-lazylayout-composeui/src/test/snapshots/images/app.cash.redwood.layout.composeui_ComposeUiLazyListTest_testTextWrapsInsideRow[RTL].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ddb08dba991a3e9e2eb27b56f953dcc935a826e60ee6973a410b9dd21fbb746 +size 10240 diff --git a/redwood-lazylayout-uiview/RedwoodLazylayoutUIViewTests/__Snapshots__/UIViewLazyListAsFlexContainerTestHost/testCrossAxisAlignmentStart.1.png b/redwood-lazylayout-uiview/RedwoodLazylayoutUIViewTests/__Snapshots__/UIViewLazyListAsFlexContainerTestHost/testCrossAxisAlignmentStart.1.png new file mode 100644 index 0000000000..825c896dc4 --- /dev/null +++ b/redwood-lazylayout-uiview/RedwoodLazylayoutUIViewTests/__Snapshots__/UIViewLazyListAsFlexContainerTestHost/testCrossAxisAlignmentStart.1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e63d8061520f28e90252d1d2473c594773c707b2156541981933840f5036207 +size 65306 diff --git a/redwood-lazylayout-uiview/RedwoodLazylayoutUIViewTests/__Snapshots__/UIViewLazyListAsFlexContainerTestHost/testTextWrapsInsideRow.1.png b/redwood-lazylayout-uiview/RedwoodLazylayoutUIViewTests/__Snapshots__/UIViewLazyListAsFlexContainerTestHost/testTextWrapsInsideRow.1.png new file mode 100644 index 0000000000..825c896dc4 --- /dev/null +++ b/redwood-lazylayout-uiview/RedwoodLazylayoutUIViewTests/__Snapshots__/UIViewLazyListAsFlexContainerTestHost/testTextWrapsInsideRow.1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e63d8061520f28e90252d1d2473c594773c707b2156541981933840f5036207 +size 65306 diff --git a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListAsFlexContainerTest_testCrossAxisAlignmentStart[LTR].png b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListAsFlexContainerTest_testCrossAxisAlignmentStart[LTR].png new file mode 100644 index 0000000000..784d7fc152 --- /dev/null +++ b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListAsFlexContainerTest_testCrossAxisAlignmentStart[LTR].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57e6bb80bdab38226d042e9f722c4b0951a83ca348ef237b1b5e7e64d5770def +size 3836 diff --git a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListAsFlexContainerTest_testCrossAxisAlignmentStart[RTL].png b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListAsFlexContainerTest_testCrossAxisAlignmentStart[RTL].png new file mode 100644 index 0000000000..784d7fc152 --- /dev/null +++ b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListAsFlexContainerTest_testCrossAxisAlignmentStart[RTL].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57e6bb80bdab38226d042e9f722c4b0951a83ca348ef237b1b5e7e64d5770def +size 3836 diff --git a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListAsFlexContainerTest_testTextWrapsInsideRow[LTR].png b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListAsFlexContainerTest_testTextWrapsInsideRow[LTR].png new file mode 100644 index 0000000000..784d7fc152 --- /dev/null +++ b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListAsFlexContainerTest_testTextWrapsInsideRow[LTR].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57e6bb80bdab38226d042e9f722c4b0951a83ca348ef237b1b5e7e64d5770def +size 3836 diff --git a/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListAsFlexContainerTest_testTextWrapsInsideRow[RTL].png b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListAsFlexContainerTest_testTextWrapsInsideRow[RTL].png new file mode 100644 index 0000000000..784d7fc152 --- /dev/null +++ b/redwood-lazylayout-view/src/test/snapshots/images/app.cash.redwood.lazylayout.view_ViewLazyListAsFlexContainerTest_testTextWrapsInsideRow[RTL].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57e6bb80bdab38226d042e9f722c4b0951a83ca348ef237b1b5e7e64d5770def +size 3836