Add layout direction to Layout node.
The layout direction will be passed from parent to children during the measure. Layout direction is exposed to measure block and intrinsic measure block (instead of the Constraint object as in aosp/1236391). Layout modifier methods also get LD as a parameter.
Added LayoutDirectiionModifier (named this way at the moment to not clash with the LayoutDirection enum).
Bug: 147608318
Test: tests passed, added tests for modifier
Relnote: "Made the layout direction be propagated from parent layout node to children. Added layout direction modifier."
Change-Id: I3d9559ddec464850d22466793975b41757e0224e
diff --git a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/IntrinsicTest.kt b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/IntrinsicTest.kt
index 7373dd4..1adbc3a 100644
--- a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/IntrinsicTest.kt
+++ b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/IntrinsicTest.kt
@@ -501,11 +501,11 @@
) {
Layout(
children,
- minIntrinsicWidthMeasureBlock = { _, _ -> minIntrinsicWidth.toIntPx() },
- minIntrinsicHeightMeasureBlock = { _, _ -> minIntrinsicHeight.toIntPx() },
- maxIntrinsicWidthMeasureBlock = { _, _ -> maxIntrinsicWidth.toIntPx() },
- maxIntrinsicHeightMeasureBlock = { _, _ -> maxIntrinsicHeight.toIntPx() }
- ) { _, constraints ->
+ minIntrinsicWidthMeasureBlock = { _, _, _ -> minIntrinsicWidth.toIntPx() },
+ minIntrinsicHeightMeasureBlock = { _, _, _ -> minIntrinsicHeight.toIntPx() },
+ maxIntrinsicWidthMeasureBlock = { _, _, _ -> maxIntrinsicWidth.toIntPx() },
+ maxIntrinsicHeightMeasureBlock = { _, _, _ -> maxIntrinsicHeight.toIntPx() }
+ ) { _, constraints, _ ->
layout(
width.toIntPx().coerceIn(constraints.minWidth, constraints.maxWidth),
height.toIntPx().coerceIn(constraints.minHeight, constraints.maxHeight)