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/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/SpacingBenchmark.kt b/ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/SpacingBenchmark.kt
index aa5a933..e4dfc0b 100644
--- a/ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/SpacingBenchmark.kt
+++ b/ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/SpacingBenchmark.kt
@@ -215,7 +215,7 @@
children: @Composable() () -> Unit
) {
val padding = EdgeInsets(all)
- Layout(children) { measurables, constraints ->
+ Layout(children) { measurables, constraints, _ ->
val measurable = measurables.firstOrNull()
if (measurable == null) {
layout(constraints.minWidth, constraints.minHeight) { }
diff --git a/ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/core/WithConstraintsBenchmark.kt b/ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/core/WithConstraintsBenchmark.kt
index 4433072..6aab3fd 100644
--- a/ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/core/WithConstraintsBenchmark.kt
+++ b/ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/core/WithConstraintsBenchmark.kt
@@ -122,7 +122,7 @@
@Composable
private fun ChangingConstraintsLayout(size: State<IntPx>, children: @Composable() () -> Unit) {
- Layout(children) { measurables, _ ->
+ Layout(children) { measurables, _, _ ->
val constraints = Constraints.fixed(size.value, size.value)
measurables.first().measure(constraints).place(0.ipx, 0.ipx)
layout(100.ipx, 100.ipx) {}
diff --git a/ui/ui-core/api/0.1.0-dev06.txt b/ui/ui-core/api/0.1.0-dev06.txt
index d125972..61e2694 100644
--- a/ui/ui-core/api/0.1.0-dev06.txt
+++ b/ui/ui-core/api/0.1.0-dev06.txt
@@ -172,30 +172,24 @@
}
public interface LayoutModifier extends androidx.ui.core.Modifier.Element {
- method public default androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public default androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public default androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public default androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public default androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public default androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
- method public default androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public default androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public default androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public default androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
}
public interface Measurable extends androidx.ui.core.IntrinsicMeasurable {
method public androidx.ui.core.Placeable measure(androidx.ui.core.Constraints constraints);
}
- public abstract class MeasureScope implements androidx.ui.core.ModifierScope {
+ public abstract class MeasureScope implements androidx.ui.unit.Density {
ctor public MeasureScope();
- method public androidx.ui.core.LayoutDirection getAmbientLayoutDirection();
- method public androidx.ui.core.LayoutDirection getLayoutDirection();
method public final androidx.ui.core.MeasureScope.LayoutResult layout(androidx.ui.unit.IntPx width, androidx.ui.unit.IntPx height, java.util.Map<androidx.ui.core.AlignmentLine,androidx.ui.unit.IntPx> alignmentLines = emptyMap(), kotlin.jvm.functions.Function1<? super androidx.ui.core.Placeable.PlacementScope,kotlin.Unit> placementBlock);
- method public void setAmbientLayoutDirection(androidx.ui.core.LayoutDirection p);
- method public void setLayoutDirection(androidx.ui.core.LayoutDirection p);
- property public androidx.ui.core.LayoutDirection ambientLayoutDirection;
- property public androidx.ui.core.LayoutDirection layoutDirection;
}
public static interface MeasureScope.LayoutResult {
@@ -229,13 +223,6 @@
field public static final androidx.ui.core.Modifier.None! INSTANCE;
}
- public interface ModifierScope extends androidx.ui.unit.Density {
- method public androidx.ui.core.LayoutDirection getAmbientLayoutDirection();
- method public androidx.ui.core.LayoutDirection getLayoutDirection();
- property public abstract androidx.ui.core.LayoutDirection ambientLayoutDirection;
- property public abstract androidx.ui.core.LayoutDirection layoutDirection;
- }
-
public interface ParentDataModifier extends androidx.ui.core.Modifier.Element {
method public default Object? modifyParentData(androidx.ui.unit.Density, Object? parentData);
}
diff --git a/ui/ui-core/api/current.txt b/ui/ui-core/api/current.txt
index d125972..61e2694 100644
--- a/ui/ui-core/api/current.txt
+++ b/ui/ui-core/api/current.txt
@@ -172,30 +172,24 @@
}
public interface LayoutModifier extends androidx.ui.core.Modifier.Element {
- method public default androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public default androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public default androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public default androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public default androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public default androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
- method public default androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public default androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public default androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public default androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
}
public interface Measurable extends androidx.ui.core.IntrinsicMeasurable {
method public androidx.ui.core.Placeable measure(androidx.ui.core.Constraints constraints);
}
- public abstract class MeasureScope implements androidx.ui.core.ModifierScope {
+ public abstract class MeasureScope implements androidx.ui.unit.Density {
ctor public MeasureScope();
- method public androidx.ui.core.LayoutDirection getAmbientLayoutDirection();
- method public androidx.ui.core.LayoutDirection getLayoutDirection();
method public final androidx.ui.core.MeasureScope.LayoutResult layout(androidx.ui.unit.IntPx width, androidx.ui.unit.IntPx height, java.util.Map<androidx.ui.core.AlignmentLine,androidx.ui.unit.IntPx> alignmentLines = emptyMap(), kotlin.jvm.functions.Function1<? super androidx.ui.core.Placeable.PlacementScope,kotlin.Unit> placementBlock);
- method public void setAmbientLayoutDirection(androidx.ui.core.LayoutDirection p);
- method public void setLayoutDirection(androidx.ui.core.LayoutDirection p);
- property public androidx.ui.core.LayoutDirection ambientLayoutDirection;
- property public androidx.ui.core.LayoutDirection layoutDirection;
}
public static interface MeasureScope.LayoutResult {
@@ -229,13 +223,6 @@
field public static final androidx.ui.core.Modifier.None! INSTANCE;
}
- public interface ModifierScope extends androidx.ui.unit.Density {
- method public androidx.ui.core.LayoutDirection getAmbientLayoutDirection();
- method public androidx.ui.core.LayoutDirection getLayoutDirection();
- property public abstract androidx.ui.core.LayoutDirection ambientLayoutDirection;
- property public abstract androidx.ui.core.LayoutDirection layoutDirection;
- }
-
public interface ParentDataModifier extends androidx.ui.core.Modifier.Element {
method public default Object? modifyParentData(androidx.ui.unit.Density, Object? parentData);
}
diff --git a/ui/ui-core/api/public_plus_experimental_0.1.0-dev06.txt b/ui/ui-core/api/public_plus_experimental_0.1.0-dev06.txt
index d125972..61e2694 100644
--- a/ui/ui-core/api/public_plus_experimental_0.1.0-dev06.txt
+++ b/ui/ui-core/api/public_plus_experimental_0.1.0-dev06.txt
@@ -172,30 +172,24 @@
}
public interface LayoutModifier extends androidx.ui.core.Modifier.Element {
- method public default androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public default androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public default androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public default androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public default androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public default androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
- method public default androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public default androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public default androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public default androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
}
public interface Measurable extends androidx.ui.core.IntrinsicMeasurable {
method public androidx.ui.core.Placeable measure(androidx.ui.core.Constraints constraints);
}
- public abstract class MeasureScope implements androidx.ui.core.ModifierScope {
+ public abstract class MeasureScope implements androidx.ui.unit.Density {
ctor public MeasureScope();
- method public androidx.ui.core.LayoutDirection getAmbientLayoutDirection();
- method public androidx.ui.core.LayoutDirection getLayoutDirection();
method public final androidx.ui.core.MeasureScope.LayoutResult layout(androidx.ui.unit.IntPx width, androidx.ui.unit.IntPx height, java.util.Map<androidx.ui.core.AlignmentLine,androidx.ui.unit.IntPx> alignmentLines = emptyMap(), kotlin.jvm.functions.Function1<? super androidx.ui.core.Placeable.PlacementScope,kotlin.Unit> placementBlock);
- method public void setAmbientLayoutDirection(androidx.ui.core.LayoutDirection p);
- method public void setLayoutDirection(androidx.ui.core.LayoutDirection p);
- property public androidx.ui.core.LayoutDirection ambientLayoutDirection;
- property public androidx.ui.core.LayoutDirection layoutDirection;
}
public static interface MeasureScope.LayoutResult {
@@ -229,13 +223,6 @@
field public static final androidx.ui.core.Modifier.None! INSTANCE;
}
- public interface ModifierScope extends androidx.ui.unit.Density {
- method public androidx.ui.core.LayoutDirection getAmbientLayoutDirection();
- method public androidx.ui.core.LayoutDirection getLayoutDirection();
- property public abstract androidx.ui.core.LayoutDirection ambientLayoutDirection;
- property public abstract androidx.ui.core.LayoutDirection layoutDirection;
- }
-
public interface ParentDataModifier extends androidx.ui.core.Modifier.Element {
method public default Object? modifyParentData(androidx.ui.unit.Density, Object? parentData);
}
diff --git a/ui/ui-core/api/public_plus_experimental_current.txt b/ui/ui-core/api/public_plus_experimental_current.txt
index d125972..61e2694 100644
--- a/ui/ui-core/api/public_plus_experimental_current.txt
+++ b/ui/ui-core/api/public_plus_experimental_current.txt
@@ -172,30 +172,24 @@
}
public interface LayoutModifier extends androidx.ui.core.Modifier.Element {
- method public default androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public default androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public default androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public default androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public default androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public default androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
- method public default androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public default androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public default androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public default androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
}
public interface Measurable extends androidx.ui.core.IntrinsicMeasurable {
method public androidx.ui.core.Placeable measure(androidx.ui.core.Constraints constraints);
}
- public abstract class MeasureScope implements androidx.ui.core.ModifierScope {
+ public abstract class MeasureScope implements androidx.ui.unit.Density {
ctor public MeasureScope();
- method public androidx.ui.core.LayoutDirection getAmbientLayoutDirection();
- method public androidx.ui.core.LayoutDirection getLayoutDirection();
method public final androidx.ui.core.MeasureScope.LayoutResult layout(androidx.ui.unit.IntPx width, androidx.ui.unit.IntPx height, java.util.Map<androidx.ui.core.AlignmentLine,androidx.ui.unit.IntPx> alignmentLines = emptyMap(), kotlin.jvm.functions.Function1<? super androidx.ui.core.Placeable.PlacementScope,kotlin.Unit> placementBlock);
- method public void setAmbientLayoutDirection(androidx.ui.core.LayoutDirection p);
- method public void setLayoutDirection(androidx.ui.core.LayoutDirection p);
- property public androidx.ui.core.LayoutDirection ambientLayoutDirection;
- property public androidx.ui.core.LayoutDirection layoutDirection;
}
public static interface MeasureScope.LayoutResult {
@@ -229,13 +223,6 @@
field public static final androidx.ui.core.Modifier.None! INSTANCE;
}
- public interface ModifierScope extends androidx.ui.unit.Density {
- method public androidx.ui.core.LayoutDirection getAmbientLayoutDirection();
- method public androidx.ui.core.LayoutDirection getLayoutDirection();
- property public abstract androidx.ui.core.LayoutDirection ambientLayoutDirection;
- property public abstract androidx.ui.core.LayoutDirection layoutDirection;
- }
-
public interface ParentDataModifier extends androidx.ui.core.Modifier.Element {
method public default Object? modifyParentData(androidx.ui.unit.Density, Object? parentData);
}
diff --git a/ui/ui-core/api/restricted_0.1.0-dev06.txt b/ui/ui-core/api/restricted_0.1.0-dev06.txt
index d125972..61e2694 100644
--- a/ui/ui-core/api/restricted_0.1.0-dev06.txt
+++ b/ui/ui-core/api/restricted_0.1.0-dev06.txt
@@ -172,30 +172,24 @@
}
public interface LayoutModifier extends androidx.ui.core.Modifier.Element {
- method public default androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public default androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public default androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public default androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public default androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public default androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
- method public default androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public default androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public default androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public default androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
}
public interface Measurable extends androidx.ui.core.IntrinsicMeasurable {
method public androidx.ui.core.Placeable measure(androidx.ui.core.Constraints constraints);
}
- public abstract class MeasureScope implements androidx.ui.core.ModifierScope {
+ public abstract class MeasureScope implements androidx.ui.unit.Density {
ctor public MeasureScope();
- method public androidx.ui.core.LayoutDirection getAmbientLayoutDirection();
- method public androidx.ui.core.LayoutDirection getLayoutDirection();
method public final androidx.ui.core.MeasureScope.LayoutResult layout(androidx.ui.unit.IntPx width, androidx.ui.unit.IntPx height, java.util.Map<androidx.ui.core.AlignmentLine,androidx.ui.unit.IntPx> alignmentLines = emptyMap(), kotlin.jvm.functions.Function1<? super androidx.ui.core.Placeable.PlacementScope,kotlin.Unit> placementBlock);
- method public void setAmbientLayoutDirection(androidx.ui.core.LayoutDirection p);
- method public void setLayoutDirection(androidx.ui.core.LayoutDirection p);
- property public androidx.ui.core.LayoutDirection ambientLayoutDirection;
- property public androidx.ui.core.LayoutDirection layoutDirection;
}
public static interface MeasureScope.LayoutResult {
@@ -229,13 +223,6 @@
field public static final androidx.ui.core.Modifier.None! INSTANCE;
}
- public interface ModifierScope extends androidx.ui.unit.Density {
- method public androidx.ui.core.LayoutDirection getAmbientLayoutDirection();
- method public androidx.ui.core.LayoutDirection getLayoutDirection();
- property public abstract androidx.ui.core.LayoutDirection ambientLayoutDirection;
- property public abstract androidx.ui.core.LayoutDirection layoutDirection;
- }
-
public interface ParentDataModifier extends androidx.ui.core.Modifier.Element {
method public default Object? modifyParentData(androidx.ui.unit.Density, Object? parentData);
}
diff --git a/ui/ui-core/api/restricted_current.txt b/ui/ui-core/api/restricted_current.txt
index d125972..61e2694 100644
--- a/ui/ui-core/api/restricted_current.txt
+++ b/ui/ui-core/api/restricted_current.txt
@@ -172,30 +172,24 @@
}
public interface LayoutModifier extends androidx.ui.core.Modifier.Element {
- method public default androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public default androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public default androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public default androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public default androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public default androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
- method public default androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public default androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public default androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public default androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public default androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
}
public interface Measurable extends androidx.ui.core.IntrinsicMeasurable {
method public androidx.ui.core.Placeable measure(androidx.ui.core.Constraints constraints);
}
- public abstract class MeasureScope implements androidx.ui.core.ModifierScope {
+ public abstract class MeasureScope implements androidx.ui.unit.Density {
ctor public MeasureScope();
- method public androidx.ui.core.LayoutDirection getAmbientLayoutDirection();
- method public androidx.ui.core.LayoutDirection getLayoutDirection();
method public final androidx.ui.core.MeasureScope.LayoutResult layout(androidx.ui.unit.IntPx width, androidx.ui.unit.IntPx height, java.util.Map<androidx.ui.core.AlignmentLine,androidx.ui.unit.IntPx> alignmentLines = emptyMap(), kotlin.jvm.functions.Function1<? super androidx.ui.core.Placeable.PlacementScope,kotlin.Unit> placementBlock);
- method public void setAmbientLayoutDirection(androidx.ui.core.LayoutDirection p);
- method public void setLayoutDirection(androidx.ui.core.LayoutDirection p);
- property public androidx.ui.core.LayoutDirection ambientLayoutDirection;
- property public androidx.ui.core.LayoutDirection layoutDirection;
}
public static interface MeasureScope.LayoutResult {
@@ -229,13 +223,6 @@
field public static final androidx.ui.core.Modifier.None! INSTANCE;
}
- public interface ModifierScope extends androidx.ui.unit.Density {
- method public androidx.ui.core.LayoutDirection getAmbientLayoutDirection();
- method public androidx.ui.core.LayoutDirection getLayoutDirection();
- property public abstract androidx.ui.core.LayoutDirection ambientLayoutDirection;
- property public abstract androidx.ui.core.LayoutDirection layoutDirection;
- }
-
public interface ParentDataModifier extends androidx.ui.core.Modifier.Element {
method public default Object? modifyParentData(androidx.ui.unit.Density, Object? parentData);
}
diff --git a/ui/ui-core/integration-tests/samples/src/main/java/androidx/ui/core/samples/AlignmentLineSample.kt b/ui/ui-core/integration-tests/samples/src/main/java/androidx/ui/core/samples/AlignmentLineSample.kt
index a1126ea..8a4a5ee 100644
--- a/ui/ui-core/integration-tests/samples/src/main/java/androidx/ui/core/samples/AlignmentLineSample.kt
+++ b/ui/ui-core/integration-tests/samples/src/main/java/androidx/ui/core/samples/AlignmentLineSample.kt
@@ -38,7 +38,7 @@
@Composable
fun LineProviderLayout(exampleLinePosition: IntPx) {
val size: IntPx = 20.ipx
- Layout({}) { _, _ ->
+ Layout({}) { _, _, _ ->
layout(size, size, mapOf(exampleLine to exampleLinePosition)) {}
}
}
@@ -46,7 +46,7 @@
Layout({
LineProviderLayout(exampleLinePosition = 5.ipx)
LineProviderLayout(exampleLinePosition = 10.ipx)
- }) { measurables, constraints ->
+ }) { measurables, constraints, _ ->
val placeables = measurables.map { it.measure(constraints) }
// placeables[0][line] will be 5.ipx
// placeables[1][line] will be 10.ipx
diff --git a/ui/ui-core/src/main/java/androidx/ui/core/IntrinsicMeasurable.kt b/ui/ui-core/src/main/java/androidx/ui/core/IntrinsicMeasurable.kt
index 27a96b5..377aa5f 100644
--- a/ui/ui-core/src/main/java/androidx/ui/core/IntrinsicMeasurable.kt
+++ b/ui/ui-core/src/main/java/androidx/ui/core/IntrinsicMeasurable.kt
@@ -16,6 +16,7 @@
package androidx.ui.core
+import androidx.ui.unit.Density
import androidx.ui.unit.IntPx
/**
@@ -56,4 +57,5 @@
/**
* A function for performing intrinsic measurement.
*/
-typealias IntrinsicMeasureBlock = ModifierScope.(List<IntrinsicMeasurable>, IntPx) -> IntPx
\ No newline at end of file
+typealias IntrinsicMeasureBlock =
+ Density.(List<IntrinsicMeasurable>, IntPx, LayoutDirection) -> IntPx
\ No newline at end of file
diff --git a/ui/ui-core/src/main/java/androidx/ui/core/LayoutModifier.kt b/ui/ui-core/src/main/java/androidx/ui/core/LayoutModifier.kt
index 8fe1521..a45fd81 100644
--- a/ui/ui-core/src/main/java/androidx/ui/core/LayoutModifier.kt
+++ b/ui/ui-core/src/main/java/androidx/ui/core/LayoutModifier.kt
@@ -20,6 +20,7 @@
import androidx.ui.unit.IntPx
import androidx.ui.unit.IntPxPosition
import androidx.ui.unit.IntPxSize
+import androidx.ui.unit.ipx
/**
* A [Modifier.Element] that changes the way a UI component is measured and laid out.
@@ -28,92 +29,106 @@
/**
* Modifies [constraints] for performing measurement of the modified layout element.
*/
- fun ModifierScope.modifyConstraints(constraints: Constraints): Constraints = constraints
+ fun Density.modifyConstraints(
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
+ ): Constraints = constraints
+
+ /**
+ * Modifies the layout direction to be used for measurement and layout by the modified element.
+ */
+ fun Density.modifyLayoutDirection(layoutDirection: LayoutDirection) = layoutDirection
/**
* Returns the container size of a modified layout element given the original container
* measurement [constraints] and the measured [childSize].
*/
- fun ModifierScope.modifySize(constraints: Constraints, childSize: IntPxSize): IntPxSize =
- childSize
+ fun Density.modifySize(
+ constraints: Constraints,
+ layoutDirection: LayoutDirection,
+ childSize: IntPxSize
+ ): IntPxSize = childSize
/**
* Determines the modified minimum intrinsic width of [measurable].
* See [Measurable.minIntrinsicWidth].
*/
- fun ModifierScope.minIntrinsicWidthOf(measurable: Measurable, height: IntPx): IntPx {
+ fun Density.minIntrinsicWidthOf(
+ measurable: Measurable,
+ height: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx {
val constraints = Constraints(maxHeight = height)
- val layoutWidth = measurable.minIntrinsicWidth(modifyConstraints(constraints).maxHeight)
- return modifySize(constraints, IntPxSize(layoutWidth, height)).width
+ val layoutWidth =
+ measurable.minIntrinsicWidth(modifyConstraints(constraints, layoutDirection).maxHeight)
+ return modifySize(constraints, layoutDirection, IntPxSize(layoutWidth, height)).width
}
/**
* Determines the modified maximum intrinsic width of [measurable].
* See [Measurable.maxIntrinsicWidth].
*/
- fun ModifierScope.maxIntrinsicWidthOf(measurable: Measurable, height: IntPx): IntPx {
+ fun Density.maxIntrinsicWidthOf(
+ measurable: Measurable,
+ height: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx {
val constraints = Constraints(maxHeight = height)
- val layoutWidth = measurable.maxIntrinsicWidth(modifyConstraints(constraints).maxHeight)
- return modifySize(constraints, IntPxSize(layoutWidth, height)).width
+ val layoutWidth =
+ measurable.maxIntrinsicWidth(modifyConstraints(constraints, layoutDirection).maxHeight)
+ return modifySize(constraints, layoutDirection, IntPxSize(layoutWidth, height)).width
}
/**
* Determines the modified minimum intrinsic height of [measurable].
* See [Measurable.minIntrinsicHeight].
*/
- fun ModifierScope.minIntrinsicHeightOf(measurable: Measurable, width: IntPx): IntPx {
+ fun Density.minIntrinsicHeightOf(
+ measurable: Measurable,
+ width: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx {
val constraints = Constraints(maxWidth = width)
- val layoutHeight = measurable.minIntrinsicHeight(modifyConstraints(constraints).maxWidth)
- return modifySize(constraints, IntPxSize(width, layoutHeight)).height
+ val layoutHeight =
+ measurable.minIntrinsicHeight(modifyConstraints(constraints, layoutDirection).maxWidth)
+ return modifySize(constraints, layoutDirection, IntPxSize(width, layoutHeight)).height
}
/**
* Determines the modified maximum intrinsic height of [measurable].
* See [Measurable.maxIntrinsicHeight].
*/
- fun ModifierScope.maxIntrinsicHeightOf(measurable: Measurable, width: IntPx): IntPx {
+ fun Density.maxIntrinsicHeightOf(
+ measurable: Measurable,
+ width: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx {
val constraints = Constraints(maxWidth = width)
- val layoutHeight = measurable.maxIntrinsicHeight(modifyConstraints(constraints).maxWidth)
- return modifySize(constraints, IntPxSize(width, layoutHeight)).height
+ val layoutHeight =
+ measurable.maxIntrinsicHeight(modifyConstraints(constraints, layoutDirection).maxWidth)
+ return modifySize(constraints, layoutDirection, IntPxSize(width, layoutHeight)).height
}
/**
* Returns the position of a modified child of size [childSize] within a container of
* size [containerSize].
*/
- fun ModifierScope.modifyPosition(
+ fun Density.modifyPosition(
childSize: IntPxSize,
- containerSize: IntPxSize
- ): IntPxPosition = IntPxPosition.Origin
+ containerSize: IntPxSize,
+ layoutDirection: LayoutDirection
+ ): IntPxPosition = if (layoutDirection == LayoutDirection.Ltr) {
+ IntPxPosition.Origin
+ } else {
+ IntPxPosition(containerSize.width - childSize.width, 0.ipx)
+ }
/**
* Returns the modified position of [line] given its unmodified [value].
*/
- fun ModifierScope.modifyAlignmentLine(
+ fun Density.modifyAlignmentLine(
line: AlignmentLine,
- value: IntPx?
+ value: IntPx?,
+ layoutDirection: LayoutDirection
): IntPx? = value
-
- /**
- * Modifies the layout direction to be used for measurement and layout by the modified layout
- * node.
- */
- fun ModifierScope.modifyLayoutDirection(): LayoutDirection = layoutDirection
-}
-
-/**
- * Receiver scope for a layout modifier.
- */
-interface ModifierScope : Density {
-
- /**
- * Layout direction set by layout modifier to force LTR or RTL direction in layout.
- */
- val layoutDirection: LayoutDirection
-
- /**
- * Layout direction provided through ambient. Unless modified through ambient, it reflects
- * the locale's direction.
- */
- val ambientLayoutDirection: LayoutDirection
}
\ No newline at end of file
diff --git a/ui/ui-core/src/main/java/androidx/ui/core/MeasureScope.kt b/ui/ui-core/src/main/java/androidx/ui/core/MeasureScope.kt
index 0e202e9..058711c 100644
--- a/ui/ui-core/src/main/java/androidx/ui/core/MeasureScope.kt
+++ b/ui/ui-core/src/main/java/androidx/ui/core/MeasureScope.kt
@@ -16,13 +16,14 @@
package androidx.ui.core
+import androidx.ui.unit.Density
import androidx.ui.unit.IntPx
/**
* The receiver scope of a layout's measure lambda. The return value of the
* measure lambda is [LayoutResult], which should be returned by [layout]
*/
-abstract class MeasureScope : ModifierScope {
+abstract class MeasureScope : Density {
/**
* Interface holding the size and alignment lines of the measured layout, as well as the
* children positioning logic.
@@ -66,16 +67,10 @@
override fun placeChildren(placementScope: Placeable.PlacementScope) =
placementScope.placementBlock()
}
-
- // Value comes from the ambient. Needed to provide an API that allows to restore the
- // modified layout direction to ambient's state.
- override var ambientLayoutDirection = LayoutDirection.Ltr
-
- // Stores the layout direction of the node that can be updated through the layout modifier.
- override var layoutDirection = LayoutDirection.Ltr
}
/**
* A function for performing layout measurement.
*/
-typealias MeasureBlock = MeasureScope.(List<Measurable>, Constraints) -> MeasureScope.LayoutResult
\ No newline at end of file
+typealias MeasureBlock =
+ MeasureScope.(List<Measurable>, Constraints, LayoutDirection) -> MeasureScope.LayoutResult
\ No newline at end of file
diff --git a/ui/ui-foundation/src/main/java/androidx/ui/foundation/AdapterList.kt b/ui/ui-foundation/src/main/java/androidx/ui/foundation/AdapterList.kt
index 72bca3d..921976a 100644
--- a/ui/ui-foundation/src/main/java/androidx/ui/foundation/AdapterList.kt
+++ b/ui/ui-foundation/src/main/java/androidx/ui/foundation/AdapterList.kt
@@ -26,6 +26,7 @@
import androidx.ui.core.Clip
import androidx.ui.core.Constraints
import androidx.ui.core.ContextAmbient
+import androidx.ui.core.LayoutDirection
import androidx.ui.core.LayoutNode
import androidx.ui.core.Measurable
import androidx.ui.core.MeasureScope
@@ -253,7 +254,8 @@
override fun measure(
measureScope: MeasureScope,
measurables: List<Measurable>,
- constraints: Constraints
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
): MeasureScope.LayoutResult {
measuredThisPass.clear()
if (forceRecompose) {
@@ -403,7 +405,7 @@
if (atEnd || atStart) {
// This is a new node, either at the end or the start
node = LayoutNode()
- node.measureBlocks = MeasuringIntrinsicsMeasureBlocks { measurables, constraints ->
+ node.measureBlocks = MeasuringIntrinsicsMeasureBlocks { measurables, constraints, _ ->
val placeables = measurables.map { measurable ->
measurable.measure(
Constraints(
diff --git a/ui/ui-foundation/src/main/java/androidx/ui/foundation/Box.kt b/ui/ui-foundation/src/main/java/androidx/ui/foundation/Box.kt
index 9ddbde0..49f3529 100644
--- a/ui/ui-foundation/src/main/java/androidx/ui/foundation/Box.kt
+++ b/ui/ui-foundation/src/main/java/androidx/ui/foundation/Box.kt
@@ -87,7 +87,10 @@
}
// TODO(malkov): support ContentColor prorogation (b/148129218)
// TODO(popam): there should be no custom layout, use Column instead (b/148809177)
- Layout(children, modifier + backgroundModifier + borderModifier) { measurables, constraints ->
+ Layout(
+ children,
+ modifier + backgroundModifier + borderModifier
+ ) { measurables, constraints, _ ->
val leftPadding = if (paddingLeft != Dp.Unspecified) paddingLeft else padding
val topPadding = if (paddingTop != Dp.Unspecified) paddingTop else padding
val rightPadding = if (paddingRight != Dp.Unspecified) paddingRight else padding
diff --git a/ui/ui-foundation/src/main/java/androidx/ui/foundation/Scroller.kt b/ui/ui-foundation/src/main/java/androidx/ui/foundation/Scroller.kt
index 0e6e422..8ddbc81 100644
--- a/ui/ui-foundation/src/main/java/androidx/ui/foundation/Scroller.kt
+++ b/ui/ui-foundation/src/main/java/androidx/ui/foundation/Scroller.kt
@@ -269,7 +269,7 @@
}
}
},
- measureBlock = { measurables, constraints ->
+ measureBlock = { measurables, constraints, _ ->
if (measurables.size > 1) {
throw IllegalStateException("Only one child is allowed in a VerticalScroller")
}
diff --git a/ui/ui-framework/api/0.1.0-dev06.txt b/ui/ui-framework/api/0.1.0-dev06.txt
index 4e83692..32aad34 100644
--- a/ui/ui-framework/api/0.1.0-dev06.txt
+++ b/ui/ui-framework/api/0.1.0-dev06.txt
@@ -23,10 +23,10 @@
}
public final class LayoutKt {
- method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> minIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> minIntrinsicHeightMeasureBlock, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> maxIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> maxIntrinsicHeightMeasureBlock, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
- method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
- method @Deprecated public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit>![] childrenArray, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super androidx.ui.core.MultiComposableMeasurables,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
- method public static androidx.ui.core.LayoutNode.MeasureBlocks MeasuringIntrinsicsMeasureBlocks(kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> minIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> minIntrinsicHeightMeasureBlock, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> maxIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> maxIntrinsicHeightMeasureBlock, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method @Deprecated public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit>![] childrenArray, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super androidx.ui.core.MultiComposableMeasurables,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method public static androidx.ui.core.LayoutNode.MeasureBlocks MeasuringIntrinsicsMeasureBlocks(kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
method public static inline void OnChildPositioned(kotlin.jvm.functions.Function1<? super androidx.ui.core.LayoutCoordinates,kotlin.Unit> onPositioned, kotlin.jvm.functions.Function0<kotlin.Unit> children);
method public static inline void OnPositioned(kotlin.jvm.functions.Function1<? super androidx.ui.core.LayoutCoordinates,kotlin.Unit> onPositioned);
method public static void WithConstraints(androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function1<? super androidx.ui.core.Constraints,kotlin.Unit> children);
diff --git a/ui/ui-framework/api/api_lint.ignore b/ui/ui-framework/api/api_lint.ignore
index 419883c..b9a7976 100644
--- a/ui/ui-framework/api/api_lint.ignore
+++ b/ui/ui-framework/api/api_lint.ignore
@@ -1,5 +1,5 @@
// Baseline format: 1.0
-ArrayReturn: androidx.ui.core.LayoutKt#Layout(kotlin.jvm.functions.Function0<kotlin.Unit>[], androidx.ui.core.Modifier, kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super androidx.ui.core.MultiComposableMeasurables,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult>) parameter #0:
+ArrayReturn: androidx.ui.core.LayoutKt#Layout(kotlin.jvm.functions.Function0<kotlin.Unit>[], androidx.ui.core.Modifier, kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super androidx.ui.core.MultiComposableMeasurables,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult>) parameter #0:
Method parameter should be Collection<Function0> (or subclass) instead of raw array; was `kotlin.jvm.functions.Function0<kotlin.Unit>[]`
diff --git a/ui/ui-framework/api/current.txt b/ui/ui-framework/api/current.txt
index 4e83692..32aad34 100644
--- a/ui/ui-framework/api/current.txt
+++ b/ui/ui-framework/api/current.txt
@@ -23,10 +23,10 @@
}
public final class LayoutKt {
- method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> minIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> minIntrinsicHeightMeasureBlock, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> maxIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> maxIntrinsicHeightMeasureBlock, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
- method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
- method @Deprecated public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit>![] childrenArray, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super androidx.ui.core.MultiComposableMeasurables,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
- method public static androidx.ui.core.LayoutNode.MeasureBlocks MeasuringIntrinsicsMeasureBlocks(kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> minIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> minIntrinsicHeightMeasureBlock, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> maxIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> maxIntrinsicHeightMeasureBlock, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method @Deprecated public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit>![] childrenArray, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super androidx.ui.core.MultiComposableMeasurables,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method public static androidx.ui.core.LayoutNode.MeasureBlocks MeasuringIntrinsicsMeasureBlocks(kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
method public static inline void OnChildPositioned(kotlin.jvm.functions.Function1<? super androidx.ui.core.LayoutCoordinates,kotlin.Unit> onPositioned, kotlin.jvm.functions.Function0<kotlin.Unit> children);
method public static inline void OnPositioned(kotlin.jvm.functions.Function1<? super androidx.ui.core.LayoutCoordinates,kotlin.Unit> onPositioned);
method public static void WithConstraints(androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function1<? super androidx.ui.core.Constraints,kotlin.Unit> children);
diff --git a/ui/ui-framework/api/public_plus_experimental_0.1.0-dev06.txt b/ui/ui-framework/api/public_plus_experimental_0.1.0-dev06.txt
index 4e83692..32aad34 100644
--- a/ui/ui-framework/api/public_plus_experimental_0.1.0-dev06.txt
+++ b/ui/ui-framework/api/public_plus_experimental_0.1.0-dev06.txt
@@ -23,10 +23,10 @@
}
public final class LayoutKt {
- method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> minIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> minIntrinsicHeightMeasureBlock, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> maxIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> maxIntrinsicHeightMeasureBlock, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
- method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
- method @Deprecated public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit>![] childrenArray, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super androidx.ui.core.MultiComposableMeasurables,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
- method public static androidx.ui.core.LayoutNode.MeasureBlocks MeasuringIntrinsicsMeasureBlocks(kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> minIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> minIntrinsicHeightMeasureBlock, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> maxIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> maxIntrinsicHeightMeasureBlock, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method @Deprecated public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit>![] childrenArray, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super androidx.ui.core.MultiComposableMeasurables,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method public static androidx.ui.core.LayoutNode.MeasureBlocks MeasuringIntrinsicsMeasureBlocks(kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
method public static inline void OnChildPositioned(kotlin.jvm.functions.Function1<? super androidx.ui.core.LayoutCoordinates,kotlin.Unit> onPositioned, kotlin.jvm.functions.Function0<kotlin.Unit> children);
method public static inline void OnPositioned(kotlin.jvm.functions.Function1<? super androidx.ui.core.LayoutCoordinates,kotlin.Unit> onPositioned);
method public static void WithConstraints(androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function1<? super androidx.ui.core.Constraints,kotlin.Unit> children);
diff --git a/ui/ui-framework/api/public_plus_experimental_current.txt b/ui/ui-framework/api/public_plus_experimental_current.txt
index 4e83692..32aad34 100644
--- a/ui/ui-framework/api/public_plus_experimental_current.txt
+++ b/ui/ui-framework/api/public_plus_experimental_current.txt
@@ -23,10 +23,10 @@
}
public final class LayoutKt {
- method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> minIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> minIntrinsicHeightMeasureBlock, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> maxIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> maxIntrinsicHeightMeasureBlock, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
- method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
- method @Deprecated public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit>![] childrenArray, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super androidx.ui.core.MultiComposableMeasurables,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
- method public static androidx.ui.core.LayoutNode.MeasureBlocks MeasuringIntrinsicsMeasureBlocks(kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> minIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> minIntrinsicHeightMeasureBlock, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> maxIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> maxIntrinsicHeightMeasureBlock, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method @Deprecated public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit>![] childrenArray, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super androidx.ui.core.MultiComposableMeasurables,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method public static androidx.ui.core.LayoutNode.MeasureBlocks MeasuringIntrinsicsMeasureBlocks(kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
method public static inline void OnChildPositioned(kotlin.jvm.functions.Function1<? super androidx.ui.core.LayoutCoordinates,kotlin.Unit> onPositioned, kotlin.jvm.functions.Function0<kotlin.Unit> children);
method public static inline void OnPositioned(kotlin.jvm.functions.Function1<? super androidx.ui.core.LayoutCoordinates,kotlin.Unit> onPositioned);
method public static void WithConstraints(androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function1<? super androidx.ui.core.Constraints,kotlin.Unit> children);
diff --git a/ui/ui-framework/api/restricted_0.1.0-dev06.txt b/ui/ui-framework/api/restricted_0.1.0-dev06.txt
index 4e83692..32aad34 100644
--- a/ui/ui-framework/api/restricted_0.1.0-dev06.txt
+++ b/ui/ui-framework/api/restricted_0.1.0-dev06.txt
@@ -23,10 +23,10 @@
}
public final class LayoutKt {
- method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> minIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> minIntrinsicHeightMeasureBlock, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> maxIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> maxIntrinsicHeightMeasureBlock, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
- method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
- method @Deprecated public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit>![] childrenArray, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super androidx.ui.core.MultiComposableMeasurables,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
- method public static androidx.ui.core.LayoutNode.MeasureBlocks MeasuringIntrinsicsMeasureBlocks(kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> minIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> minIntrinsicHeightMeasureBlock, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> maxIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> maxIntrinsicHeightMeasureBlock, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method @Deprecated public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit>![] childrenArray, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super androidx.ui.core.MultiComposableMeasurables,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method public static androidx.ui.core.LayoutNode.MeasureBlocks MeasuringIntrinsicsMeasureBlocks(kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
method public static inline void OnChildPositioned(kotlin.jvm.functions.Function1<? super androidx.ui.core.LayoutCoordinates,kotlin.Unit> onPositioned, kotlin.jvm.functions.Function0<kotlin.Unit> children);
method public static inline void OnPositioned(kotlin.jvm.functions.Function1<? super androidx.ui.core.LayoutCoordinates,kotlin.Unit> onPositioned);
method public static void WithConstraints(androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function1<? super androidx.ui.core.Constraints,kotlin.Unit> children);
diff --git a/ui/ui-framework/api/restricted_current.txt b/ui/ui-framework/api/restricted_current.txt
index 4e83692..32aad34 100644
--- a/ui/ui-framework/api/restricted_current.txt
+++ b/ui/ui-framework/api/restricted_current.txt
@@ -23,10 +23,10 @@
}
public final class LayoutKt {
- method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> minIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> minIntrinsicHeightMeasureBlock, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> maxIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function3<? super androidx.ui.core.ModifierScope,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,androidx.ui.unit.IntPx> maxIntrinsicHeightMeasureBlock, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
- method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
- method @Deprecated public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit>![] childrenArray, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super androidx.ui.core.MultiComposableMeasurables,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
- method public static androidx.ui.core.LayoutNode.MeasureBlocks MeasuringIntrinsicsMeasureBlocks(kotlin.jvm.functions.Function3<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> minIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> minIntrinsicHeightMeasureBlock, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> maxIntrinsicWidthMeasureBlock, kotlin.jvm.functions.Function4<? super androidx.ui.unit.Density,? super java.util.List<? extends androidx.ui.core.IntrinsicMeasurable>,? super androidx.ui.unit.IntPx,? super androidx.ui.core.LayoutDirection,androidx.ui.unit.IntPx> maxIntrinsicHeightMeasureBlock, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit> children, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method @Deprecated public static void Layout(kotlin.jvm.functions.Function0<kotlin.Unit>![] childrenArray, androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super androidx.ui.core.MultiComposableMeasurables,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
+ method public static androidx.ui.core.LayoutNode.MeasureBlocks MeasuringIntrinsicsMeasureBlocks(kotlin.jvm.functions.Function4<? super androidx.ui.core.MeasureScope,? super java.util.List<? extends androidx.ui.core.Measurable>,? super androidx.ui.core.Constraints,? super androidx.ui.core.LayoutDirection,? extends androidx.ui.core.MeasureScope.LayoutResult> measureBlock);
method public static inline void OnChildPositioned(kotlin.jvm.functions.Function1<? super androidx.ui.core.LayoutCoordinates,kotlin.Unit> onPositioned, kotlin.jvm.functions.Function0<kotlin.Unit> children);
method public static inline void OnPositioned(kotlin.jvm.functions.Function1<? super androidx.ui.core.LayoutCoordinates,kotlin.Unit> onPositioned);
method public static void WithConstraints(androidx.ui.core.Modifier modifier = Modifier.None, kotlin.jvm.functions.Function1<? super androidx.ui.core.Constraints,kotlin.Unit> children);
diff --git a/ui/ui-framework/integration-tests/framework-demos/src/main/java/androidx/ui/framework/demos/MultipleCollect.kt b/ui/ui-framework/integration-tests/framework-demos/src/main/java/androidx/ui/framework/demos/MultipleCollect.kt
index b3c2c18..a1882ae 100644
--- a/ui/ui-framework/integration-tests/framework-demos/src/main/java/androidx/ui/framework/demos/MultipleCollect.kt
+++ b/ui/ui-framework/integration-tests/framework-demos/src/main/java/androidx/ui/framework/demos/MultipleCollect.kt
@@ -46,7 +46,7 @@
},
children = content
)
- }) { measurables, constraints ->
+ }) { measurables, constraints, _ ->
val headerPlaceable = measurables.first { it.tag == "header" }.measure(
Constraints.fixed(constraints.maxWidth, 100.ipx)
)
diff --git a/ui/ui-framework/integration-tests/framework-demos/src/main/java/androidx/ui/framework/demos/gestures/NestedScalingDemo.kt b/ui/ui-framework/integration-tests/framework-demos/src/main/java/androidx/ui/framework/demos/gestures/NestedScalingDemo.kt
index 4bc54a6..025a47a 100644
--- a/ui/ui-framework/integration-tests/framework-demos/src/main/java/androidx/ui/framework/demos/gestures/NestedScalingDemo.kt
+++ b/ui/ui-framework/integration-tests/framework-demos/src/main/java/androidx/ui/framework/demos/gestures/NestedScalingDemo.kt
@@ -42,7 +42,7 @@
Scalable(.5f, Color(0xFF4caf50.toInt())) {}
}
},
- measureBlock = { measurables, constraints ->
+ measureBlock = { measurables, constraints, _ ->
val placeable = measurables.first().measure(constraints)
@@ -83,7 +83,7 @@
Layout(
children = children,
modifier = LayoutAlign.Center + DrawBackground(color = color),
- measureBlock = { measurables, constraints ->
+ measureBlock = { measurables, constraints, _ ->
val newConstraints =
constraints.copy(
maxWidth = constraints.maxWidth * currentPercent.value,
diff --git a/ui/ui-framework/integration-tests/framework-demos/src/main/java/androidx/ui/framework/demos/gestures/NestedScrollingDemo.kt b/ui/ui-framework/integration-tests/framework-demos/src/main/java/androidx/ui/framework/demos/gestures/NestedScrollingDemo.kt
index 06c1fb5..19e456c 100644
--- a/ui/ui-framework/integration-tests/framework-demos/src/main/java/androidx/ui/framework/demos/gestures/NestedScrollingDemo.kt
+++ b/ui/ui-framework/integration-tests/framework-demos/src/main/java/androidx/ui/framework/demos/gestures/NestedScrollingDemo.kt
@@ -114,7 +114,7 @@
Layout(
children = children,
modifier = ClipModifier,
- measureBlock = { measurables, constraints ->
+ measureBlock = { measurables, constraints, _ ->
val placeable =
measurables.first()
.measure(constraints.copy(minHeight = 0.ipx, maxHeight = IntPx.Infinity))
diff --git a/ui/ui-framework/integration-tests/samples/src/main/java/androidx/ui/framework/samples/LayoutSample.kt b/ui/ui-framework/integration-tests/samples/src/main/java/androidx/ui/framework/samples/LayoutSample.kt
index 8d75bc0..2971eec7 100644
--- a/ui/ui-framework/integration-tests/samples/src/main/java/androidx/ui/framework/samples/LayoutSample.kt
+++ b/ui/ui-framework/integration-tests/samples/src/main/java/androidx/ui/framework/samples/LayoutSample.kt
@@ -32,22 +32,22 @@
// and will position them to be bottom right aligned.
Layout(
children,
- minIntrinsicWidthMeasureBlock = { measurables, h ->
+ minIntrinsicWidthMeasureBlock = { measurables, h, _ ->
// The min intrinsic width of this layout will be twice the largest min intrinsic
// width of a child. Note that we call minIntrinsicWidth with h / 2 for children,
// since we should be double the size of the children.
(measurables.map { it.minIntrinsicWidth(h / 2) }.maxBy { it.value } ?: 0.ipx) * 2
},
- minIntrinsicHeightMeasureBlock = { measurables, w ->
+ minIntrinsicHeightMeasureBlock = { measurables, w, _ ->
(measurables.map { it.minIntrinsicHeight(w / 2) }.maxBy { it.value } ?: 0.ipx) * 2
},
- maxIntrinsicWidthMeasureBlock = { measurables, h ->
+ maxIntrinsicWidthMeasureBlock = { measurables, h, _ ->
(measurables.map { it.maxIntrinsicHeight(h / 2) }.maxBy { it.value } ?: 0.ipx) * 2
},
- maxIntrinsicHeightMeasureBlock = { measurables, w ->
+ maxIntrinsicHeightMeasureBlock = { measurables, w, _ ->
(measurables.map { it.maxIntrinsicHeight(w / 2) }.maxBy { it.value } ?: 0.ipx) * 2
}
- ) { measurables, constraints ->
+ ) { measurables, constraints, _ ->
// measurables contains one element corresponding to each of our layout children.
// constraints are the constraints that our parent is currently measuring us with.
val childConstraints = Constraints(
@@ -74,7 +74,7 @@
fun LayoutUsage(children: @Composable() () -> Unit) {
// We build a layout that will occupy twice as much space as its children,
// and will position them to be bottom right aligned.
- Layout(children) { measurables, constraints ->
+ Layout(children) { measurables, constraints, _ ->
// measurables contains one element corresponding to each of our layout children.
// constraints are the constraints that our parent is currently measuring us with.
val childConstraints = Constraints(
@@ -104,7 +104,7 @@
// modifier on header and footer directly if they are composables accepting modifiers.
Container(LayoutTag("header"), children = header)
Container(LayoutTag("footer"), children = footer)
- }) { measurables, constraints ->
+ }) { measurables, constraints, _ ->
val placeables = measurables.map { measurable ->
when (measurable.tag) {
// You should use appropriate constraints. Here we measure with dummy constraints.
diff --git a/ui/ui-framework/integration-tests/samples/src/main/java/androidx/ui/framework/samples/OnPositionedSample.kt b/ui/ui-framework/integration-tests/samples/src/main/java/androidx/ui/framework/samples/OnPositionedSample.kt
index d474abb..4ab6684 100644
--- a/ui/ui-framework/integration-tests/samples/src/main/java/androidx/ui/framework/samples/OnPositionedSample.kt
+++ b/ui/ui-framework/integration-tests/samples/src/main/java/androidx/ui/framework/samples/OnPositionedSample.kt
@@ -78,7 +78,7 @@
*/
@Composable
fun Column(children: @Composable() () -> Unit) {
- Layout(children) { measurables, constraints ->
+ Layout(children) { measurables, constraints, _ ->
val placeables = measurables.map { measurable ->
measurable.measure(
Constraints(minWidth = constraints.minWidth, maxWidth = constraints.maxWidth)
diff --git a/ui/ui-framework/integration-tests/samples/src/main/java/androidx/ui/framework/samples/ParentDataSample.kt b/ui/ui-framework/integration-tests/samples/src/main/java/androidx/ui/framework/samples/ParentDataSample.kt
index 1c48435..981e39e 100644
--- a/ui/ui-framework/integration-tests/samples/src/main/java/androidx/ui/framework/samples/ParentDataSample.kt
+++ b/ui/ui-framework/integration-tests/samples/src/main/java/androidx/ui/framework/samples/ParentDataSample.kt
@@ -33,7 +33,7 @@
Box(LayoutSize(50.dp), backgroundColor = Color.Blue)
}
}
- Layout(parentDataComposable) { measurables, constraints ->
+ Layout(parentDataComposable) { measurables, constraints, _ ->
// The parentData will be 5.
measurables[0].parentData as Int
layout(constraints.maxWidth, constraints.maxHeight) {}
diff --git a/ui/ui-framework/src/androidTest/java/androidx/ui/core/PainterModifierTest.kt b/ui/ui-framework/src/androidTest/java/androidx/ui/core/PainterModifierTest.kt
index 320f96f..d48f201 100644
--- a/ui/ui-framework/src/androidTest/java/androidx/ui/core/PainterModifierTest.kt
+++ b/ui/ui-framework/src/androidTest/java/androidx/ui/core/PainterModifierTest.kt
@@ -40,6 +40,7 @@
import androidx.ui.graphics.compositeOver
import androidx.ui.graphics.painter.Painter
import androidx.ui.graphics.toArgb
+import androidx.ui.unit.Density
import androidx.ui.unit.IntPx
import androidx.ui.unit.IntPxSize
import androidx.ui.unit.Px
@@ -418,7 +419,7 @@
*/
@Composable
fun NoMinSizeContainer(children: @Composable() () -> Unit) {
- Layout(children) { measurables, constraints ->
+ Layout(children) { measurables, constraints, _ ->
val loosenedConstraints = constraints.copy(minWidth = 0.ipx, minHeight = 0.ipx)
val placeables = measurables.map { it.measure(loosenedConstraints) }
val maxPlaceableWidth = placeables.maxBy { it.width.value }?.width ?: 0.ipx
@@ -439,7 +440,7 @@
modifier: Modifier = Modifier.None,
children: @Composable() () -> Unit
) {
- Layout(children, modifier) { measurables, constraints ->
+ Layout(children, modifier) { measurables, constraints, _ ->
val placeables = measurables.map { it.measure(constraints) }
val width = max(
placeables.maxBy { it.width.value }?.width ?: 0.ipx, constraints
@@ -456,12 +457,16 @@
}
class FixedSizeModifier(val width: IntPx, val height: IntPx = width) : LayoutModifier {
- override fun ModifierScope.modifySize(
+ override fun Density.modifySize(
constraints: Constraints,
+ layoutDirection: LayoutDirection,
childSize: IntPxSize
): IntPxSize = IntPxSize(width, height)
- override fun ModifierScope.modifyConstraints(constraints: Constraints): Constraints =
+ override fun Density.modifyConstraints(
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
+ ): Constraints =
Constraints(
minWidth = width,
minHeight = height,
diff --git a/ui/ui-framework/src/androidTest/java/androidx/ui/core/PopupTest.kt b/ui/ui-framework/src/androidTest/java/androidx/ui/core/PopupTest.kt
index 9cc3bca..5ff94a6 100644
--- a/ui/ui-framework/src/androidTest/java/androidx/ui/core/PopupTest.kt
+++ b/ui/ui-framework/src/androidTest/java/androidx/ui/core/PopupTest.kt
@@ -562,7 +562,7 @@
@Composable
private fun TestAlign(children: @Composable() () -> Unit) {
- Layout(children) { measurables, constraints ->
+ Layout(children) { measurables, constraints, _ ->
val measurable = measurables.firstOrNull()
// The child cannot be larger than our max constraints, but we ignore min constraints.
val placeable = measurable?.measure(constraints.copy(minWidth = 0.ipx, minHeight = 0.ipx))
diff --git a/ui/ui-framework/src/androidTest/java/androidx/ui/core/TextLayoutTest.kt b/ui/ui-framework/src/androidTest/java/androidx/ui/core/TextLayoutTest.kt
index 5000378..74f5d42 100644
--- a/ui/ui-framework/src/androidTest/java/androidx/ui/core/TextLayoutTest.kt
+++ b/ui/ui-framework/src/androidTest/java/androidx/ui/core/TextLayoutTest.kt
@@ -125,11 +125,11 @@
}
Layout(
text,
- minIntrinsicWidthMeasureBlock = { _, _ -> 0.ipx },
- minIntrinsicHeightMeasureBlock = { _, _ -> 0.ipx },
- maxIntrinsicWidthMeasureBlock = { _, _ -> 0.ipx },
- maxIntrinsicHeightMeasureBlock = { _, _ -> 0.ipx }
- ) { measurables, _ ->
+ minIntrinsicWidthMeasureBlock = { _, _, _ -> 0.ipx },
+ minIntrinsicHeightMeasureBlock = { _, _, _ -> 0.ipx },
+ maxIntrinsicWidthMeasureBlock = { _, _, _ -> 0.ipx },
+ maxIntrinsicHeightMeasureBlock = { _, _, _ -> 0.ipx }
+ ) { measurables, _, _ ->
val textMeasurable = measurables.first()
// Min width.
assertEquals(textWidth, textMeasurable.minIntrinsicWidth(0.ipx))
@@ -159,7 +159,7 @@
val text = @Composable {
Text("aa", style = TextStyle(fontFamily = fontFamily))
}
- Layout(text) { measurables, _ ->
+ Layout(text) { measurables, _, _ ->
val placeable = measurables.first().measure(Constraints())
assertNotNull(placeable[FirstBaseline])
assertNotNull(placeable[LastBaseline])
@@ -167,7 +167,7 @@
layoutLatch.countDown()
layout(0.ipx, 0.ipx) {}
}
- Layout(text) { measurables, _ ->
+ Layout(text) { measurables, _, _ ->
val placeable = measurables.first().measure(Constraints(maxWidth = 0.ipx))
assertNotNull(placeable[FirstBaseline])
assertNotNull(placeable[LastBaseline])
@@ -187,7 +187,7 @@
val text = @Composable {
Text("aa", >
}
- Layout(text) { measurables, _ ->
+ Layout(text) { measurables, _, _ ->
measurables.first().measure(Constraints())
layoutLatch.countDown()
layout(0.ipx, 0.ipx) {}
@@ -201,7 +201,7 @@
val runnable: Runnable = object : Runnable {
override fun run() {
activity.setContent {
- Layout(composable) { measurables, constraints ->
+ Layout(composable) { measurables, constraints, _ ->
val placeables = measurables.map {
it.measure(constraints.copy(minWidth = 0.ipx, minHeight = 0.ipx))
}
diff --git a/ui/ui-framework/src/androidTest/java/androidx/ui/core/gesture/LongPressDragGestureDetectorTest.kt b/ui/ui-framework/src/androidTest/java/androidx/ui/core/gesture/LongPressDragGestureDetectorTest.kt
index 9f4a995..5bc4b4e 100644
--- a/ui/ui-framework/src/androidTest/java/androidx/ui/core/gesture/LongPressDragGestureDetectorTest.kt
+++ b/ui/ui-framework/src/androidTest/java/androidx/ui/core/gesture/LongPressDragGestureDetectorTest.kt
@@ -68,7 +68,7 @@
activity.setContent {
LongPressDragGestureDetector(longPressDragObserver) {
Layout(
- measureBlock = { _, _ ->
+ measureBlock = { _, _, _ ->
layout(100.ipx, 100.ipx) {
setupLatch.countDown()
}
diff --git a/ui/ui-framework/src/androidTest/java/androidx/ui/core/gesture/PressGestureDetectorTest.kt b/ui/ui-framework/src/androidTest/java/androidx/ui/core/gesture/PressGestureDetectorTest.kt
index ba19107..33e0498 100644
--- a/ui/ui-framework/src/androidTest/java/androidx/ui/core/gesture/PressGestureDetectorTest.kt
+++ b/ui/ui-framework/src/androidTest/java/androidx/ui/core/gesture/PressGestureDetectorTest.kt
@@ -225,7 +225,7 @@
@Composable
fun content(onLayout: () -> Unit) {
Layout(
- measureBlock = { _, _ ->
+ measureBlock = { _, _, _ ->
layout(100.ipx, 100.ipx) {
onLayout()
}
diff --git a/ui/ui-framework/src/androidTest/java/androidx/ui/core/gesture/ScaleGestureDetectorTest.kt b/ui/ui-framework/src/androidTest/java/androidx/ui/core/gesture/ScaleGestureDetectorTest.kt
index 5e979ac..05ff9c8 100644
--- a/ui/ui-framework/src/androidTest/java/androidx/ui/core/gesture/ScaleGestureDetectorTest.kt
+++ b/ui/ui-framework/src/androidTest/java/androidx/ui/core/gesture/ScaleGestureDetectorTest.kt
@@ -68,7 +68,7 @@
touchSlop = with(DensityAmbient.current) { TouchSlop.toPx() }
ScaleGestureDetector(scaleObserver) {
Layout(
- measureBlock = { _, _ ->
+ measureBlock = { _, _, _ ->
layout(
(touchSlop * LayoutDimensionFactor).ceil(),
(touchSlop * LayoutDimensionFactor).ceil()
diff --git a/ui/ui-framework/src/androidTest/java/androidx/ui/core/gesture/TouchSlopDragGestureDetectorTest.kt b/ui/ui-framework/src/androidTest/java/androidx/ui/core/gesture/TouchSlopDragGestureDetectorTest.kt
index fc324e9..b18f6e6 100644
--- a/ui/ui-framework/src/androidTest/java/androidx/ui/core/gesture/TouchSlopDragGestureDetectorTest.kt
+++ b/ui/ui-framework/src/androidTest/java/androidx/ui/core/gesture/TouchSlopDragGestureDetectorTest.kt
@@ -256,7 +256,7 @@
startDragImmediately = startDragImmediately
) {
Layout(
- measureBlock = { _, _ ->
+ measureBlock = { _, _, _ ->
layout(100.ipx, 100.ipx) {
setupLatch.countDown()
}
diff --git a/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/AndroidLayoutDrawTest.kt b/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/AndroidLayoutDrawTest.kt
index c23f024..c613aea 100644
--- a/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/AndroidLayoutDrawTest.kt
+++ b/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/AndroidLayoutDrawTest.kt
@@ -48,7 +48,7 @@
import androidx.ui.core.LayoutModifier
import androidx.ui.core.LayoutTag
import androidx.ui.core.Measurable
-import androidx.ui.core.ModifierScope
+import androidx.ui.unit.Density
import androidx.ui.core.Modifier
import androidx.ui.core.OnPositioned
import androidx.ui.core.ParentData
@@ -68,7 +68,6 @@
import androidx.ui.graphics.Color
import androidx.ui.graphics.Paint
import androidx.ui.graphics.PaintingStyle
-import androidx.ui.unit.Density
import androidx.ui.unit.IntPx
import androidx.ui.unit.IntPxPosition
import androidx.ui.unit.IntPxSize
@@ -317,7 +316,7 @@
Padding(size = model.size) {
FillColor(model, isInner = true)
}
- }, measureBlock = { measurables, constraints ->
+ }, measureBlock = { measurables, constraints, _ ->
val placeables = measurables.map { it.measure(constraints) }
layout(placeables[0].width, placeables[0].height) {
placeables[0].place(0.ipx, 0.ipx)
@@ -407,23 +406,23 @@
activityTestRule.runOnUiThreadIR {
activity.setContentInFrameLayout {
val header = @Composable {
- Layout(measureBlock = { _, constraints ->
+ Layout(measureBlock = { _, constraints, _ ->
assertEquals(childConstraints[0], constraints)
layout(0.ipx, 0.ipx) {}
}, children = emptyContent(), modifier = LayoutTag("header"))
}
val footer = @Composable {
- Layout(measureBlock = { _, constraints ->
+ Layout(measureBlock = { _, constraints, _ ->
assertEquals(childConstraints[1], constraints)
layout(0.ipx, 0.ipx) {}
}, children = emptyContent(), modifier = LayoutTag("footer"))
- Layout(measureBlock = { _, constraints ->
+ Layout(measureBlock = { _, constraints, _ ->
assertEquals(childConstraints[2], constraints)
layout(0.ipx, 0.ipx) {}
}, children = emptyContent(), modifier = LayoutTag("footer"))
}
- Layout({ header(); footer() }) { measurables, _ ->
+ Layout({ header(); footer() }) { measurables, _, _ ->
assertEquals(childrenCount, measurables.size)
measurables.forEachIndexed { index, measurable ->
measurable.measure(childConstraints[index])
@@ -447,16 +446,16 @@
activity.setContentInFrameLayout {
val header = @Composable {
ParentData(data = 0) {
- Layout(children = emptyContent()) { _, _ -> layout(0.ipx, 0.ipx) {} }
+ Layout(children = emptyContent()) { _, _, _ -> layout(0.ipx, 0.ipx) {} }
}
}
val footer = @Composable {
ParentData(data = 1) {
- Layout(children = emptyContent()) { _, _ -> layout(0.ipx, 0.ipx) {} }
+ Layout(children = emptyContent()) { _, _, _ -> layout(0.ipx, 0.ipx) {} }
}
}
- Layout({ header(); footer() }) { measurables, _ ->
+ Layout({ header(); footer() }) { measurables, _, _ ->
assertEquals(0, measurables[0].parentData)
assertEquals(1, measurables[1].parentData)
layout(0.ipx, 0.ipx) { }
@@ -507,7 +506,7 @@
paint.color = model.innerColor
canvas.drawRect(size.toRect(), paint)
})
- }, measureBlock = { measurables, constraints ->
+ }, measureBlock = { measurables, constraints, _ ->
measureCalls++
layout(30.ipx, 30.ipx) {
layoutCalls++
@@ -545,7 +544,7 @@
height: IntPx,
children: @Composable() () -> Unit
) {
- Layout(children = children, measureBlock = { measurables, constraints ->
+ Layout(children = children, measureBlock = { measurables, constraints, _ ->
val resolvedWidth = width.coerceIn(constraints.minWidth, constraints.maxWidth)
val resolvedHeight = height.coerceIn(constraints.minHeight, constraints.maxHeight)
layout(resolvedWidth, resolvedHeight) {
@@ -582,7 +581,7 @@
drawn.value = true
latch.countDown()
},
- measureBlock = { _, constraints ->
+ measureBlock = { _, constraints, _ ->
measured.value = true
val resolvedWidth = width.coerceIn(constraints.minWidth, constraints.maxWidth)
val resolvedHeight = constraints.minHeight
@@ -675,7 +674,7 @@
}
}
}
- ) { measurables, constraints ->
+ ) { measurables, constraints, _ ->
layout(width = 20.ipx, height = 20.ipx) {
measurables.first().measure(constraints)
.place(offset.offset, offset.offset)
@@ -789,7 +788,7 @@
activity.setContentInFrameLayout {
val child1 = @Composable {
Wrap {
- Layout(children = {}) { _, _ ->
+ Layout(children = {}) { _, _, _ ->
layout(
0.ipx,
0.ipx,
@@ -803,7 +802,7 @@
}
val child2 = @Composable {
Wrap {
- Layout(children = {}) { _, _ ->
+ Layout(children = {}) { _, _, _ ->
layout(
0.ipx,
0.ipx,
@@ -816,7 +815,7 @@
}
}
val inner = @Composable {
- Layout({ child1(); child2() }) { measurables, constraints ->
+ Layout({ child1(); child2() }) { measurables, constraints, _ ->
val placeable1 = measurables[0].measure(constraints)
val placeable2 = measurables[1].measure(constraints)
assertEquals(10.ipx, placeable1[TestVerticalLine])
@@ -829,7 +828,7 @@
}
}
}
- Layout(inner) { measurables, constraints ->
+ Layout(inner) { measurables, constraints, _ ->
val placeable = measurables.first().measure(constraints)
assertEquals(10.ipx, placeable[TestVerticalLine])
assertEquals(20.ipx, placeable[TestHorizontalLine])
@@ -851,17 +850,17 @@
activityTestRule.runOnUiThreadIR {
activity.setContentInFrameLayout {
val child1 = @Composable {
- Layout(children = {}) { _, _ ->
+ Layout(children = {}) { _, _, _ ->
layout(0.ipx, 0.ipx, mapOf(TestLine1 to 10.ipx)) {}
}
}
val child2 = @Composable {
- Layout(children = {}) { _, _ ->
+ Layout(children = {}) { _, _, _ ->
layout(0.ipx, 0.ipx, mapOf(TestLine2 to 20.ipx)) { }
}
}
val inner = @Composable {
- Layout({ child1(); child2() }) { measurables, constraints ->
+ Layout({ child1(); child2() }) { measurables, constraints, _ ->
val placeable1 = measurables[0].measure(constraints)
measurables[1].measure(constraints)
layout(0.ipx, 0.ipx) {
@@ -870,7 +869,7 @@
}
}
}
- Layout(inner) { measurables, constraints ->
+ Layout(inner) { measurables, constraints, _ ->
val placeable = measurables.first().measure(constraints)
assertEquals(10.ipx, placeable[TestLine1])
assertNull(placeable[TestLine2])
@@ -896,7 +895,7 @@
activityTestRule.runOnUiThreadIR {
activity.setContentInFrameLayout {
val child1 = @Composable {
- Layout(children = {}) { _, _ ->
+ Layout(children = {}) { _, _, _ ->
++child1Measures
layout(0.ipx, 0.ipx, mapOf(TestLine1 to 10.ipx)) {
++child1Layouts
@@ -904,7 +903,7 @@
}
}
val child2 = @Composable {
- Layout(children = {}) { _, _ ->
+ Layout(children = {}) { _, _, _ ->
++child2Measures
layout(0.ipx, 0.ipx, mapOf(TestLine2 to 20.ipx)) {
++child2Layouts
@@ -912,7 +911,7 @@
}
}
val inner = @Composable {
- Layout({ child1(); child2() }) { measurables, constraints ->
+ Layout({ child1(); child2() }) { measurables, constraints, _ ->
val placeable1 = measurables[0].measure(constraints)
val placeable2 = measurables[1].measure(constraints)
layout(0.ipx, 0.ipx) {
@@ -921,7 +920,7 @@
}
}
}
- Layout(inner) { measurables, constraints ->
+ Layout(inner) { measurables, constraints, _ ->
val placeable = measurables.first().measure(constraints)
assertEquals(10.ipx, placeable[TestLine1])
assertEquals(20.ipx, placeable[TestLine2])
@@ -951,7 +950,7 @@
activityTestRule.runOnUiThreadIR {
activity.setContentInFrameLayout {
val child1 = @Composable {
- Layout(children = {}) { _, _ ->
+ Layout(children = {}) { _, _, _ ->
++child1Measures
layout(0.ipx, 0.ipx, mapOf(TestLine1 to 10.ipx)) {
++child1Layouts
@@ -959,7 +958,7 @@
}
}
val child2 = @Composable {
- Layout(children = {}) { _, _ ->
+ Layout(children = {}) { _, _, _ ->
++child2Measures
layout(0.ipx, 0.ipx, mapOf(TestLine2 to 20.ipx)) {
++child2Layouts
@@ -967,7 +966,7 @@
}
}
val inner = @Composable {
- Layout({ child1(); child2() }) { measurables, constraints ->
+ Layout({ child1(); child2() }) { measurables, constraints, _ ->
val placeable1 = measurables[0].measure(constraints)
assertEquals(10.ipx, placeable1[TestLine1])
val placeable2 = measurables[1].measure(constraints)
@@ -977,7 +976,7 @@
}
}
}
- Layout(inner) { measurables, constraints ->
+ Layout(inner) { measurables, constraints, _ ->
val placeable = measurables.first().measure(constraints)
layout(placeable.width, placeable.height) {
layoutLatch.countDown()
@@ -999,12 +998,12 @@
activityTestRule.runOnUiThreadIR {
activity.setContentInFrameLayout {
val child1 = @Composable {
- Layout(children = { }) { _, _ ->
+ Layout(children = { }) { _, _, _ ->
layout(0.ipx, 0.ipx, mapOf(TestLine to 10.ipx)) { }
}
}
val child2 = @Composable {
- Layout(children = {}) { _, _ ->
+ Layout(children = {}) { _, _, _ ->
layout(
0.ipx,
0.ipx,
@@ -1013,7 +1012,7 @@
}
}
val inner = @Composable {
- Layout({ child1(); child2() }) { measurables, constraints ->
+ Layout({ child1(); child2() }) { measurables, constraints, _ ->
val placeable1 = measurables[0].measure(constraints)
layout(0.ipx, 0.ipx) {
assertEquals(10.ipx, placeable1[TestLine])
@@ -1022,7 +1021,7 @@
}
}
}
- Layout(inner) { measurables, constraints ->
+ Layout(inner) { measurables, constraints, _ ->
val placeable = measurables.first().measure(constraints)
layout(placeable.width, placeable.height) {
layoutLatch.countDown()
@@ -1041,14 +1040,14 @@
activityTestRule.runOnUiThreadIR {
activity.setContentInFrameLayout {
val child = @Composable {
- Layout(children = { }) { _, _ ->
+ Layout(children = { }) { _, _, _ ->
layout(0.ipx, 0.ipx, mapOf(TestLine to 10.ipx)) {
++childLayouts
}
}
}
val inner = @Composable {
- Layout({ child() }) { measurables, constraints ->
+ Layout({ child() }) { measurables, constraints, _ ->
val placeable = measurables[0].measure(constraints)
layout(0.ipx, 0.ipx) {
assertEquals(10.ipx, placeable[TestLine])
@@ -1057,7 +1056,7 @@
}
}
}
- Layout(inner) { measurables, constraints ->
+ Layout(inner) { measurables, constraints, _ ->
val placeable = measurables.first().measure(constraints)
layout(placeable.width, placeable.height) {
placeable.place(0.ipx, 0.ipx)
@@ -1081,11 +1080,11 @@
activityTestRule.runOnUiThreadIR {
activity.setContentInFrameLayout {
val child = @Composable {
- Layout(children = {}) { _, _ ->
+ Layout(children = {}) { _, _, _ ->
layout(0.ipx, 0.ipx, mapOf(TestLine to model.offset)) {}
}
}
- Layout(child) { measurables, constraints ->
+ Layout(child) { measurables, constraints, _ ->
val placeable = measurables.first().measure(constraints)
linePosition = placeable[TestLine]
++measure
@@ -1122,7 +1121,7 @@
activityTestRule.runOnUiThreadIR {
activity.setContentInFrameLayout {
val child = @Composable {
- Layout(children = {}) { _, _ ->
+ Layout(children = {}) { _, _, _ ->
layout(
0.ipx,
0.ipx,
@@ -1130,7 +1129,7 @@
) {}
}
}
- Layout(child) { measurables, constraints ->
+ Layout(child) { measurables, constraints, _ ->
val placeable = measurables.first().measure(constraints)
++measure
layout(placeable.width, placeable.height) {
@@ -1165,11 +1164,11 @@
activityTestRule.runOnUiThreadIR {
activity.setContentInFrameLayout {
val child = @Composable {
- Layout(children = {}) { _, _ ->
+ Layout(children = {}) { _, _, _ ->
layout(0.ipx, 0.ipx, mapOf(TestLine to model.offset)) { }
}
}
- Layout(child) { measurables, constraints ->
+ Layout(child) { measurables, constraints, _ ->
++measure
layout(1.ipx, 1.ipx) {
val placeable = measurables.first().measure(constraints)
@@ -1206,12 +1205,12 @@
activity.setContentInFrameLayout {
val innerChild = @Composable {
model.offset // Artificial remeasure.
- Layout(children = {}) { _, _ ->
+ Layout(children = {}) { _, _, _ ->
layout(0.ipx, 0.ipx, mapOf(TestLine to 10.ipx)) { }
}
}
val child = @Composable {
- Layout({ innerChild(); innerChild() }) { measurables, constraints ->
+ Layout({ innerChild(); innerChild() }) { measurables, constraints, _ ->
model.offset // Artificial remeasure.
val placeable1 = measurables[0].measure(constraints)
val placeable2 = measurables[1].measure(constraints)
@@ -1221,7 +1220,7 @@
}
}
}
- Layout(child) { measurables, constraints ->
+ Layout(child) { measurables, constraints, _ ->
val placeable = measurables.first().measure(constraints)
if (model.offset < 15.ipx) {
placeable[TestLine]
@@ -1254,19 +1253,19 @@
activityTestRule.runOnUiThreadIR {
activity.setContentInFrameLayout {
val innerChild = @Composable {
- Layout(children = {}) { _, _ ->
+ Layout(children = {}) { _, _, _ ->
layout(0.ipx, 0.ipx, mapOf(TestLine to 10.ipx)) { }
}
}
val child = @Composable {
- Layout({ innerChild() }) { measurables, constraints ->
+ Layout({ innerChild() }) { measurables, constraints, _ ->
val placeable = measurables.first().measure(constraints)
layout(0.ipx, 0.ipx, mapOf(TestLine to 20.ipx)) {
placeable.place(0.ipx, 0.ipx)
}
}
}
- Layout(child) { measurables, constraints ->
+ Layout(child) { measurables, constraints, _ ->
val placeable = measurables.first().measure(constraints)
assertEquals(20.ipx, placeable[TestLine])
layout(0.ipx, 0.ipx) {
@@ -1291,13 +1290,13 @@
activityTestRule.runOnUiThreadIR {
activity.setContentInFrameLayout {
val child = @Composable {
- Layout(children = {}) { _, _ ->
+ Layout(children = {}) { _, _, _ ->
++innerChildMeasures
layout(0.ipx, 0.ipx, mapOf(TestLine to 10.ipx)) { ++innerChildLayouts }
}
}
val inner = @Composable {
- Layout({ Wrap { Wrap { child() } } }) { measurables, constraints ->
+ Layout({ Wrap { Wrap { child() } } }) { measurables, constraints, _ ->
++outerChildMeasures
val placeable = measurables[0].measure(constraints)
layout(0.ipx, 0.ipx) {
@@ -1306,7 +1305,7 @@
}
}
}
- Layout(inner) { measurables, constraints ->
+ Layout(inner) { measurables, constraints, _ ->
val placeable = measurables.first().measure(constraints)
val width = placeable.width.coerceAtLeast(10.ipx)
val height = placeable.height.coerceAtLeast(10.ipx)
@@ -1343,12 +1342,12 @@
activityTestRule.runOnUiThreadIR {
activity.setContent {
val child = @Composable {
- Layout(children = {}) { _, _ ->
+ Layout(children = {}) { _, _, _ ->
layout(0.ipx, 0.ipx, mapOf(TestLine to 10.ipx)) { ++childLayouts }
}
}
val inner = @Composable {
- Layout({ Wrap { Wrap { child() } } }) { measurables, constraints ->
+ Layout({ Wrap { Wrap { child() } } }) { measurables, constraints, _ ->
val placeable = measurables[0].measure(constraints)
layout(0.ipx, 0.ipx) {
placeable.place(0.ipx, 0.ipx)
@@ -1356,7 +1355,7 @@
}
}
}
- Layout(inner) { measurables, constraints ->
+ Layout(inner) { measurables, constraints, _ ->
val placeable = measurables.first().measure(constraints)
layout(placeable.width, placeable.height) {
placeable.place(0.ipx, 0.ipx)
@@ -1379,7 +1378,7 @@
activityTestRule.runOnUiThreadIR {
activity.setContent {
val child = @Composable {
- Layout(children = {}) { _, _ ->
+ Layout(children = {}) { _, _, _ ->
layout(0.ipx, 0.ipx, mapOf(TestLine to 10.ipx)) {
model.offset // To ensure relayout.
++childLayouts
@@ -1387,7 +1386,9 @@
}
}
val inner = @Composable {
- Layout({ WrapForceRelayout(model) { child() } }) { measurables, constraints ->
+ Layout({
+ WrapForceRelayout(model) { child() }
+ }) { measurables, constraints, _ ->
val placeable = measurables[0].measure(constraints)
layout(0.ipx, 0.ipx) {
if (model.offset > 15.ipx) assertEquals(10.ipx, placeable[TestLine])
@@ -1396,7 +1397,7 @@
}
}
}
- Layout(inner) { measurables, constraints ->
+ Layout(inner) { measurables, constraints, _ ->
val placeable = measurables.first().measure(constraints)
val width = placeable.width.coerceAtLeast(10.ipx)
val height = placeable.height.coerceAtLeast(10.ipx)
@@ -1452,7 +1453,7 @@
val container = @Composable { children: @Composable() () -> Unit ->
// This simulates a Container optimisation, when the child does not
// affect parent size.
- Layout(children) { measurables, constraints ->
+ Layout(children) { measurables, constraints, _ ->
layout(30.ipx, 30.ipx) {
measurables[0].measure(constraints).place(0.ipx, 0.ipx)
}
@@ -1470,7 +1471,7 @@
assertTrue(laidOut)
latch.countDown()
}
- ) { _, _ ->
+ ) { _, _, _ ->
laidOut = true
layout(0.ipx, 0.ipx) {}
}
@@ -1500,7 +1501,7 @@
activity.setContentInFrameLayout {
Layout(children = {
AtLeastSize(30.ipx, modifier = draw { _, _ -> drawn = true })
- }, modifier = drawLatchModifier()) { _, _ ->
+ }, modifier = drawLatchModifier()) { _, _, _ ->
// don't measure or place the AtLeastSize
latch.countDown()
layout(20.ipx, 20.ipx) {}
@@ -1526,7 +1527,7 @@
val model = SquareModel(size = 0.ipx)
activityTestRule.runOnUiThreadIR {
activity.setContentInFrameLayout {
- Layout(children = { }) { _, _ ->
+ Layout(children = { }) { _, _, _ ->
latch.countDown()
layout(model.size, model.size) {}
}
@@ -1548,11 +1549,11 @@
activityTestRule.runOnUiThreadIR {
activity.setContentInFrameLayout {
Layout(children = {
- Layout(children = emptyContent()) { _, _ ->
+ Layout(children = emptyContent()) { _, _, _ ->
latch.countDown()
layout(model.size, model.size) {}
}
- }) { measurables, constraints ->
+ }) { measurables, constraints, _ ->
val placeable = measurables[0].measure(constraints)
layout(placeable.width, placeable.height) {
placeable.place(0.ipx, 0.ipx)
@@ -1577,12 +1578,12 @@
activity.setContentInFrameLayout {
Layout(children = {
RepaintBoundary {
- Layout(children = emptyContent()) { _, _ ->
+ Layout(children = emptyContent()) { _, _, _ ->
latch.countDown()
layout(model.size, model.size) {}
}
}
- }) { measurables, constraints ->
+ }) { measurables, constraints, _ ->
val placeable = measurables[0].measure(constraints)
layout(placeable.width, placeable.height) {
placeable.place(0.ipx, 0.ipx)
@@ -1641,11 +1642,11 @@
activity.setContentInFrameLayout {
Layout({
ParentData(data = 123) {
- Layout(children = { }) { _, _ ->
+ Layout(children = { }) { _, _, _ ->
layout(0.ipx, 0.ipx) { }
}
}
- }) { measurables, _ ->
+ }) { measurables, _, _ ->
assertEquals(123, measurables.first().parentData)
layout(0.ipx, 0.ipx) { }
}
@@ -1659,11 +1660,11 @@
activity.setContentInFrameLayout {
Layout({
ParentData(data = 456) {
- Layout(children = { }, modifier = PaddingModifier(10.ipx)) { _, _ ->
+ Layout(children = { }, modifier = PaddingModifier(10.ipx)) { _, _, _ ->
layout(0.ipx, 0.ipx) { }
}
}
- }) { measurables, _ ->
+ }) { measurables, _, _ ->
assertEquals(456, measurables.first().parentData)
layout(0.ipx, 0.ipx) { }
}
@@ -1681,13 +1682,13 @@
activity.setContentInFrameLayout {
val child = @Composable {
Wrap {
- Layout(children = {}, modifier = PaddingModifier(padding)) { _, _ ->
+ Layout(children = {}, modifier = PaddingModifier(padding)) { _, _, _ ->
layout(0.ipx, 0.ipx, mapOf(testLine to alignmentLinePosition)) { }
}
}
}
- Layout(child) { measurables, constraints ->
+ Layout(child) { measurables, constraints, _ ->
assertEquals(
padding + alignmentLinePosition,
measurables[0].measure(constraints)[testLine]
@@ -1756,7 +1757,7 @@
FixedSize(size, layoutModifier)
FixedSize(size, parentDataModifier)
},
- measureBlock = { measurables, constraints ->
+ measureBlock = { measurables, constraints, _ ->
measurables.forEachIndexed { i, child ->
val placeable = child.measure(constraints)
childSizes[i] = placeable.size
@@ -2026,7 +2027,7 @@
// this verifies the layout was remeasured before being drawn
assertTrue(lastLayoutValue)
drawlatch.countDown()
- }) { _, _ ->
+ }) { _, _, _ ->
lastLayoutValue = state.value
// this registers the value read
if (!state.value) {
@@ -2037,7 +2038,7 @@
layout(100.ipx, 100.ipx) {}
}
FixedSize(30.ipx, children = emptyContent())
- }) { measurables, constraints ->
+ }) { measurables, constraints, _ ->
val (first, second) = measurables
val firstPlaceable = first.measure(constraints)
// switch frame, as inside the measure block we changed the model value
@@ -2055,11 +2056,15 @@
}
private val AlignTopLeft = object : LayoutModifier {
- override fun ModifierScope.modifyConstraints(constraints: Constraints) =
+ override fun Density.modifyConstraints(
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
+ ) =
constraints.copy(minWidth = 0.ipx, minHeight = 0.ipx)
- override fun ModifierScope.modifySize(
+ override fun Density.modifySize(
constraints: Constraints,
+ layoutDirection: LayoutDirection,
childSize: IntPxSize
) = IntPxSize(constraints.maxWidth, constraints.maxHeight)
}
@@ -2254,7 +2259,7 @@
children: @Composable() () -> Unit = emptyContent()
) {
Layout(
- measureBlock = { measurables, constraints ->
+ measureBlock = { measurables, constraints, _ ->
val newConstraints = Constraints(
minWidth = max(size, constraints.minWidth),
maxWidth = max(size, constraints.maxWidth),
@@ -2287,7 +2292,7 @@
modifier: Modifier = Modifier.None,
children: @Composable() () -> Unit = emptyContent()
) {
- Layout(children = children, modifier = modifier) { measurables, _ ->
+ Layout(children = children, modifier = modifier) { measurables, _, _ ->
val newConstraints = Constraints.fixed(size, size)
val placeables = measurables.map { m ->
m.measure(newConstraints)
@@ -2303,7 +2308,7 @@
@Composable
fun Align(children: @Composable() () -> Unit) {
Layout(
- measureBlock = { measurables, constraints ->
+ measureBlock = { measurables, constraints, _ ->
val newConstraints = Constraints(
minWidth = IntPx.Zero,
maxWidth = constraints.maxWidth,
@@ -2336,7 +2341,7 @@
) {
Layout(
modifier = modifier,
- measureBlock = { measurables, constraints ->
+ measureBlock = { measurables, constraints, _ ->
val totalDiff = size * 2
val newConstraints = Constraints(
minWidth = (constraints.minWidth - totalDiff).coerceAtLeast(0.ipx),
@@ -2368,7 +2373,7 @@
latch: CountDownLatch,
children: @Composable() () -> Unit
) {
- Layout(children = children) { measurables, _ ->
+ Layout(children = children) { measurables, _, _ ->
val testConstraints = Constraints()
measurables.forEach { it.measure(testConstraints) }
val childConstraints = Constraints.fixed(size, size)
@@ -2390,7 +2395,7 @@
@Composable
fun Position(size: IntPx, offset: OffsetModel, children: @Composable() () -> Unit) {
- Layout(children) { measurables, constraints ->
+ Layout(children) { measurables, constraints, _ ->
val placeables = measurables.map { m ->
m.measure(constraints)
}
@@ -2404,7 +2409,7 @@
@Composable
fun Wrap(minWidth: IntPx = 0.ipx, minHeight: IntPx = 0.ipx, children: @Composable() () -> Unit) {
- Layout(children) { measurables, constraints ->
+ Layout(children) { measurables, constraints, _ ->
val placeables = measurables.map { it.measure(constraints) }
val width = max(placeables.maxBy { it.width.value }?.width ?: 0.ipx, minWidth)
val height = max(placeables.maxBy { it.height.value }?.height ?: 0.ipx, minHeight)
@@ -2440,7 +2445,7 @@
onMaxPositionChanged: () -> Unit,
child: @Composable() () -> Unit
) {
- Layout(child, modifier) { measurables, constraints ->
+ Layout(child, modifier) { measurables, constraints, _ ->
val childConstraints = constraints.copy(
maxHeight = constraints.maxHeight,
maxWidth = IntPx.Infinity
@@ -2457,7 +2462,7 @@
@Composable
fun WrapForceRelayout(model: OffsetModel, children: @Composable() () -> Unit) {
- Layout(children) { measurables, constraints ->
+ Layout(children) { measurables, constraints, _ ->
val placeables = measurables.map { it.measure(constraints) }
val width = placeables.maxBy { it.width.value }?.width ?: 0.ipx
val height = placeables.maxBy { it.height.value }?.height ?: 0.ipx
@@ -2470,7 +2475,7 @@
@Composable
fun SimpleRow(children: @Composable() () -> Unit) {
- Layout(children) { measurables, constraints ->
+ Layout(children) { measurables, constraints, _ ->
var width = 0.ipx
var height = 0.ipx
val placeables = measurables.map {
@@ -2491,7 +2496,7 @@
@Composable
fun JustConstraints(modifier: Modifier, children: @Composable() () -> Unit) {
- Layout(children, modifier) { _, constraints ->
+ Layout(children, modifier) { _, constraints, _ ->
layout(constraints.minWidth, constraints.minHeight) {}
}
}
@@ -2520,31 +2525,49 @@
val bottom: IntPx = 0.ipx
) : LayoutModifier {
- override fun ModifierScope.minIntrinsicWidthOf(measurable: Measurable, height: IntPx): IntPx =
+ override fun Density.minIntrinsicWidthOf(
+ measurable: Measurable,
+ height: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx =
measurable.minIntrinsicWidth((height - (top + bottom)).coerceAtLeast(0.ipx)) +
(left + right)
- override fun ModifierScope.maxIntrinsicWidthOf(measurable: Measurable, height: IntPx): IntPx =
+ override fun Density.maxIntrinsicWidthOf(
+ measurable: Measurable,
+ height: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx =
measurable.maxIntrinsicWidth((height - (top + bottom)).coerceAtLeast(0.ipx)) +
(left + right)
- override fun ModifierScope.minIntrinsicHeightOf(measurable: Measurable, width: IntPx): IntPx =
+ override fun Density.minIntrinsicHeightOf(
+ measurable: Measurable,
+ width: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx =
measurable.minIntrinsicHeight((width - (left + right)).coerceAtLeast(0.ipx)) +
(top + bottom)
- override fun ModifierScope.maxIntrinsicHeightOf(measurable: Measurable, width: IntPx): IntPx =
+ override fun Density.maxIntrinsicHeightOf(
+ measurable: Measurable,
+ width: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx =
measurable.maxIntrinsicHeight((width - (left + right)).coerceAtLeast(0.ipx)) +
(top + bottom)
- override fun ModifierScope.modifyConstraints(
- constraints: Constraints
+ override fun Density.modifyConstraints(
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
) = constraints.offset(
horizontal = -left - right,
vertical = -top - bottom
)
- override fun ModifierScope.modifySize(
+ override fun Density.modifySize(
constraints: Constraints,
+ layoutDirection: LayoutDirection,
childSize: IntPxSize
) = IntPxSize(
(left + childSize.width + right)
@@ -2553,9 +2576,10 @@
.coerceIn(constraints.minHeight, constraints.maxHeight)
)
- override fun ModifierScope.modifyPosition(
+ override fun Density.modifyPosition(
childSize: IntPxSize,
- containerSize: IntPxSize
+ containerSize: IntPxSize,
+ layoutDirection: LayoutDirection
) = IntPxPosition(left, top)
}
@@ -2668,9 +2692,10 @@
paint.style = PaintingStyle.fill
}
- override fun ModifierScope.modifyPosition(
+ override fun Density.modifyPosition(
childSize: IntPxSize,
- containerSize: IntPxSize
+ containerSize: IntPxSize,
+ layoutDirection: LayoutDirection
): IntPxPosition {
return IntPxPosition(
(containerSize.width - childSize.width) / 2,
@@ -2678,12 +2703,16 @@
)
}
- override fun ModifierScope.modifyConstraints(constraints: Constraints): Constraints {
+ override fun Density.modifyConstraints(
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
+ ): Constraints {
return Constraints.fixed(10.ipx, 10.ipx)
}
- override fun ModifierScope.modifySize(
+ override fun Density.modifySize(
constraints: Constraints,
+ layoutDirection: LayoutDirection,
childSize: IntPxSize
): IntPxSize {
return IntPxSize(constraints.maxWidth, constraints.maxHeight)
diff --git a/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/AndroidViewCompatTest.kt b/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/AndroidViewCompatTest.kt
index 7e11cf7..2209bce 100644
--- a/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/AndroidViewCompatTest.kt
+++ b/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/AndroidViewCompatTest.kt
@@ -36,8 +36,9 @@
import androidx.ui.core.AndroidComposeView
import androidx.ui.core.Constraints
import androidx.ui.core.Layout
+import androidx.ui.core.LayoutDirection
import androidx.ui.core.LayoutModifier
-import androidx.ui.core.ModifierScope
+import androidx.ui.unit.Density
import androidx.ui.core.Modifier
import androidx.ui.core.Ref
import androidx.ui.core.RepaintBoundary
@@ -80,7 +81,7 @@
Semantics {
Layout(@Composable {
ColoredSquareView(size = squareSize.offset.value, ref = squareRef)
- }) { measurables, constraints ->
+ }) { measurables, constraints, _ ->
assertEquals(1, measurables.size)
val placeable = measurables.first().measure(
constraints.copy(minWidth = 0.ipx, minHeight = 0.ipx)
@@ -369,7 +370,10 @@
}
fun LayoutConstraints(childConstraints: Constraints) = object : LayoutModifier {
- override fun ModifierScope.modifyConstraints(constraints: Constraints): Constraints {
+ override fun Density.modifyConstraints(
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
+ ): Constraints {
return childConstraints
}
}
@@ -379,7 +383,7 @@
modifier: Modifier = Modifier.None,
children: @Composable() () -> Unit
) {
- Layout(children, modifier) { measurables, constraints ->
+ Layout(children, modifier) { measurables, constraints, _ ->
val placeable = measurables[0].measure(constraints)
layout(placeable.width, placeable.height) {
placeable.place(0.ipx, 0.ipx)
diff --git a/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/LayoutTagTest.kt b/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/LayoutTagTest.kt
index 45deabe..1c6965c 100644
--- a/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/LayoutTagTest.kt
+++ b/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/LayoutTagTest.kt
@@ -70,7 +70,7 @@
children = { AtLeastSize(0.ipx, children = emptyContent()) }
)
}
- ) { measurables, _ ->
+ ) { measurables, _, _ ->
assertEquals(3, measurables.size)
assertEquals("first", measurables[0].tag)
assertEquals("second", measurables[1].tag)
diff --git a/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/ModelReadsTest.kt b/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/ModelReadsTest.kt
index 504da6b..d503ac0 100644
--- a/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/ModelReadsTest.kt
+++ b/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/ModelReadsTest.kt
@@ -60,7 +60,7 @@
// read from the model
model.offset
drawLatch.countDown()
- }) { _, _ ->
+ }) { _, _, _ ->
layout(10.ipx, 10.ipx) {
// read from the model
model.offset
@@ -103,7 +103,7 @@
// read from the model
drawModel.offset
drawLatch.countDown()
- }) { _, _ ->
+ }) { _, _, _ ->
layout(10.ipx, 10.ipx) {
// read from the model
positionModel.offset
@@ -145,7 +145,7 @@
// read from the model
model.offset
drawLatch.countDown()
- }) { _, _ ->
+ }) { _, _, _ ->
measureLatch.countDown()
// read from the model
layout(model.offset, 10.ipx) {}
@@ -182,7 +182,7 @@
var positionLatch = CountDownLatch(1)
rule.runOnUiThread {
activity.setContentInFrameLayout {
- Layout({}) { _, _ ->
+ Layout({}) { _, _, _ ->
measureLatch.countDown()
// read from the model
layout(measureModel.offset, 10.ipx) {
@@ -241,7 +241,7 @@
val model = ValueModel(0)
rule.runOnUiThread {
activity.setContentInFrameLayout {
- Layout({}) { _, _ ->
+ Layout({}) { _, _, _ ->
if (enabled.value) {
// read the model
model.value
@@ -262,7 +262,7 @@
val model = ValueModel(0)
rule.runOnUiThread {
activity.setContentInFrameLayout {
- Layout({}) { _, _ ->
+ Layout({}) { _, _, _ ->
layout(10.ipx, 10.ipx) {
if (enabled.value) {
// read the model
@@ -306,7 +306,7 @@
rule.runOnUiThread {
activity.setContentInFrameLayout {
if (enabled.value) {
- Layout({}) { _, _ ->
+ Layout({}) { _, _, _ ->
// read the model
model.value
latch.countDown()
@@ -327,7 +327,7 @@
rule.runOnUiThread {
activity.setContentInFrameLayout {
if (enabled.value) {
- Layout({}) { _, _ ->
+ Layout({}) { _, _, _ ->
layout(10.ipx, 10.ipx) {
// read the model
model.value
diff --git a/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/OpacityTest.kt b/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/OpacityTest.kt
index 0fda186..794b70a 100644
--- a/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/OpacityTest.kt
+++ b/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/OpacityTest.kt
@@ -234,7 +234,7 @@
@Composable
fun Row(children: @Composable() () -> Unit) {
- Layout(children) { measurables, constraints ->
+ Layout(children) { measurables, constraints, _ ->
val placeables = measurables.map { it.measure(constraints) }
var width = 0.ipx
var height = 0.ipx
diff --git a/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/ParentDataTest.kt b/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/ParentDataTest.kt
index edf5d5c..c5fbef6 100644
--- a/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/ParentDataTest.kt
+++ b/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/ParentDataTest.kt
@@ -64,7 +64,7 @@
activity.setContent {
Layout(children = {
SimpleDrawChild(drawLatch = drawLatch)
- }, measureBlock = { measurables, constraints ->
+ }, measureBlock = { measurables, constraints, _ ->
assertEquals(1, measurables.size)
parentData.value = measurables[0].parentData
@@ -89,7 +89,7 @@
ParentData(data = "Hello") {
SimpleDrawChild(drawLatch = drawLatch)
}
- }, measureBlock = { measurables, constraints ->
+ }, measureBlock = { measurables, constraints, _ ->
assertEquals(1, measurables.size)
parentData.value = measurables[0].parentData
@@ -114,7 +114,7 @@
ParentData(data = "Hello") {
Layout(children = {
SimpleDrawChild(drawLatch = drawLatch)
- }, measureBlock = { measurables, constraints ->
+ }, measureBlock = { measurables, constraints, _ ->
assertEquals(1, measurables.size)
parentData.value = measurables[0].parentData
diff --git a/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/WithConstraintsTest.kt b/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/WithConstraintsTest.kt
index 76a0ae8..369f534 100644
--- a/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/WithConstraintsTest.kt
+++ b/ui/ui-framework/src/androidTest/java/androidx/ui/core/test/WithConstraintsTest.kt
@@ -93,11 +93,11 @@
}
WithConstraints(drawModifier) { constraints ->
paddedConstraints.value = constraints
- Layout(measureBlock = { _, childConstraints ->
+ Layout(measureBlock = { _, childConstraints, _ ->
firstChildConstraints.value = childConstraints
layout(size, size) { }
}, children = { })
- Layout(measureBlock = { _, chilConstraints ->
+ Layout(measureBlock = { _, chilConstraints, _ ->
secondChildConstraints.value = chilConstraints
layout(size, size) { }
}, children = { })
@@ -145,10 +145,10 @@
Layout(
children = {},
modifier = innerModifier
- ) { measurables, constraints2 ->
+ ) { measurables, constraints2, _ ->
layout(model.size, model.size) {}
}
- }, modifier = outerModifier) { measurables, constraints3 ->
+ }, modifier = outerModifier) { measurables, constraints3, _ ->
val placeable = measurables[0].measure(
Constraints.fixed(
model.size,
@@ -221,7 +221,7 @@
// wasn't possible to survide Frames swicth previously so the model read
// within the child Layout wasn't recorded
DrawVector(100.px, 100.px) { _, _ -> }
- Layout({}) { _, _ ->
+ Layout({}) { _, _, _ ->
// read the model
model.value
latch.countDown()
@@ -361,7 +361,7 @@
Layout(
{},
countdownLatchBackgroundModifier(Color.Yellow)
- ) { _, _ ->
+ ) { _, _, _ ->
// the same as the value inside ValueModel
val size = constraints.maxWidth
layout(size, size) {}
@@ -403,7 +403,7 @@
if (model) {
latch.countDown()
}
- }) { _, _ ->
+ }) { _, _, _ ->
if (!model) {
model = true
}
@@ -441,7 +441,7 @@
Layout(
children = {},
modifier = countdownLatchBackgroundModifier(Color.Yellow)
- ) { _, _ ->
+ ) { _, _, _ ->
layout(model.value, model.value) {}
}
}
@@ -482,7 +482,7 @@
assertTrue(lastLayoutValue)
drawlatch.countDown()
}
- Layout(children = {}, modifier = drawModifier) { _, _ ->
+ Layout(children = {}, modifier = drawModifier) { _, _, _ ->
lastLayoutValue = state.value
// this registers the value read
if (!state.value) {
@@ -514,7 +514,7 @@
WithConstraints {
assertEquals(1, innerComposeLatch.count)
innerComposeLatch.countDown()
- Layout(children = emptyContent()) { _, _ ->
+ Layout(children = emptyContent()) { _, _, _ ->
assertEquals(1, innerMeasureLatch.count)
innerMeasureLatch.countDown()
layout(100.ipx, 100.ipx) {
@@ -523,7 +523,7 @@
}
}
}
- }) { measurables, constraints ->
+ }) { measurables, constraints, _ ->
assertEquals(1, outerMeasureLatch.count)
outerMeasureLatch.countDown()
layout(100.ipx, 100.ipx) {
@@ -552,7 +552,7 @@
Layout(
children = {},
modifier = countdownLatchBackgroundModifier(Color.Transparent)
- ) { _, _ ->
+ ) { _, _, _ ->
// read and write once inside measureBlock
if (state.value == 0) {
state.value = 1
@@ -595,7 +595,7 @@
WithConstraints {
NeedsOtherMeasurementComposable(10.ipx)
}
- }) { measurables, constraints ->
+ }) { measurables, constraints, _ ->
val withConstraintsPlaceable = measurables[0].measure(constraints)
layout(30.ipx, 30.ipx) {
@@ -609,7 +609,7 @@
Layout(
children = {},
modifier = backgroundModifier(Color.Red)
- ) { _, _ ->
+ ) { _, _, _ ->
layout(foo, foo) { }
}
}
@@ -626,7 +626,7 @@
children = children,
modifier = modifier,
measureBlock = remember<MeasureBlock>(width, height) {
- { measurables, _ ->
+ { measurables, _, _ ->
val constraint = Constraints(maxWidth = width, maxHeight = height)
layout(width, height) {
measurables.forEach {
@@ -649,7 +649,7 @@
children: @Composable() () -> Unit
) {
Layout(children = children, measureBlock = remember<MeasureBlock>(width, height) {
- { measurables, _ ->
+ { measurables, _, _ ->
val constraint = Constraints(maxWidth = width, maxHeight = height)
val placeables = measurables.map { it.measure(constraint) }
layout(width, height) {
@@ -663,7 +663,7 @@
@Composable
private fun ChangingConstraintsLayout(size: ValueModel<IntPx>, children: @Composable() () -> Unit) {
- Layout(children) { measurables, _ ->
+ Layout(children) { measurables, _, _ ->
layout(100.ipx, 100.ipx) {
val constraints = Constraints.fixed(size.value, size.value)
measurables.first().measure(constraints).place(0.ipx, 0.ipx)
diff --git a/ui/ui-framework/src/androidTest/java/androidx/ui/semantics/SemanticsTests.kt b/ui/ui-framework/src/androidTest/java/androidx/ui/semantics/SemanticsTests.kt
index 2cd67f0..0f2f42d 100644
--- a/ui/ui-framework/src/androidTest/java/androidx/ui/semantics/SemanticsTests.kt
+++ b/ui/ui-framework/src/androidTest/java/androidx/ui/semantics/SemanticsTests.kt
@@ -388,7 +388,7 @@
*/
@Composable
private fun SimpleTestLayout(children: @Composable() () -> Unit) {
- Layout(children = children) { measurables, constraints ->
+ Layout(children = children) { measurables, constraints, _ ->
if (measurables.isEmpty()) {
layout(constraints.minWidth, constraints.minHeight) {}
} else {
diff --git a/ui/ui-framework/src/main/java/androidx/ui/core/AndroidViewCompat.kt b/ui/ui-framework/src/main/java/androidx/ui/core/AndroidViewCompat.kt
index 25f07d3..0d5d82e 100644
--- a/ui/ui-framework/src/main/java/androidx/ui/core/AndroidViewCompat.kt
+++ b/ui/ui-framework/src/main/java/androidx/ui/core/AndroidViewCompat.kt
@@ -39,6 +39,7 @@
* The component nodes will proxy the Compose core calls to the [View].
*/
private fun View.toComponentNode(): ComponentNode {
+ // TODO(soboleva): add layout direction here?
// TODO(popam): forward pointer input, accessibility, focus
// Prepare layout node that proxies measure and layout passes to the View.
val layoutNode = LayoutNode()
@@ -57,7 +58,8 @@
override fun measure(
measureScope: MeasureScope,
measurables: List<Measurable>,
- constraints: Constraints
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
): MeasureScope.LayoutResult {
if (constraints.minWidth != 0.ipx) {
minimumWidth = constraints.minWidth.value
@@ -65,6 +67,7 @@
if (constraints.minHeight != 0.ipx) {
minimumHeight = constraints.minHeight.value
}
+ // TODO (soboleva): native view should get LD value from Compose?
measure(
obtainMeasureSpec(constraints.minWidth, constraints.maxWidth, layoutParams.width),
obtainMeasureSpec(constraints.minHeight, constraints.maxHeight, layoutParams.height)
diff --git a/ui/ui-framework/src/main/java/androidx/ui/core/Layout.kt b/ui/ui-framework/src/main/java/androidx/ui/core/Layout.kt
index 6a647ac..be945ab 100644
--- a/ui/ui-framework/src/main/java/androidx/ui/core/Layout.kt
+++ b/ui/ui-framework/src/main/java/androidx/ui/core/Layout.kt
@@ -84,28 +84,33 @@
override fun measure(
measureScope: MeasureScope,
measurables: List<Measurable>,
- constraints: Constraints
- ) = measureScope.measureBlock(measurables, constraints)
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
+ ) = measureScope.measureBlock(measurables, constraints, layoutDirection)
override fun minIntrinsicWidth(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- h: IntPx
- ) = modifierScope.minIntrinsicWidthMeasureBlock(measurables, h)
+ h: IntPx,
+ layoutDirection: LayoutDirection
+ ) = density.minIntrinsicWidthMeasureBlock(measurables, h, layoutDirection)
override fun minIntrinsicHeight(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- w: IntPx
- ) = modifierScope.minIntrinsicHeightMeasureBlock(measurables, w)
+ w: IntPx,
+ layoutDirection: LayoutDirection
+ ) = density.minIntrinsicHeightMeasureBlock(measurables, w, layoutDirection)
override fun maxIntrinsicWidth(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- h: IntPx
- ) = modifierScope.maxIntrinsicWidthMeasureBlock(measurables, h)
+ h: IntPx,
+ layoutDirection: LayoutDirection
+ ) = density.maxIntrinsicWidthMeasureBlock(measurables, h, layoutDirection)
override fun maxIntrinsicHeight(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- w: IntPx
- ) = modifierScope.maxIntrinsicHeightMeasureBlock(measurables, w)
+ w: IntPx,
+ layoutDirection: LayoutDirection
+ ) = density.maxIntrinsicHeightMeasureBlock(measurables, w, layoutDirection)
}
Layout(children, measureBlocks, modifier)
}
@@ -151,12 +156,7 @@
measureBlocks: LayoutNode.MeasureBlocks,
modifier: Modifier
) {
- val layoutDirection = LayoutDirectionAmbient.current
- LayoutNode(
- modifier = modifier,
- measureBlocks = measureBlocks,
- ambientLayoutDirection = layoutDirection
- ) {
+ LayoutNode(modifier = modifier, measureBlocks = measureBlocks) {
children()
}
}
@@ -254,28 +254,33 @@
override fun measure(
measureScope: MeasureScope,
measurables: List<Measurable>,
- constraints: Constraints
- ) = measureScope.measureBlock(measurables, constraints)
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
+ ) = measureScope.measureBlock(measurables, constraints, layoutDirection)
override fun minIntrinsicWidth(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- h: IntPx
- ) = modifierScope.MeasuringMinIntrinsicWidth(measureBlock, measurables, h)
+ h: IntPx,
+ layoutDirection: LayoutDirection
+ ) = density.MeasuringMinIntrinsicWidth(measureBlock, measurables, h, layoutDirection)
override fun minIntrinsicHeight(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- w: IntPx
- ) = modifierScope.MeasuringMinIntrinsicHeight(measureBlock, measurables, w)
+ w: IntPx,
+ layoutDirection: LayoutDirection
+ ) = density.MeasuringMinIntrinsicHeight(measureBlock, measurables, w, layoutDirection)
override fun maxIntrinsicWidth(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- h: IntPx
- ) = modifierScope.MeasuringMaxIntrinsicWidth(measureBlock, measurables, h)
+ h: IntPx,
+ layoutDirection: LayoutDirection
+ ) = density.MeasuringMaxIntrinsicWidth(measureBlock, measurables, h, layoutDirection)
override fun maxIntrinsicHeight(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- w: IntPx
- ) = modifierScope.MeasuringMaxIntrinsicHeight(measureBlock, measurables, w)
+ w: IntPx,
+ layoutDirection: LayoutDirection
+ ) = density.MeasuringMaxIntrinsicHeight(measureBlock, measurables, w, layoutDirection)
override fun toString(): String {
// this calls simpleIdentityToString on measureBlock because it is typically a lambda,
@@ -294,14 +299,15 @@
private inline fun Density.MeasuringMinIntrinsicWidth(
measureBlock: MeasureBlock,
measurables: List<IntrinsicMeasurable>,
- h: IntPx
+ h: IntPx,
+ layoutDirection: LayoutDirection
): IntPx {
val mapped = measurables.map {
DefaultIntrinsicMeasurable(it, IntrinsicMinMax.Min, IntrinsicWidthHeight.Width)
}
val constraints = Constraints(maxHeight = h)
val layoutReceiver = IntrinsicsMeasureScope(this)
- val layoutResult = layoutReceiver.measureBlock(mapped, constraints)
+ val layoutResult = layoutReceiver.measureBlock(mapped, constraints, layoutDirection)
return layoutResult.width
}
@@ -312,14 +318,15 @@
private inline fun Density.MeasuringMinIntrinsicHeight(
measureBlock: MeasureBlock,
measurables: List<IntrinsicMeasurable>,
- w: IntPx
+ w: IntPx,
+ layoutDirection: LayoutDirection
): IntPx {
val mapped = measurables.map {
DefaultIntrinsicMeasurable(it, IntrinsicMinMax.Min, IntrinsicWidthHeight.Height)
}
val constraints = Constraints(maxWidth = w)
val layoutReceiver = IntrinsicsMeasureScope(this)
- val layoutResult = layoutReceiver.measureBlock(mapped, constraints)
+ val layoutResult = layoutReceiver.measureBlock(mapped, constraints, layoutDirection)
return layoutResult.height
}
@@ -330,14 +337,15 @@
private inline fun Density.MeasuringMaxIntrinsicWidth(
measureBlock: MeasureBlock,
measurables: List<IntrinsicMeasurable>,
- h: IntPx
+ h: IntPx,
+ layoutDirection: LayoutDirection
): IntPx {
val mapped = measurables.map {
DefaultIntrinsicMeasurable(it, IntrinsicMinMax.Max, IntrinsicWidthHeight.Width)
}
val constraints = Constraints(maxHeight = h)
val layoutReceiver = IntrinsicsMeasureScope(this)
- val layoutResult = layoutReceiver.measureBlock(mapped, constraints)
+ val layoutResult = layoutReceiver.measureBlock(mapped, constraints, layoutDirection)
return layoutResult.width
}
@@ -348,14 +356,15 @@
private inline fun Density.MeasuringMaxIntrinsicHeight(
measureBlock: MeasureBlock,
measurables: List<IntrinsicMeasurable>,
- w: IntPx
+ w: IntPx,
+ layoutDirection: LayoutDirection
): IntPx {
val mapped = measurables.map {
DefaultIntrinsicMeasurable(it, IntrinsicMinMax.Max, IntrinsicWidthHeight.Height)
}
val constraints = Constraints(maxWidth = w)
val layoutReceiver = IntrinsicsMeasureScope(this)
- val layoutResult = layoutReceiver.measureBlock(mapped, constraints)
+ val layoutResult = layoutReceiver.measureBlock(mapped, constraints, layoutDirection)
return layoutResult.height
}
@@ -395,7 +404,11 @@
}
typealias MultiMeasureBlock =
- MeasureScope.(MultiComposableMeasurables, Constraints) -> MeasureScope.LayoutResult
+ MeasureScope.(
+ MultiComposableMeasurables,
+ Constraints,
+ LayoutDirection
+ ) -> MeasureScope.LayoutResult
/**
* Temporary component that allows composing and indexing measurables of multiple composables.
@@ -420,10 +433,11 @@
}
}
- Layout(children, modifier) { _, constraints ->
+ Layout(children, modifier) { _, constraints, layoutDirection ->
measureBlock(
MultiComposableMeasurables((this as LayoutNode.InnerMeasureScope).layoutNode),
- constraints
+ constraints,
+ layoutDirection
)
}
}
@@ -479,7 +493,8 @@
override fun measure(
measureScope: MeasureScope,
measurables: List<Measurable>,
- constraints: Constraints
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
): MeasureScope.LayoutResult {
val root = nodeRef.value!!
if (lastConstraints != constraints || forceRecompose) {
diff --git a/ui/ui-framework/src/main/java/androidx/ui/core/PainterModifier.kt b/ui/ui-framework/src/main/java/androidx/ui/core/PainterModifier.kt
index 1ba8b10..37628e9 100644
--- a/ui/ui-framework/src/main/java/androidx/ui/core/PainterModifier.kt
+++ b/ui/ui-framework/src/main/java/androidx/ui/core/PainterModifier.kt
@@ -89,7 +89,10 @@
var rtl: Boolean = false
) : LayoutModifier, DrawModifier {
- override fun ModifierScope.modifyConstraints(constraints: Constraints): Constraints {
+ override fun Density.modifyConstraints(
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
+ ): Constraints {
val intrinsicSize = painter.intrinsicSize
val intrinsicWidth =
intrinsicSize.width.takeUnless {
@@ -110,9 +113,14 @@
}
}
- override fun ModifierScope.minIntrinsicWidthOf(measurable: Measurable, height: IntPx): IntPx {
+ override fun Density.minIntrinsicWidthOf(
+ measurable: Measurable,
+ height: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx {
val constraints = Constraints(maxHeight = height)
- val layoutWidth = measurable.minIntrinsicWidth(modifyConstraints(constraints).maxHeight)
+ val layoutWidth =
+ measurable.minIntrinsicWidth(modifyConstraints(constraints, layoutDirection).maxHeight)
val painterIntrinsicWidth =
painter.intrinsicSize.width.takeUnless {
!sizeToIntrinsics || it == Px.Infinity
@@ -120,9 +128,14 @@
return max(painterIntrinsicWidth, layoutWidth)
}
- override fun ModifierScope.maxIntrinsicWidthOf(measurable: Measurable, height: IntPx): IntPx {
+ override fun Density.maxIntrinsicWidthOf(
+ measurable: Measurable,
+ height: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx {
val constraints = Constraints(maxHeight = height)
- val layoutWidth = measurable.maxIntrinsicWidth(modifyConstraints(constraints).maxHeight)
+ val layoutWidth =
+ measurable.maxIntrinsicWidth(modifyConstraints(constraints, layoutDirection).maxHeight)
val painterIntrinsicWidth =
painter.intrinsicSize.width.takeUnless {
!sizeToIntrinsics || it == Px.Infinity
@@ -130,9 +143,14 @@
return max(painterIntrinsicWidth, layoutWidth)
}
- override fun ModifierScope.minIntrinsicHeightOf(measurable: Measurable, width: IntPx): IntPx {
+ override fun Density.minIntrinsicHeightOf(
+ measurable: Measurable,
+ width: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx {
val constraints = Constraints(maxWidth = width)
- val layoutHeight = measurable.minIntrinsicHeight(modifyConstraints(constraints).maxWidth)
+ val layoutHeight =
+ measurable.minIntrinsicHeight(modifyConstraints(constraints, layoutDirection).maxWidth)
val painterIntrinsicHeight =
painter.intrinsicSize.height.takeUnless {
!sizeToIntrinsics || it == Px.Infinity
@@ -140,9 +158,14 @@
return max(painterIntrinsicHeight, layoutHeight)
}
- override fun ModifierScope.maxIntrinsicHeightOf(measurable: Measurable, width: IntPx): IntPx {
+ override fun Density.maxIntrinsicHeightOf(
+ measurable: Measurable,
+ width: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx {
val constraints = Constraints(maxWidth = width)
- val layoutHeight = measurable.maxIntrinsicHeight(modifyConstraints(constraints).maxWidth)
+ val layoutHeight =
+ measurable.maxIntrinsicHeight(modifyConstraints(constraints, layoutDirection).maxWidth)
val painterIntrinsicHeight =
painter.intrinsicSize.height.takeUnless {
!sizeToIntrinsics || it == Px.Infinity
diff --git a/ui/ui-framework/src/main/java/androidx/ui/core/Text.kt b/ui/ui-framework/src/main/java/androidx/ui/core/Text.kt
index 634c9a6..a2c5b69 100644
--- a/ui/ui-framework/src/main/java/androidx/ui/core/Text.kt
+++ b/ui/ui-framework/src/main/java/androidx/ui/core/Text.kt
@@ -195,24 +195,24 @@
Layout(
children = children,
modifier = modifier + textDrawModifier,
- minIntrinsicWidthMeasureBlock = { _, _ ->
+ minIntrinsicWidthMeasureBlock = { _, _, _ ->
state.textDelegate.layoutIntrinsics()
state.textDelegate.minIntrinsicWidth
},
- minIntrinsicHeightMeasureBlock = { _, width ->
+ minIntrinsicHeightMeasureBlock = { _, width, _ ->
// given the width constraint, determine the min height
state.textDelegate
.layout(Constraints(0.ipx, width, 0.ipx, IntPx.Infinity)).size.height
},
- maxIntrinsicWidthMeasureBlock = { _, _ ->
+ maxIntrinsicWidthMeasureBlock = { _, _, _ ->
state.textDelegate.layoutIntrinsics()
state.textDelegate.maxIntrinsicWidth
},
- maxIntrinsicHeightMeasureBlock = { _, width ->
+ maxIntrinsicHeightMeasureBlock = { _, width, _ ->
state.textDelegate
.layout(Constraints(0.ipx, width, 0.ipx, IntPx.Infinity)).size.height
}
- ) { _, constraints ->
+ ) { _, constraints, _ ->
val layoutResult = state.textDelegate.layout(constraints, state.layoutResult)
if (state.layoutResult != layoutResult) {
onTextLayout(layoutResult)
diff --git a/ui/ui-framework/src/main/java/androidx/ui/core/TextField.kt b/ui/ui-framework/src/main/java/androidx/ui/core/TextField.kt
index 50a7be6..8422f4a 100644
--- a/ui/ui-framework/src/main/java/androidx/ui/core/TextField.kt
+++ b/ui/ui-framework/src/main/java/androidx/ui/core/TextField.kt
@@ -460,7 +460,7 @@
}
}
},
- measureBlock = { _, constraints ->
+ measureBlock = { _, constraints, _ ->
TextFieldDelegate.layout(
state.textDelegate,
constraints,
diff --git a/ui/ui-framework/src/main/java/androidx/ui/core/selection/SelectionContainer.kt b/ui/ui-framework/src/main/java/androidx/ui/core/selection/SelectionContainer.kt
index 3c9f523..a9d36e7 100644
--- a/ui/ui-framework/src/main/java/androidx/ui/core/selection/SelectionContainer.kt
+++ b/ui/ui-framework/src/main/java/androidx/ui/core/selection/SelectionContainer.kt
@@ -165,7 +165,7 @@
*/
@Composable
private fun Wrap(children: @Composable() () -> Unit) {
- Layout(children) { measurables, constraints ->
+ Layout(children) { measurables, constraints, _ ->
val placeables = measurables.map { measurable ->
measurable.measure(constraints)
}
@@ -195,7 +195,7 @@
height: Dp? = null,
children: @Composable() () -> Unit
) {
- Layout(children) { measurables, incomingConstraints ->
+ Layout(children) { measurables, incomingConstraints, _ ->
val containerConstraints = Constraints()
.copy(
width?.toIntPx() ?: 0.ipx,
diff --git a/ui/ui-framework/src/main/java/androidx/ui/core/selection/SelectionHandles.kt b/ui/ui-framework/src/main/java/androidx/ui/core/selection/SelectionHandles.kt
index 1895d61d..8dc392a 100644
--- a/ui/ui-framework/src/main/java/androidx/ui/core/selection/SelectionHandles.kt
+++ b/ui/ui-framework/src/main/java/androidx/ui/core/selection/SelectionHandles.kt
@@ -82,7 +82,7 @@
onCanvas: Density.(Canvas, PxSize) -> Unit
) {
val modifier = draw(onCanvas)
- Layout({}, modifier) { _, _ ->
+ Layout({}, modifier) { _, _, _ ->
// take width and height space of the screen and allow draw modifier to draw inside of it
layout(width.toIntPx(), height.toIntPx()) {
// this layout has no children, only draw modifier.
diff --git a/ui/ui-layout/api/0.1.0-dev06.txt b/ui/ui-layout/api/0.1.0-dev06.txt
index 67f4cb0..d26219b 100644
--- a/ui/ui-layout/api/0.1.0-dev06.txt
+++ b/ui/ui-layout/api/0.1.0-dev06.txt
@@ -209,11 +209,19 @@
method public float component1();
method public androidx.ui.layout.LayoutAspectRatio copy(float aspectRatio);
method public float getAspectRatio();
- method public androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ }
+
+ public final class LayoutDirectionModifier {
+ method public androidx.ui.core.LayoutModifier getLtr();
+ method public androidx.ui.core.LayoutModifier getRtl();
+ property public final androidx.ui.core.LayoutModifier Ltr;
+ property public final androidx.ui.core.LayoutModifier Rtl;
+ field public static final androidx.ui.layout.LayoutDirectionModifier! INSTANCE;
}
public final class LayoutGravity {
@@ -227,10 +235,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -244,16 +252,16 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxHeight();
method public androidx.ui.unit.Dp getMinHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
public static final class LayoutHeight.Fill implements androidx.ui.core.LayoutModifier {
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
field public static final androidx.ui.layout.LayoutHeight.Fill! INSTANCE;
}
@@ -264,10 +272,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -279,10 +287,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMinHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -299,9 +307,9 @@
method public androidx.ui.unit.Dp getEnd();
method public androidx.ui.unit.Dp getStart();
method public androidx.ui.unit.Dp getTop();
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
}
@kotlin.DslMarker public @interface LayoutScopeMarker {
@@ -317,10 +325,10 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getHeight();
method public androidx.ui.unit.Dp getWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -339,16 +347,16 @@
method public androidx.ui.unit.Dp getMaxWidth();
method public androidx.ui.unit.Dp getMinHeight();
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
public static final class LayoutSize.Fill implements androidx.ui.core.LayoutModifier {
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
field public static final androidx.ui.layout.LayoutSize.Fill! INSTANCE;
}
@@ -362,10 +370,10 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxHeight();
method public androidx.ui.unit.Dp getMaxWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -380,10 +388,10 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMinHeight();
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -395,10 +403,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -412,16 +420,16 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxWidth();
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
public static final class LayoutWidth.Fill implements androidx.ui.core.LayoutModifier {
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
field public static final androidx.ui.layout.LayoutWidth.Fill! INSTANCE;
}
@@ -432,10 +440,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -447,10 +455,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
diff --git a/ui/ui-layout/api/api_lint.ignore b/ui/ui-layout/api/api_lint.ignore
index f4de926..d7bb8be 100644
--- a/ui/ui-layout/api/api_lint.ignore
+++ b/ui/ui-layout/api/api_lint.ignore
@@ -1,5 +1,3 @@
// Baseline format: 1.0
-DocumentExceptions: androidx.ui.layout.FlexChildren#expanded(float, kotlin.jvm.functions.Function0<kotlin.Unit>):
- Method FlexChildren.expanded appears to be throwing java.lang.IllegalArgumentException; this should be listed in the documentation; see https://android.github.io/kotlin-guides/interop.html#document-exceptions
-DocumentExceptions: androidx.ui.layout.FlexChildren#flexible(float, kotlin.jvm.functions.Function0<kotlin.Unit>):
- Method FlexChildren.flexible appears to be throwing java.lang.IllegalArgumentException; this should be listed in the documentation; see https://android.github.io/kotlin-guides/interop.html#document-exceptions
+HiddenTypeParameter: androidx.ui.layout.Arrangement#Companion:
+ Field Arrangement.Companion references hidden type androidx.ui.layout.Arrangement.Companion.
diff --git a/ui/ui-layout/api/current.txt b/ui/ui-layout/api/current.txt
index 67f4cb0..d26219b 100644
--- a/ui/ui-layout/api/current.txt
+++ b/ui/ui-layout/api/current.txt
@@ -209,11 +209,19 @@
method public float component1();
method public androidx.ui.layout.LayoutAspectRatio copy(float aspectRatio);
method public float getAspectRatio();
- method public androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ }
+
+ public final class LayoutDirectionModifier {
+ method public androidx.ui.core.LayoutModifier getLtr();
+ method public androidx.ui.core.LayoutModifier getRtl();
+ property public final androidx.ui.core.LayoutModifier Ltr;
+ property public final androidx.ui.core.LayoutModifier Rtl;
+ field public static final androidx.ui.layout.LayoutDirectionModifier! INSTANCE;
}
public final class LayoutGravity {
@@ -227,10 +235,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -244,16 +252,16 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxHeight();
method public androidx.ui.unit.Dp getMinHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
public static final class LayoutHeight.Fill implements androidx.ui.core.LayoutModifier {
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
field public static final androidx.ui.layout.LayoutHeight.Fill! INSTANCE;
}
@@ -264,10 +272,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -279,10 +287,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMinHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -299,9 +307,9 @@
method public androidx.ui.unit.Dp getEnd();
method public androidx.ui.unit.Dp getStart();
method public androidx.ui.unit.Dp getTop();
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
}
@kotlin.DslMarker public @interface LayoutScopeMarker {
@@ -317,10 +325,10 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getHeight();
method public androidx.ui.unit.Dp getWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -339,16 +347,16 @@
method public androidx.ui.unit.Dp getMaxWidth();
method public androidx.ui.unit.Dp getMinHeight();
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
public static final class LayoutSize.Fill implements androidx.ui.core.LayoutModifier {
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
field public static final androidx.ui.layout.LayoutSize.Fill! INSTANCE;
}
@@ -362,10 +370,10 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxHeight();
method public androidx.ui.unit.Dp getMaxWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -380,10 +388,10 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMinHeight();
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -395,10 +403,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -412,16 +420,16 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxWidth();
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
public static final class LayoutWidth.Fill implements androidx.ui.core.LayoutModifier {
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
field public static final androidx.ui.layout.LayoutWidth.Fill! INSTANCE;
}
@@ -432,10 +440,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -447,10 +455,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
diff --git a/ui/ui-layout/api/public_plus_experimental_0.1.0-dev06.txt b/ui/ui-layout/api/public_plus_experimental_0.1.0-dev06.txt
index 67f4cb0..d26219b 100644
--- a/ui/ui-layout/api/public_plus_experimental_0.1.0-dev06.txt
+++ b/ui/ui-layout/api/public_plus_experimental_0.1.0-dev06.txt
@@ -209,11 +209,19 @@
method public float component1();
method public androidx.ui.layout.LayoutAspectRatio copy(float aspectRatio);
method public float getAspectRatio();
- method public androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ }
+
+ public final class LayoutDirectionModifier {
+ method public androidx.ui.core.LayoutModifier getLtr();
+ method public androidx.ui.core.LayoutModifier getRtl();
+ property public final androidx.ui.core.LayoutModifier Ltr;
+ property public final androidx.ui.core.LayoutModifier Rtl;
+ field public static final androidx.ui.layout.LayoutDirectionModifier! INSTANCE;
}
public final class LayoutGravity {
@@ -227,10 +235,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -244,16 +252,16 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxHeight();
method public androidx.ui.unit.Dp getMinHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
public static final class LayoutHeight.Fill implements androidx.ui.core.LayoutModifier {
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
field public static final androidx.ui.layout.LayoutHeight.Fill! INSTANCE;
}
@@ -264,10 +272,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -279,10 +287,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMinHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -299,9 +307,9 @@
method public androidx.ui.unit.Dp getEnd();
method public androidx.ui.unit.Dp getStart();
method public androidx.ui.unit.Dp getTop();
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
}
@kotlin.DslMarker public @interface LayoutScopeMarker {
@@ -317,10 +325,10 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getHeight();
method public androidx.ui.unit.Dp getWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -339,16 +347,16 @@
method public androidx.ui.unit.Dp getMaxWidth();
method public androidx.ui.unit.Dp getMinHeight();
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
public static final class LayoutSize.Fill implements androidx.ui.core.LayoutModifier {
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
field public static final androidx.ui.layout.LayoutSize.Fill! INSTANCE;
}
@@ -362,10 +370,10 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxHeight();
method public androidx.ui.unit.Dp getMaxWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -380,10 +388,10 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMinHeight();
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -395,10 +403,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -412,16 +420,16 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxWidth();
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
public static final class LayoutWidth.Fill implements androidx.ui.core.LayoutModifier {
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
field public static final androidx.ui.layout.LayoutWidth.Fill! INSTANCE;
}
@@ -432,10 +440,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -447,10 +455,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
diff --git a/ui/ui-layout/api/public_plus_experimental_current.txt b/ui/ui-layout/api/public_plus_experimental_current.txt
index 67f4cb0..d26219b 100644
--- a/ui/ui-layout/api/public_plus_experimental_current.txt
+++ b/ui/ui-layout/api/public_plus_experimental_current.txt
@@ -209,11 +209,19 @@
method public float component1();
method public androidx.ui.layout.LayoutAspectRatio copy(float aspectRatio);
method public float getAspectRatio();
- method public androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ }
+
+ public final class LayoutDirectionModifier {
+ method public androidx.ui.core.LayoutModifier getLtr();
+ method public androidx.ui.core.LayoutModifier getRtl();
+ property public final androidx.ui.core.LayoutModifier Ltr;
+ property public final androidx.ui.core.LayoutModifier Rtl;
+ field public static final androidx.ui.layout.LayoutDirectionModifier! INSTANCE;
}
public final class LayoutGravity {
@@ -227,10 +235,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -244,16 +252,16 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxHeight();
method public androidx.ui.unit.Dp getMinHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
public static final class LayoutHeight.Fill implements androidx.ui.core.LayoutModifier {
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
field public static final androidx.ui.layout.LayoutHeight.Fill! INSTANCE;
}
@@ -264,10 +272,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -279,10 +287,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMinHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -299,9 +307,9 @@
method public androidx.ui.unit.Dp getEnd();
method public androidx.ui.unit.Dp getStart();
method public androidx.ui.unit.Dp getTop();
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
}
@kotlin.DslMarker public @interface LayoutScopeMarker {
@@ -317,10 +325,10 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getHeight();
method public androidx.ui.unit.Dp getWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -339,16 +347,16 @@
method public androidx.ui.unit.Dp getMaxWidth();
method public androidx.ui.unit.Dp getMinHeight();
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
public static final class LayoutSize.Fill implements androidx.ui.core.LayoutModifier {
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
field public static final androidx.ui.layout.LayoutSize.Fill! INSTANCE;
}
@@ -362,10 +370,10 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxHeight();
method public androidx.ui.unit.Dp getMaxWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -380,10 +388,10 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMinHeight();
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -395,10 +403,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -412,16 +420,16 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxWidth();
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
public static final class LayoutWidth.Fill implements androidx.ui.core.LayoutModifier {
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
field public static final androidx.ui.layout.LayoutWidth.Fill! INSTANCE;
}
@@ -432,10 +440,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -447,10 +455,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
diff --git a/ui/ui-layout/api/restricted_0.1.0-dev06.txt b/ui/ui-layout/api/restricted_0.1.0-dev06.txt
index 67f4cb0..d26219b 100644
--- a/ui/ui-layout/api/restricted_0.1.0-dev06.txt
+++ b/ui/ui-layout/api/restricted_0.1.0-dev06.txt
@@ -209,11 +209,19 @@
method public float component1();
method public androidx.ui.layout.LayoutAspectRatio copy(float aspectRatio);
method public float getAspectRatio();
- method public androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ }
+
+ public final class LayoutDirectionModifier {
+ method public androidx.ui.core.LayoutModifier getLtr();
+ method public androidx.ui.core.LayoutModifier getRtl();
+ property public final androidx.ui.core.LayoutModifier Ltr;
+ property public final androidx.ui.core.LayoutModifier Rtl;
+ field public static final androidx.ui.layout.LayoutDirectionModifier! INSTANCE;
}
public final class LayoutGravity {
@@ -227,10 +235,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -244,16 +252,16 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxHeight();
method public androidx.ui.unit.Dp getMinHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
public static final class LayoutHeight.Fill implements androidx.ui.core.LayoutModifier {
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
field public static final androidx.ui.layout.LayoutHeight.Fill! INSTANCE;
}
@@ -264,10 +272,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -279,10 +287,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMinHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -299,9 +307,9 @@
method public androidx.ui.unit.Dp getEnd();
method public androidx.ui.unit.Dp getStart();
method public androidx.ui.unit.Dp getTop();
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
}
@kotlin.DslMarker public @interface LayoutScopeMarker {
@@ -317,10 +325,10 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getHeight();
method public androidx.ui.unit.Dp getWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -339,16 +347,16 @@
method public androidx.ui.unit.Dp getMaxWidth();
method public androidx.ui.unit.Dp getMinHeight();
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
public static final class LayoutSize.Fill implements androidx.ui.core.LayoutModifier {
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
field public static final androidx.ui.layout.LayoutSize.Fill! INSTANCE;
}
@@ -362,10 +370,10 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxHeight();
method public androidx.ui.unit.Dp getMaxWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -380,10 +388,10 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMinHeight();
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -395,10 +403,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -412,16 +420,16 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxWidth();
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
public static final class LayoutWidth.Fill implements androidx.ui.core.LayoutModifier {
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
field public static final androidx.ui.layout.LayoutWidth.Fill! INSTANCE;
}
@@ -432,10 +440,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -447,10 +455,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
diff --git a/ui/ui-layout/api/restricted_current.txt b/ui/ui-layout/api/restricted_current.txt
index 67f4cb0..d26219b 100644
--- a/ui/ui-layout/api/restricted_current.txt
+++ b/ui/ui-layout/api/restricted_current.txt
@@ -209,11 +209,19 @@
method public float component1();
method public androidx.ui.layout.LayoutAspectRatio copy(float aspectRatio);
method public float getAspectRatio();
- method public androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width);
- method public androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.core.ModifierScope, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height);
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.unit.IntPx maxIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx maxIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicHeightOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx width, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicWidthOf(androidx.ui.unit.Density, androidx.ui.core.Measurable measurable, androidx.ui.unit.IntPx height, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ }
+
+ public final class LayoutDirectionModifier {
+ method public androidx.ui.core.LayoutModifier getLtr();
+ method public androidx.ui.core.LayoutModifier getRtl();
+ property public final androidx.ui.core.LayoutModifier Ltr;
+ property public final androidx.ui.core.LayoutModifier Rtl;
+ field public static final androidx.ui.layout.LayoutDirectionModifier! INSTANCE;
}
public final class LayoutGravity {
@@ -227,10 +235,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -244,16 +252,16 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxHeight();
method public androidx.ui.unit.Dp getMinHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
public static final class LayoutHeight.Fill implements androidx.ui.core.LayoutModifier {
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
field public static final androidx.ui.layout.LayoutHeight.Fill! INSTANCE;
}
@@ -264,10 +272,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -279,10 +287,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMinHeight();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -299,9 +307,9 @@
method public androidx.ui.unit.Dp getEnd();
method public androidx.ui.unit.Dp getStart();
method public androidx.ui.unit.Dp getTop();
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
}
@kotlin.DslMarker public @interface LayoutScopeMarker {
@@ -317,10 +325,10 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getHeight();
method public androidx.ui.unit.Dp getWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -339,16 +347,16 @@
method public androidx.ui.unit.Dp getMaxWidth();
method public androidx.ui.unit.Dp getMinHeight();
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
public static final class LayoutSize.Fill implements androidx.ui.core.LayoutModifier {
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
field public static final androidx.ui.layout.LayoutSize.Fill! INSTANCE;
}
@@ -362,10 +370,10 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxHeight();
method public androidx.ui.unit.Dp getMaxWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -380,10 +388,10 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMinHeight();
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -395,10 +403,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -412,16 +420,16 @@
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxWidth();
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
public static final class LayoutWidth.Fill implements androidx.ui.core.LayoutModifier {
- method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.core.Constraints modifyConstraints(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
field public static final androidx.ui.layout.LayoutWidth.Fill! INSTANCE;
}
@@ -432,10 +440,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMaxWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
@@ -447,10 +455,10 @@
method public <R> R! foldIn(R! initial, kotlin.jvm.functions.Function2<? super R,? super androidx.ui.core.Modifier.Element,? extends R> operation);
method public <R> R! foldOut(R! initial, kotlin.jvm.functions.Function2<? super androidx.ui.core.Modifier.Element,? super R,? extends R> operation);
method public androidx.ui.unit.Dp getMinWidth();
- method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.core.ModifierScope, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value);
- method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.core.ModifierScope);
- method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.core.ModifierScope, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize);
- method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.core.ModifierScope, androidx.ui.core.Constraints constraints, androidx.ui.unit.IntPxSize childSize);
+ method public androidx.ui.unit.IntPx? modifyAlignmentLine(androidx.ui.unit.Density, androidx.ui.core.AlignmentLine line, androidx.ui.unit.IntPx? value, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.LayoutDirection modifyLayoutDirection(androidx.ui.unit.Density, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxPosition modifyPosition(androidx.ui.unit.Density, androidx.ui.unit.IntPxSize childSize, androidx.ui.unit.IntPxSize containerSize, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPxSize modifySize(androidx.ui.unit.Density, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.unit.IntPxSize childSize);
method public androidx.ui.core.Modifier plus(androidx.ui.core.Modifier other);
method @Deprecated public androidx.ui.core.Modifier wraps(androidx.ui.core.Modifier other);
}
diff --git a/ui/ui-layout/integration-tests/layout-demos/src/main/java/androidx/ui/layout/demos/RtlDemos.kt b/ui/ui-layout/integration-tests/layout-demos/src/main/java/androidx/ui/layout/demos/RtlDemos.kt
index b8cdf35..d6fbaea 100644
--- a/ui/ui-layout/integration-tests/layout-demos/src/main/java/androidx/ui/layout/demos/RtlDemos.kt
+++ b/ui/ui-layout/integration-tests/layout-demos/src/main/java/androidx/ui/layout/demos/RtlDemos.kt
@@ -19,9 +19,6 @@
import android.app.Activity
import android.os.Bundle
import androidx.compose.Composable
-import androidx.compose.Providers
-import androidx.ui.core.LayoutDirection
-import androidx.ui.core.LayoutDirectionAmbient
import androidx.ui.core.Text
import androidx.ui.core.setContent
import androidx.ui.graphics.Color
@@ -33,6 +30,7 @@
import androidx.ui.layout.LayoutWidth
import androidx.ui.layout.Stack
import androidx.ui.foundation.DrawBackground
+import androidx.ui.layout.LayoutDirectionModifier
import androidx.ui.unit.dp
class RtlDemosActivity : Activity() {
@@ -44,8 +42,8 @@
testText()
Text("ROW", LayoutGravity.Center)
testRow()
- Text("ROW WITH AMBIENT", LayoutGravity.Center)
- testRow_ambient()
+ Text("ROW WITH MODIFIER", LayoutGravity.Center)
+ testRow_modifier()
Text("RELATIVE TO SIBLINGS", LayoutGravity.Center)
testSiblings()
}
@@ -71,16 +69,14 @@
}
@Composable
-fun testRow_ambient() {
+fun testRow_modifier() {
Row {
Stack(boxSize + DrawBackground(Color.Red)) {}
Stack(boxSize + DrawBackground(Color.Green)) {}
- Providers(LayoutDirectionAmbient provides LayoutDirection.Ltr) {
- Row {
- Stack(boxSize + DrawBackground(Color.Magenta)) {}
- Stack(boxSize + DrawBackground(Color.Yellow)) {}
- Stack(boxSize + DrawBackground(Color.Cyan)) {}
- }
+ Row(LayoutDirectionModifier.Ltr) {
+ Stack(boxSize + DrawBackground(Color.Magenta)) {}
+ Stack(boxSize + DrawBackground(Color.Yellow)) {}
+ Stack(boxSize + DrawBackground(Color.Cyan)) {}
}
Stack(boxSize + DrawBackground(Color.Blue)) {}
}
diff --git a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/LayoutSample.kt b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/LayoutSample.kt
index 3f997ae..cd79517 100644
--- a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/LayoutSample.kt
+++ b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/LayoutSample.kt
@@ -38,7 +38,10 @@
width: Dp? = null,
height: Dp? = null
) {
- Layout(children = { }, modifier = modifier + DrawBackground(color = color)) { _, constraints ->
+ Layout(
+ children = { },
+ modifier = modifier + DrawBackground(color = color)
+ ) { _, constraints, _ ->
val widthPx = max(width?.toIntPx() ?: constraints.maxWidth, constraints.minWidth)
val heightPx = max(height?.toIntPx() ?: constraints.maxHeight, constraints.minHeight)
layout(widthPx, heightPx, mapOf(Start to 0.ipx, End to widthPx)) {}
diff --git a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/AlignTest.kt b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/AlignTest.kt
index 29435f0..e24e066 100644
--- a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/AlignTest.kt
+++ b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/AlignTest.kt
@@ -211,7 +211,7 @@
}
}
},
- measureBlock = { measurables, constraints ->
+ measureBlock = { measurables, constraints, _ ->
val placeable = measurables.first().measure(Constraints())
layout(constraints.maxWidth, constraints.maxHeight) {
placeable.place(0.ipx, 0.ipx)
@@ -260,7 +260,7 @@
}
}
},
- measureBlock = { measurables, constraints ->
+ measureBlock = { measurables, constraints, _ ->
val placeable = measurables.first().measure(Constraints())
layout(constraints.maxWidth, constraints.maxHeight) {
placeable.place(0.ipx, 0.ipx)
@@ -306,7 +306,7 @@
)
}
},
- measureBlock = { measurables, incomingConstraints ->
+ measureBlock = { measurables, incomingConstraints, _ ->
val measurable = measurables.first()
val constraints = Constraints(
minWidth = doubleSizeDp.toIntPx(),
@@ -490,7 +490,7 @@
}
}
}
- }, measureBlock = { measurables, constraints ->
+ }, measureBlock = { measurables, constraints, _ ->
val placeable = measurables.first().measure(Constraints())
layout(constraints.maxWidth, constraints.maxHeight) {
placeable.place(0.ipx, 0.ipx)
@@ -548,7 +548,7 @@
)
}
}
- }, measureBlock = { measurables, constraints ->
+ }, measureBlock = { measurables, constraints, _ ->
val placeable = measurables.first().measure(Constraints())
layout(constraints.maxWidth, constraints.maxHeight) {
placeable.place(0.ipx, 0.ipx)
diff --git a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/AlignmentLineTest.kt b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/AlignmentLineTest.kt
index e5abd81..75cad62 100644
--- a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/AlignmentLineTest.kt
+++ b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/AlignmentLineTest.kt
@@ -60,7 +60,7 @@
Wrap {
AlignmentLineOffset(testLine, before = beforeDp, after = afterDp) {
SaveLayoutInfo(parentSize, Ref(), layoutLatch)
- Layout({ SaveLayoutInfo(childSize, childPosition, layoutLatch) }) { _, _ ->
+ Layout({ SaveLayoutInfo(childSize, childPosition, layoutLatch) }) { _, _, _ ->
layout(childDp.toIntPx(), 0.ipx, mapOf(testLine to lineDp.toIntPx())) { }
}
}
@@ -99,7 +99,7 @@
Wrap {
AlignmentLineOffset(testLine, before = beforeDp, after = afterDp) {
SaveLayoutInfo(parentSize, Ref(), layoutLatch)
- Layout({ SaveLayoutInfo(childSize, childPosition, layoutLatch) }) { _, _ ->
+ Layout({ SaveLayoutInfo(childSize, childPosition, layoutLatch) }) { _, _, _ ->
layout(0.ipx, childDp.toIntPx(), mapOf(testLine to lineDp.toIntPx())) { }
}
}
@@ -135,7 +135,7 @@
Wrap {
AlignmentLineOffset(testLine, before = beforeDp, after = afterDp) {
SaveLayoutInfo(parentSize, Ref(), layoutLatch)
- Layout({ SaveLayoutInfo(childSize, childPosition, layoutLatch) }) { _, _ ->
+ Layout({ SaveLayoutInfo(childSize, childPosition, layoutLatch) }) { _, _, _ ->
layout(childDp.toIntPx(), 0.ipx, mapOf(testLine to lineDp.toIntPx())) { }
}
}
@@ -167,7 +167,7 @@
Wrap {
AlignmentLineOffset(testLine, before = beforeDp, after = afterDp) {
SaveLayoutInfo(parentSize, Ref(), layoutLatch)
- Layout({ SaveLayoutInfo(childSize, childPosition, layoutLatch) }) { _, _ ->
+ Layout({ SaveLayoutInfo(childSize, childPosition, layoutLatch) }) { _, _, _ ->
layout(0.ipx, childDp.toIntPx(), mapOf(testLine to lineDp.toIntPx())) { }
}
}
@@ -201,7 +201,9 @@
ConstrainedBox(DpConstraints(maxWidth = maxWidth)) {
AlignmentLineOffset(testLine, before = beforeDp, after = afterDp) {
SaveLayoutInfo(parentSize, Ref(), layoutLatch)
- Layout({ SaveLayoutInfo(childSize, childPosition, layoutLatch) }) { _, _ ->
+ Layout({
+ SaveLayoutInfo(childSize, childPosition, layoutLatch)
+ }) { _, _, _ ->
layout(
childDp.toIntPx(),
0.ipx,
@@ -241,7 +243,9 @@
ConstrainedBox(DpConstraints(maxHeight = maxHeight)) {
AlignmentLineOffset(testLine, before = beforeDp, after = afterDp) {
SaveLayoutInfo(parentSize, Ref(), layoutLatch)
- Layout({ SaveLayoutInfo(childSize, childPosition, layoutLatch) }) { _, _ ->
+ Layout({
+ SaveLayoutInfo(childSize, childPosition, layoutLatch)
+ }) { _, _, _ ->
layout(
0.ipx,
childDp.toIntPx(),
@@ -357,7 +361,7 @@
Layout({
CenterAlignmentLine(testLine) {
SaveLayoutInfo(centerSize, Ref(), layoutLatch)
- Layout({ SaveLayoutInfo(Ref(), childPosition, layoutLatch) }) { _, _ ->
+ Layout({ SaveLayoutInfo(Ref(), childPosition, layoutLatch) }) { _, _, _ ->
layout(
childWidth.toIntPx(),
childHeight.toIntPx(),
@@ -365,7 +369,7 @@
) { }
}
}
- }) { measurables, _ ->
+ }) { measurables, _, _ ->
val placeable = measurables.first().measure(Constraints()) // Infinite measuring
layout(0.ipx, 0.ipx) {
placeable.place(0.ipx, 0.ipx)
@@ -401,7 +405,7 @@
Layout({
CenterAlignmentLine(testLine) {
SaveLayoutInfo(centerSize, Ref(), layoutLatch)
- Layout({ SaveLayoutInfo(Ref(), childPosition, layoutLatch) }) { _, _ ->
+ Layout({ SaveLayoutInfo(Ref(), childPosition, layoutLatch) }) { _, _, _ ->
layout(
childWidth.toIntPx(),
childHeight.toIntPx(),
@@ -409,7 +413,7 @@
) { }
}
}
- }) { measurables, _ ->
+ }) { measurables, _, _ ->
val placeable = measurables.first().measure(Constraints()) // Infinite measuring
layout(0.ipx, 0.ipx) {
placeable.place(0.ipx, 0.ipx)
diff --git a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/AspectRatioModifierTest.kt b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/AspectRatioModifierTest.kt
index 6afd43b..cf00f94 100644
--- a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/AspectRatioModifierTest.kt
+++ b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/AspectRatioModifierTest.kt
@@ -100,7 +100,7 @@
Container(LayoutAspectRatio(aspectRatio)) {
SaveLayoutInfo(size, position, positionedLatch)
}
- }) { measurables, incomingConstraints ->
+ }) { measurables, incomingConstraints, _ ->
require(measurables.isNotEmpty())
val placeable = measurables.first().measure(childContraints)
layout(incomingConstraints.maxWidth, incomingConstraints.maxHeight) {
diff --git a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/ContainerTest.kt b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/ContainerTest.kt
index 1029016..424c7c1 100644
--- a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/ContainerTest.kt
+++ b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/ContainerTest.kt
@@ -370,7 +370,7 @@
EmptyBox(width = model.size, height = 10.dp)
}
}
- }) { measurables, constraints ->
+ }) { measurables, constraints, _ ->
val placeable = measurables.first().measure(constraints)
++measure
layout(placeable.width, placeable.height) {
@@ -408,7 +408,7 @@
EmptyBox(width = model.size, height = 10.dp)
}
}
- }) { measurables, constraints ->
+ }) { measurables, constraints, _ ->
val placeable = measurables.first().measure(constraints)
++measure
layout(placeable.width, placeable.height) {
@@ -446,7 +446,7 @@
EmptyBox(width = model.size, height = 10.dp)
}
}
- }) { measurables, constraints ->
+ }) { measurables, constraints, _ ->
val placeable = measurables.first().measure(constraints)
++measure
layout(placeable.width, placeable.height) {
@@ -470,7 +470,7 @@
@Composable
fun EmptyBox(width: Dp, height: Dp) {
- Layout(children = { }) { _, constraints ->
+ Layout(children = { }) { _, constraints, _ ->
layout(
width.toIntPx().coerceIn(constraints.minWidth, constraints.maxWidth),
height.toIntPx().coerceIn(constraints.minHeight, constraints.maxHeight)
diff --git a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/ExpandedModifierTest.kt b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/ExpandedModifierTest.kt
index 81f230c..c9129e5 100644
--- a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/ExpandedModifierTest.kt
+++ b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/ExpandedModifierTest.kt
@@ -91,7 +91,7 @@
SaveLayoutInfo(size, position, positionedLatch)
}
}
- }) { measurables, incomingConstraints ->
+ }) { measurables, incomingConstraints, _ ->
require(measurables.isNotEmpty())
val placeable = measurables.first().measure(incomingConstraints)
layout(
diff --git a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/FlexTest.kt b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/FlexTest.kt
index 31bd77d..d1e137c2 100644
--- a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/FlexTest.kt
+++ b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/FlexTest.kt
@@ -1294,7 +1294,7 @@
assertEquals(Constraints(), constraints)
FixedSizeLayout(inflexibleChildWidth.toIntPx(), 0.ipx, mapOf())
}
- Layout({}, LayoutFlexible(1f)) { _, constraints ->
+ Layout({}, LayoutFlexible(1f)) { _, constraints, _ ->
assertEquals(
rowMinWidth.toIntPx() - inflexibleChildWidth.toIntPx() * 2,
constraints.minWidth
@@ -1760,7 +1760,7 @@
assertEquals(Constraints(), constraints)
FixedSizeLayout(0.ipx, inflexibleChildHeight.toIntPx(), mapOf())
}
- Layout(emptyContent(), LayoutFlexible(1f)) { _, constraints ->
+ Layout(emptyContent(), LayoutFlexible(1f)) { _, constraints, _ ->
assertEquals(
columnMinHeight.toIntPx() - inflexibleChildHeight.toIntPx() * 2,
constraints.minHeight
@@ -3320,7 +3320,7 @@
modifier: Modifier,
children: @Composable() () -> Unit
) {
- Layout(children = children, modifier = modifier, measureBlock = { _, constraints ->
+ Layout(children = children, modifier = modifier, measureBlock = { _, constraints, _ ->
val widthPx = max(width.toIntPx(), constraints.minWidth)
val heightPx = max(height.toIntPx(), constraints.minHeight)
layout(
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)
diff --git a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/LayoutDirectionModifierTest.kt b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/LayoutDirectionModifierTest.kt
index 34e4a9f..2d8bf60 100644
--- a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/LayoutDirectionModifierTest.kt
+++ b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/LayoutDirectionModifierTest.kt
@@ -21,15 +21,9 @@
import androidx.test.filters.SmallTest
import androidx.ui.core.Layout
import androidx.ui.core.LayoutDirectionAmbient
-import androidx.ui.core.LayoutModifier
-import androidx.ui.core.ModifierScope
import androidx.ui.core.Ref
-import androidx.ui.layout.Container
import androidx.ui.layout.LayoutDirectionModifier
import androidx.ui.layout.MaxIntrinsicWidth
-import androidx.ui.layout.Stack
-import androidx.ui.unit.IntPxPosition
-import androidx.ui.unit.IntPxSize
import androidx.ui.unit.ipx
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertTrue
@@ -51,8 +45,8 @@
Layout(
children = @Composable() {},
modifier = LayoutDirectionModifier.Rtl
- ) { _, _ ->
- layoutDirection.value = this.layoutDirection
+ ) { _, _, incomingLayoutDirection ->
+ layoutDirection.value = incomingLayoutDirection
latch.countDown()
layout(0.ipx, 0.ipx) {}
}
@@ -72,21 +66,21 @@
@Test
fun testModifiedLayoutDirection_inIntrinsicsMeasure() {
val latch = CountDownLatch(1)
- var layoutDirection: androidx.ui.core.LayoutDirection? = null
+ val layoutDirection = Ref<androidx.ui.core.LayoutDirection>()
val children = @Composable {
MaxIntrinsicWidth {
Layout(
children = @Composable() {},
modifier = LayoutDirectionModifier.Rtl,
- minIntrinsicWidthMeasureBlock = { _, _ -> 0.ipx },
- minIntrinsicHeightMeasureBlock = { _, _ -> 0.ipx },
- maxIntrinsicWidthMeasureBlock = { _, _ ->
- layoutDirection = this.layoutDirection
+ minIntrinsicWidthMeasureBlock = { _, _, _ -> 0.ipx },
+ minIntrinsicHeightMeasureBlock = { _, _, _ -> 0.ipx },
+ maxIntrinsicWidthMeasureBlock = { _, _, incomingLayoutDirection ->
+ layoutDirection.value = incomingLayoutDirection
latch.countDown()
0.ipx
},
- maxIntrinsicHeightMeasureBlock = { _, _ -> 0.ipx }
- ) { _, _ ->
+ maxIntrinsicHeightMeasureBlock = { _, _, _ -> 0.ipx }
+ ) { _, _, _ ->
layout(0.ipx, 0.ipx) {}
}
}
@@ -102,71 +96,6 @@
assertTrue(latch.await(1, TimeUnit.SECONDS))
assertNotNull(layoutDirection)
- assertTrue(androidx.ui.core.LayoutDirection.Rtl == layoutDirection!!)
- }
-
- @Test
- fun testModifiedLayoutDirection_insideModifier() {
- val latch = CountDownLatch(1)
- var layoutDirection: androidx.ui.core.LayoutDirection? = null
- val rtlAwareModifier = object : LayoutModifier {
- override fun ModifierScope.modifyPosition(
- childSize: IntPxSize,
- containerSize: IntPxSize
- ): IntPxPosition {
- layoutDirection = this.layoutDirection
- latch.countDown()
- return if (this.layoutDirection == androidx.ui.core.LayoutDirection.Ltr) {
- IntPxPosition.Origin
- } else {
- IntPxPosition(containerSize.width - childSize.width, 0.ipx)
- }
- }
- }
- val children = @Composable {
- Stack {
- Container(modifier = LayoutDirectionModifier.Rtl + rtlAwareModifier) {}
- }
- }
-
- show {
- Providers(
- LayoutDirectionAmbient provides androidx.ui.core.LayoutDirection.Ltr,
- children = children
- )
- children()
- }
-
- assertTrue(latch.await(1, TimeUnit.SECONDS))
- assertNotNull(layoutDirection)
- assertTrue(androidx.ui.core.LayoutDirection.Rtl == layoutDirection!!)
- }
-
- @Test
- fun testRestoreLayoutDirection() {
- val latch = CountDownLatch(1)
- var layoutDirection: androidx.ui.core.LayoutDirection? = null
- val children = @Composable {
- Layout(
- children = @Composable() {},
- modifier = LayoutDirectionModifier.Rtl + LayoutDirectionModifier.Restore
- ) { _, _ ->
- layoutDirection = this.layoutDirection
- latch.countDown()
- layout(0.ipx, 0.ipx) {}
- }
- }
-
- show {
- Providers(
- LayoutDirectionAmbient provides androidx.ui.core.LayoutDirection.Ltr,
- children = children
- )
- children()
- }
-
- assertTrue(latch.await(1, TimeUnit.SECONDS))
- assertNotNull(layoutDirection)
- assertTrue(androidx.ui.core.LayoutDirection.Ltr == layoutDirection!!)
+ assertTrue(androidx.ui.core.LayoutDirection.Rtl == layoutDirection.value)
}
}
\ No newline at end of file
diff --git a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/LayoutPaddingTest.kt b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/LayoutPaddingTest.kt
index 11a7fd0e..c98feef 100644
--- a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/LayoutPaddingTest.kt
+++ b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/LayoutPaddingTest.kt
@@ -17,19 +17,18 @@
package androidx.ui.layout.test
import androidx.compose.Composable
-import androidx.compose.Providers
import androidx.test.filters.SmallTest
import androidx.ui.core.Layout
-import androidx.ui.core.LayoutDirection
-import androidx.ui.core.LayoutDirectionAmbient
import androidx.ui.core.Modifier
import androidx.ui.core.OnPositioned
import androidx.ui.layout.Center
import androidx.ui.layout.Container
import androidx.ui.layout.DpConstraints
import androidx.ui.layout.LayoutAspectRatio
+import androidx.ui.layout.LayoutDirectionModifier
import androidx.ui.layout.LayoutPadding
import androidx.ui.layout.LayoutSize
+import androidx.ui.layout.LayoutWidth
import androidx.ui.layout.Row
import androidx.ui.layout.Stack
import androidx.ui.unit.Dp
@@ -40,7 +39,6 @@
import androidx.ui.unit.ipx
import androidx.ui.unit.min
import androidx.ui.unit.px
-import androidx.ui.unit.round
import androidx.ui.unit.toPx
import org.junit.Assert
import org.junit.Assert.assertEquals
@@ -176,7 +174,7 @@
@Test
fun testRtlSupport() = with(density) {
- val sizeDp = 50.dp
+ val sizeDp = 150.ipx.toDp()
val size = sizeDp.toIntPx()
val padding1Dp = 5.dp
val padding2Dp = 10.dp
@@ -190,60 +188,57 @@
val childPosition = Array(3) { PxPosition(0.px, 0.px) }
// ltr: P1 S P2 | S P3 | P1 S
- // rtl: P2 S P1 | P3 S | S P1
- val children = @Composable {
- Stack(
- LayoutPadding(start = padding1Dp, end = padding2Dp) +
- LayoutSize(sizeDp, sizeDp)
- ) {
- OnPositioned( coordinates ->
- childSize[0] = coordinates.size
- childPosition[0] = coordinates.localToGlobal(PxPosition(0.px, 0.px))
- drawLatch.countDown()
- })
- }
-
- Stack(LayoutPadding(end = padding3Dp) + LayoutSize(sizeDp, sizeDp)) {
- OnPositioned( coordinates ->
- childSize[1] = coordinates.size
- childPosition[1] = coordinates.localToGlobal(PxPosition(0.px, 0.px))
- drawLatch.countDown()
- })
- }
-
- Stack(
- LayoutPadding(start = padding1Dp) +
- LayoutSize(sizeDp, sizeDp)
- ) {
- OnPositioned( coordinates ->
- childSize[2] = coordinates.size
- childPosition[2] = coordinates.localToGlobal(PxPosition(0.px, 0.px))
- drawLatch.countDown()
- })
- }
- }
+ // rtl: S P1 | P3 S | P2 S P1
show {
- Row {
- Providers(
- LayoutDirectionAmbient provides LayoutDirection.Rtl,
- children = children
- )
+ Row(LayoutWidth(sizeDp * 3) + LayoutDirectionModifier.Rtl) {
+ Stack(
+ LayoutPadding(start = padding1Dp, end = padding2Dp) +
+ LayoutSize(sizeDp, sizeDp)
+ ) {
+ OnPositioned( coordinates ->
+ childSize[0] = coordinates.size
+ childPosition[0] = coordinates.localToGlobal(PxPosition(0.px, 0.px))
+ drawLatch.countDown()
+ })
+ }
+
+ Stack(LayoutPadding(end = padding3Dp) + LayoutSize(sizeDp, sizeDp)) {
+ OnPositioned( coordinates ->
+ childSize[1] = coordinates.size
+ childPosition[1] = coordinates.localToGlobal(PxPosition(0.px, 0.px))
+ drawLatch.countDown()
+ })
+ }
+
+ Stack(
+ LayoutPadding(start = padding1Dp) +
+ LayoutSize(sizeDp, sizeDp)
+ ) {
+ OnPositioned( coordinates ->
+ childSize[2] = coordinates.size
+ childPosition[2] = coordinates.localToGlobal(PxPosition(0.px, 0.px))
+ drawLatch.countDown()
+ })
+ }
}
}
drawLatch.await(1, TimeUnit.SECONDS)
+ val root = findAndroidComposeView()
+ waitForDraw(root)
- assertEquals(PxPosition(padding2.toPx(), 0.px), childPosition[0])
+ val rootWidth = root.width.ipx
+// S P1 | P3 S | P2 S P1
+ assertEquals(PxPosition(rootWidth - padding1 - size, 0.ipx), childPosition[0])
assertEquals(IntPxSize(size, size), childSize[0])
- val paddings = padding1 + padding2 + padding3
assertEquals(
- PxPosition(size.toPx() + paddings.toPx(), 0.px),
+ PxPosition(rootWidth - padding1 - padding2 - size * 2, 0.ipx),
childPosition[1]
)
assertEquals(IntPxSize(size, size), childSize[1])
assertEquals(
- PxPosition((size.toPx() * 2).round().toPx() + paddings, 0.px),
+ PxPosition(rootWidth - size * 3 - padding1 * 2 - padding2 - padding3, 0.ipx),
childPosition[2]
)
assertEquals(IntPxSize(size, size), childSize[2])
@@ -389,7 +384,7 @@
*/
@Composable
private fun TestBox(modifier: Modifier = Modifier.None, body: @Composable() () -> Unit) {
- Layout(children = body, modifier = modifier) { measurables, constraints ->
+ Layout(children = body, modifier = modifier) { measurables, constraints, _ ->
require(measurables.size == 1) {
"TestBox received ${measurables.size} children; must have exactly 1"
}
diff --git a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/LayoutTest.kt b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/LayoutTest.kt
index 2242e5e..2e5004c 100644
--- a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/LayoutTest.kt
+++ b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/LayoutTest.kt
@@ -150,11 +150,11 @@
show {
Layout(
layout,
- minIntrinsicWidthMeasureBlock = { _, _ -> 0.ipx },
- minIntrinsicHeightMeasureBlock = { _, _ -> 0.ipx },
- maxIntrinsicWidthMeasureBlock = { _, _ -> 0.ipx },
- maxIntrinsicHeightMeasureBlock = { _, _ -> 0.ipx }
- ) { measurables, _ ->
+ minIntrinsicWidthMeasureBlock = { _, _, _ -> 0.ipx },
+ minIntrinsicHeightMeasureBlock = { _, _, _ -> 0.ipx },
+ maxIntrinsicWidthMeasureBlock = { _, _, _ -> 0.ipx },
+ maxIntrinsicHeightMeasureBlock = { _, _, _ -> 0.ipx }
+ ) { measurables, _, _ ->
val measurable = measurables.first()
test(
{ h -> measurable.minIntrinsicWidth(h) },
@@ -176,7 +176,7 @@
height: IntPx,
alignmentLines: Map<AlignmentLine, IntPx>
) {
- Layout({}) { _, constraints ->
+ Layout({}) { _, constraints, _ ->
layout(
width.coerceIn(constraints.minWidth, constraints.maxWidth),
height.coerceIn(constraints.minHeight, constraints.maxHeight),
@@ -187,7 +187,7 @@
@Composable
internal fun WithInfiniteConstraints(children: @Composable() () -> Unit) {
- Layout(children) { measurables, _ ->
+ Layout(children) { measurables, _, _ ->
val placeables = measurables.map { it.measure(Constraints()) }
layout(0.ipx, 0.ipx) {
placeables.forEach { it.place(0.ipx, 0.ipx) }
@@ -204,23 +204,23 @@
Layout(
children,
modifier = modifier,
- minIntrinsicWidthMeasureBlock = { measurables, h ->
+ minIntrinsicWidthMeasureBlock = { measurables, h, _ ->
val width = measurables.firstOrNull()?.minIntrinsicWidth(h) ?: 0.ipx
width.coerceIn(constraints.minWidth.toIntPx(), constraints.maxWidth.toIntPx())
},
- minIntrinsicHeightMeasureBlock = { measurables, w ->
+ minIntrinsicHeightMeasureBlock = { measurables, w, _ ->
val height = measurables.firstOrNull()?.minIntrinsicHeight(w) ?: 0.ipx
height.coerceIn(constraints.minHeight.toIntPx(), constraints.maxHeight.toIntPx())
},
- maxIntrinsicWidthMeasureBlock = { measurables, h ->
+ maxIntrinsicWidthMeasureBlock = { measurables, h, _ ->
val width = measurables.firstOrNull()?.maxIntrinsicWidth(h) ?: 0.ipx
width.coerceIn(constraints.minWidth.toIntPx(), constraints.maxWidth.toIntPx())
},
- maxIntrinsicHeightMeasureBlock = { measurables, w ->
+ maxIntrinsicHeightMeasureBlock = { measurables, w, _ ->
val height = measurables.firstOrNull()?.maxIntrinsicHeight(w) ?: 0.ipx
height.coerceIn(constraints.minHeight.toIntPx(), constraints.maxHeight.toIntPx())
}
- ) { measurables, incomingConstraints ->
+ ) { measurables, incomingConstraints, _ ->
val measurable = measurables.firstOrNull()
val childConstraints = Constraints(constraints).enforce(incomingConstraints)
val placeable = measurable?.measure(childConstraints)
diff --git a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/OnPositionedTest.kt b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/OnPositionedTest.kt
index fbf4a08..2bce4b4 100644
--- a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/OnPositionedTest.kt
+++ b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/OnPositionedTest.kt
@@ -307,7 +307,7 @@
latch.countDown()
}
}
- Layout(onPositioned) { _, _ ->
+ Layout(onPositioned) { _, _, _ ->
layout(0.ipx, 0.ipx, mapOf(line to lineValue)) { }
}
}
@@ -317,7 +317,7 @@
@Composable
private fun Offset(sizeModel: SizeModel, children: @Composable() () -> Unit) {
// simple copy of Padding which doesn't recompose when the size changes
- Layout(children) { measurables, constraints ->
+ Layout(children) { measurables, constraints, _ ->
layout(constraints.maxWidth, constraints.maxHeight) {
measurables.first().measure(constraints).place(sizeModel.size.toPx(), 0.px)
}
diff --git a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/StackTest.kt b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/StackTest.kt
index 64acf10..c14e384 100644
--- a/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/StackTest.kt
+++ b/ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/StackTest.kt
@@ -17,11 +17,8 @@
package androidx.ui.layout.test
import androidx.compose.Composable
-import androidx.compose.Providers
import androidx.test.filters.SmallTest
import androidx.ui.core.Alignment
-import androidx.ui.core.LayoutDirection
-import androidx.ui.core.LayoutDirectionAmbient
import androidx.ui.core.OnChildPositioned
import androidx.ui.core.Ref
import androidx.ui.layout.Align
@@ -29,6 +26,7 @@
import androidx.ui.layout.DpConstraints
import androidx.ui.layout.LayoutAlign
import androidx.ui.layout.LayoutAspectRatio
+import androidx.ui.layout.LayoutDirectionModifier
import androidx.ui.layout.LayoutGravity
import androidx.ui.layout.LayoutPadding
import androidx.ui.layout.LayoutSize
@@ -264,8 +262,7 @@
stackSize.value = coordinates.size
positionedLatch.countDown()
}) {
- Providers(LayoutDirectionAmbient provides LayoutDirection.Rtl) {
- Stack(LayoutSize(tripleSizeDp, tripleSizeDp)) {
+ Stack(LayoutDirectionModifier.Rtl + LayoutSize(tripleSizeDp, tripleSizeDp)) {
Stack(LayoutGravity.TopStart + LayoutSize(sizeDp, sizeDp)) {
SaveLayoutInfo(
size = childSize[0],
@@ -329,7 +326,6 @@
positionedLatch = positionedLatch
)
}
- }
}
}
}
diff --git a/ui/ui-layout/src/main/java/androidx/ui/layout/Align.kt b/ui/ui-layout/src/main/java/androidx/ui/layout/Align.kt
index 1b5077a..74b91ae 100644
--- a/ui/ui-layout/src/main/java/androidx/ui/layout/Align.kt
+++ b/ui/ui-layout/src/main/java/androidx/ui/layout/Align.kt
@@ -20,8 +20,9 @@
import androidx.ui.core.Alignment
import androidx.ui.core.Constraints
import androidx.ui.core.Layout
+import androidx.ui.core.LayoutDirection
import androidx.ui.core.LayoutModifier
-import androidx.ui.core.ModifierScope
+import androidx.ui.unit.Density
import androidx.ui.unit.IntPxPosition
import androidx.ui.unit.IntPxSize
import androidx.ui.unit.ipx
@@ -43,7 +44,7 @@
*/
@Composable
fun Align(alignment: Alignment, children: @Composable() () -> Unit) {
- Layout(children) { measurables, constraints ->
+ Layout(children) { measurables, constraints, _ ->
val measurable = measurables.firstOrNull()
// The child cannot be larger than our max constraints, but we ignore min constraints.
val placeable = measurable?.measure(constraints.copy(minWidth = 0.ipx, minHeight = 0.ipx))
@@ -230,23 +231,28 @@
private val alignment: Alignment,
private val direction: Direction
) : LayoutModifier {
- override fun ModifierScope.modifyConstraints(constraints: Constraints) = when (direction) {
+ override fun Density.modifyConstraints(
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
+ ) = when (direction) {
Direction.Both -> constraints.copy(minWidth = 0.ipx, minHeight = 0.ipx)
Direction.Horizontal -> constraints.copy(minWidth = 0.ipx)
Direction.Vertical -> constraints.copy(minHeight = 0.ipx)
}
- override fun ModifierScope.modifySize(
+ override fun Density.modifySize(
constraints: Constraints,
+ layoutDirection: LayoutDirection,
childSize: IntPxSize
): IntPxSize = IntPxSize(
max(constraints.minWidth, childSize.width),
max(constraints.minHeight, childSize.height)
)
- override fun ModifierScope.modifyPosition(
+ override fun Density.modifyPosition(
childSize: IntPxSize,
- containerSize: IntPxSize
+ containerSize: IntPxSize,
+ layoutDirection: LayoutDirection
): IntPxPosition = alignment.align(
IntPxSize(
containerSize.width - childSize.width,
diff --git a/ui/ui-layout/src/main/java/androidx/ui/layout/AlignmentLine.kt b/ui/ui-layout/src/main/java/androidx/ui/layout/AlignmentLine.kt
index bbd755e..e6ac2bd 100644
--- a/ui/ui-layout/src/main/java/androidx/ui/layout/AlignmentLine.kt
+++ b/ui/ui-layout/src/main/java/androidx/ui/layout/AlignmentLine.kt
@@ -51,7 +51,7 @@
after: Dp = 0.dp,
children: @Composable() () -> Unit
) {
- Layout(children, modifier) { measurables, constraints ->
+ Layout(children, modifier) { measurables, constraints, _ ->
require(measurables.isNotEmpty()) { "No child found in AlignmentLineOffset" }
val placeable = measurables.first().measure(
// Loose constraints perpendicular on the alignment line.
@@ -102,7 +102,7 @@
*/
@Composable
fun CenterAlignmentLine(alignmentLine: AlignmentLine, children: @Composable() () -> Unit) {
- Layout(children) { measurables, constraints ->
+ Layout(children) { measurables, constraints, _ ->
require(measurables.isNotEmpty()) { "No child found in CenterAlignmentLine" }
val placeable = measurables.first().measure(
// Loose constraints perpendicular on the alignment line.
diff --git a/ui/ui-layout/src/main/java/androidx/ui/layout/AspectRatio.kt b/ui/ui-layout/src/main/java/androidx/ui/layout/AspectRatio.kt
index e4fceca..532f6b8 100644
--- a/ui/ui-layout/src/main/java/androidx/ui/layout/AspectRatio.kt
+++ b/ui/ui-layout/src/main/java/androidx/ui/layout/AspectRatio.kt
@@ -18,9 +18,10 @@
import androidx.annotation.FloatRange
import androidx.ui.core.Constraints
+import androidx.ui.core.LayoutDirection
import androidx.ui.core.LayoutModifier
import androidx.ui.core.Measurable
-import androidx.ui.core.ModifierScope
+import androidx.ui.unit.Density
import androidx.ui.core.satisfiedBy
import androidx.ui.unit.IntPx
import androidx.ui.unit.IntPxSize
@@ -53,7 +54,10 @@
require(aspectRatio > 0) { "aspectRatio $aspectRatio must be > 0" }
}
- override fun ModifierScope.modifyConstraints(constraints: Constraints): Constraints {
+ override fun Density.modifyConstraints(
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
+ ): Constraints {
val size = constraints.findSizeWith(aspectRatio)
return if (size != null)
Constraints.fixed(size.width, size.height)
@@ -61,22 +65,38 @@
constraints
}
- override fun ModifierScope.minIntrinsicWidthOf(measurable: Measurable, height: IntPx): IntPx {
+ override fun Density.minIntrinsicWidthOf(
+ measurable: Measurable,
+ height: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx {
return if (height == IntPx.Infinity) measurable.minIntrinsicWidth(height)
else height * aspectRatio
}
- override fun ModifierScope.maxIntrinsicWidthOf(measurable: Measurable, height: IntPx): IntPx {
+ override fun Density.maxIntrinsicWidthOf(
+ measurable: Measurable,
+ height: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx {
return if (height == IntPx.Infinity) measurable.maxIntrinsicWidth(height)
else height * aspectRatio
}
- override fun ModifierScope.minIntrinsicHeightOf(measurable: Measurable, width: IntPx): IntPx {
+ override fun Density.minIntrinsicHeightOf(
+ measurable: Measurable,
+ width: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx {
return if (width == IntPx.Infinity) measurable.minIntrinsicHeight(width)
else width / aspectRatio
}
- override fun ModifierScope.maxIntrinsicHeightOf(measurable: Measurable, width: IntPx): IntPx {
+ override fun Density.maxIntrinsicHeightOf(
+ measurable: Measurable,
+ width: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx {
return if (width == IntPx.Infinity) measurable.maxIntrinsicHeight(width)
else width / aspectRatio
}
diff --git a/ui/ui-layout/src/main/java/androidx/ui/layout/ConstraintLayout.kt b/ui/ui-layout/src/main/java/androidx/ui/layout/ConstraintLayout.kt
index 2d35bf6..e81be44 100644
--- a/ui/ui-layout/src/main/java/androidx/ui/layout/ConstraintLayout.kt
+++ b/ui/ui-layout/src/main/java/androidx/ui/layout/ConstraintLayout.kt
@@ -32,9 +32,9 @@
import androidx.ui.core.Constraints
import androidx.ui.core.FirstBaseline
import androidx.ui.core.Layout
+import androidx.ui.core.LayoutDirection
import androidx.ui.core.LayoutModifier
import androidx.ui.core.Measurable
-import androidx.ui.core.ModifierScope
import androidx.ui.core.ParentDataModifier
import androidx.ui.core.Placeable
import androidx.ui.core.Placeable.PlacementScope.place
@@ -54,7 +54,7 @@
@Composable
fun ConstraintLayout(constraintSet: ConstraintSet, children: @Composable() () -> Unit) {
val measurer = remember { Measurer() }
- Layout(children) { measurables, constraints ->
+ Layout(children) { measurables, constraints, _ ->
val layoutSize = measurer.performMeasure(
constraints,
constraintSet,
@@ -659,17 +659,44 @@
}
private data class TagModifier(val tag: Any) : LayoutModifier, ParentDataModifier {
- override fun ModifierScope.modifyConstraints(constraints: Constraints) = constraints
- override fun ModifierScope.modifySize(constraints: Constraints, childSize: IntPxSize) =
+ override fun Density.modifyConstraints(
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
+ ) = constraints
+ override fun Density.modifySize(
+ constraints: Constraints,
+ layoutDirection: LayoutDirection,
+ childSize: IntPxSize
+ ) =
childSize
- override fun ModifierScope.minIntrinsicWidthOf(measurable: Measurable, height: IntPx) =
+ override fun Density.minIntrinsicWidthOf(
+ measurable: Measurable,
+ height: IntPx,
+ layoutDirection: LayoutDirection
+ ) =
measurable.minIntrinsicWidth(height)
- override fun ModifierScope.maxIntrinsicWidthOf(measurable: Measurable, height: IntPx) =
+ override fun Density.maxIntrinsicWidthOf(
+ measurable: Measurable,
+ height: IntPx,
+ layoutDirection: LayoutDirection
+ ) =
measurable.maxIntrinsicWidth(height)
- override fun ModifierScope.minIntrinsicHeightOf(measurable: Measurable, width: IntPx) =
+ override fun Density.minIntrinsicHeightOf(
+ measurable: Measurable,
+ width: IntPx,
+ layoutDirection: LayoutDirection
+ ) =
measurable.minIntrinsicHeight(width)
- override fun ModifierScope.maxIntrinsicHeightOf(measurable: Measurable, width: IntPx) =
+ override fun Density.maxIntrinsicHeightOf(
+ measurable: Measurable,
+ width: IntPx,
+ layoutDirection: LayoutDirection
+ ) =
measurable.maxIntrinsicHeight(width)
- override fun ModifierScope.modifyAlignmentLine(line: AlignmentLine, value: IntPx?) = value
+ override fun Density.modifyAlignmentLine(
+ line: AlignmentLine,
+ value: IntPx?,
+ layoutDirection: LayoutDirection
+ ) = value
override fun Density.modifyParentData(parentData: Any?) = this@TagModifier
}
diff --git a/ui/ui-layout/src/main/java/androidx/ui/layout/Container.kt b/ui/ui-layout/src/main/java/androidx/ui/layout/Container.kt
index 0af085e..92f4d35 100644
--- a/ui/ui-layout/src/main/java/androidx/ui/layout/Container.kt
+++ b/ui/ui-layout/src/main/java/androidx/ui/layout/Container.kt
@@ -64,7 +64,7 @@
height: Dp? = null,
children: @Composable() () -> Unit
) {
- Layout(children, modifier) { measurables, incomingConstraints ->
+ Layout(children, modifier) { measurables, incomingConstraints, _ ->
val containerConstraints = Constraints(constraints)
.copy(
width?.toIntPx() ?: constraints.minWidth.toIntPx(),
diff --git a/ui/ui-layout/src/main/java/androidx/ui/layout/Flex.kt b/ui/ui-layout/src/main/java/androidx/ui/layout/Flex.kt
index b1cbb48..227cecf 100644
--- a/ui/ui-layout/src/main/java/androidx/ui/layout/Flex.kt
+++ b/ui/ui-layout/src/main/java/androidx/ui/layout/Flex.kt
@@ -667,7 +667,7 @@
minIntrinsicHeightMeasureBlock = MinIntrinsicHeightMeasureBlock(orientation),
maxIntrinsicWidthMeasureBlock = MaxIntrinsicWidthMeasureBlock(orientation),
maxIntrinsicHeightMeasureBlock = MaxIntrinsicHeightMeasureBlock(orientation)
- ) { ltrMeasurables, outerConstraints ->
+ ) { ltrMeasurables, outerConstraints, layoutDirection ->
// rtl support
val measurables = if (orientation == LayoutOrientation.Horizontal &&
layoutDirection == LayoutDirection.Rtl) {
@@ -897,7 +897,7 @@
}
private object IntrinsicMeasureBlocks {
- val HorizontalMinWidth: IntrinsicMeasureBlock = { measurables, availableHeight ->
+ val HorizontalMinWidth: IntrinsicMeasureBlock = { measurables, availableHeight, _ ->
intrinsicSize(
measurables,
{ h -> minIntrinsicWidth(h) },
@@ -907,7 +907,7 @@
LayoutOrientation.Horizontal
)
}
- val VerticalMinWidth: IntrinsicMeasureBlock = { measurables, availableHeight ->
+ val VerticalMinWidth: IntrinsicMeasureBlock = { measurables, availableHeight, _ ->
intrinsicSize(
measurables,
{ h -> minIntrinsicWidth(h) },
@@ -917,7 +917,7 @@
LayoutOrientation.Horizontal
)
}
- val HorizontalMinHeight: IntrinsicMeasureBlock = { measurables, availableWidth ->
+ val HorizontalMinHeight: IntrinsicMeasureBlock = { measurables, availableWidth, _ ->
intrinsicSize(
measurables,
{ w -> minIntrinsicHeight(w) },
@@ -927,7 +927,7 @@
LayoutOrientation.Vertical
)
}
- val VerticalMinHeight: IntrinsicMeasureBlock = { measurables, availableWidth ->
+ val VerticalMinHeight: IntrinsicMeasureBlock = { measurables, availableWidth, _ ->
intrinsicSize(
measurables,
{ w -> minIntrinsicHeight(w) },
@@ -937,7 +937,7 @@
LayoutOrientation.Vertical
)
}
- val HorizontalMaxWidth: IntrinsicMeasureBlock = { measurables, availableHeight ->
+ val HorizontalMaxWidth: IntrinsicMeasureBlock = { measurables, availableHeight, _ ->
intrinsicSize(
measurables,
{ h -> maxIntrinsicWidth(h) },
@@ -947,7 +947,7 @@
LayoutOrientation.Horizontal
)
}
- val VerticalMaxWidth: IntrinsicMeasureBlock = { measurables, availableHeight ->
+ val VerticalMaxWidth: IntrinsicMeasureBlock = { measurables, availableHeight, _ ->
intrinsicSize(
measurables,
{ h -> maxIntrinsicWidth(h) },
@@ -957,7 +957,7 @@
LayoutOrientation.Horizontal
)
}
- val HorizontalMaxHeight: IntrinsicMeasureBlock = { measurables, availableWidth ->
+ val HorizontalMaxHeight: IntrinsicMeasureBlock = { measurables, availableWidth, _ ->
intrinsicSize(
measurables,
{ w -> maxIntrinsicHeight(w) },
@@ -967,7 +967,7 @@
LayoutOrientation.Vertical
)
}
- val VerticalMaxHeight: IntrinsicMeasureBlock = { measurables, availableWidth ->
+ val VerticalMaxHeight: IntrinsicMeasureBlock = { measurables, availableWidth, _ ->
intrinsicSize(
measurables,
{ w -> maxIntrinsicHeight(w) },
diff --git a/ui/ui-layout/src/main/java/androidx/ui/layout/Flow.kt b/ui/ui-layout/src/main/java/androidx/ui/layout/Flow.kt
index 34fac1a..cbec9c2 100644
--- a/ui/ui-layout/src/main/java/androidx/ui/layout/Flow.kt
+++ b/ui/ui-layout/src/main/java/androidx/ui/layout/Flow.kt
@@ -145,7 +145,7 @@
fun Placeable.crossAxisSize() =
if (orientation == LayoutOrientation.Horizontal) height else width
- Layout(children) { measurables, outerConstraints ->
+ Layout(children) { measurables, outerConstraints, layoutDirection ->
val sequences = mutableListOf<List<Placeable>>()
val crossAxisSizes = mutableListOf<IntPx>()
val crossAxisPositions = mutableListOf<IntPx>()
diff --git a/ui/ui-layout/src/main/java/androidx/ui/layout/Intrinsic.kt b/ui/ui-layout/src/main/java/androidx/ui/layout/Intrinsic.kt
index 314e028..5aaa3d5 100644
--- a/ui/ui-layout/src/main/java/androidx/ui/layout/Intrinsic.kt
+++ b/ui/ui-layout/src/main/java/androidx/ui/layout/Intrinsic.kt
@@ -41,19 +41,19 @@
fun MinIntrinsicWidth(children: @Composable() () -> Unit) {
Layout(
children,
- minIntrinsicWidthMeasureBlock = { measurables, h ->
+ minIntrinsicWidthMeasureBlock = { measurables, h, _ ->
measurables.firstOrNull()?.minIntrinsicWidth(h) ?: 0.ipx
},
- minIntrinsicHeightMeasureBlock = { measurables, w ->
+ minIntrinsicHeightMeasureBlock = { measurables, w, _ ->
measurables.firstOrNull()?.minIntrinsicHeight(w) ?: 0.ipx
},
- maxIntrinsicWidthMeasureBlock = { measurables, h ->
+ maxIntrinsicWidthMeasureBlock = { measurables, h, _ ->
measurables.firstOrNull()?.minIntrinsicWidth(h) ?: 0.ipx
},
- maxIntrinsicHeightMeasureBlock = { measurables, w ->
+ maxIntrinsicHeightMeasureBlock = { measurables, w, _ ->
measurables.firstOrNull()?.maxIntrinsicHeight(w) ?: 0.ipx
}
- ) { measurables, constraints ->
+ ) { measurables, constraints, _ ->
val measurable = measurables.firstOrNull()
val width = measurable?.minIntrinsicWidth(constraints.maxHeight) ?: 0.ipx
val placeable = measurable?.measure(
@@ -86,19 +86,19 @@
fun MinIntrinsicHeight(children: @Composable() () -> Unit) {
Layout(
children,
- minIntrinsicWidthMeasureBlock = { measurables, h ->
+ minIntrinsicWidthMeasureBlock = { measurables, h, _ ->
measurables.firstOrNull()?.minIntrinsicWidth(h) ?: 0.ipx
},
- minIntrinsicHeightMeasureBlock = { measurables, w ->
+ minIntrinsicHeightMeasureBlock = { measurables, w, _ ->
measurables.firstOrNull()?.minIntrinsicHeight(w) ?: 0.ipx
},
- maxIntrinsicWidthMeasureBlock = { measurables, h ->
+ maxIntrinsicWidthMeasureBlock = { measurables, h, _ ->
measurables.firstOrNull()?.maxIntrinsicWidth(h) ?: 0.ipx
},
- maxIntrinsicHeightMeasureBlock = { measurables, w ->
+ maxIntrinsicHeightMeasureBlock = { measurables, w, _ ->
measurables.firstOrNull()?.minIntrinsicHeight(w) ?: 0.ipx
}
- ) { measurables, constraints ->
+ ) { measurables, constraints, _ ->
val measurable = measurables.firstOrNull()
val height = measurable?.minIntrinsicHeight(constraints.maxWidth) ?: 0.ipx
val placeable = measurable?.measure(
@@ -131,19 +131,19 @@
fun MaxIntrinsicWidth(children: @Composable() () -> Unit) {
Layout(
children,
- minIntrinsicWidthMeasureBlock = { measurables, h ->
+ minIntrinsicWidthMeasureBlock = { measurables, h, _ ->
measurables.firstOrNull()?.maxIntrinsicWidth(h) ?: 0.ipx
},
- minIntrinsicHeightMeasureBlock = { measurables, w ->
+ minIntrinsicHeightMeasureBlock = { measurables, w, _ ->
measurables.firstOrNull()?.minIntrinsicHeight(w) ?: 0.ipx
},
- maxIntrinsicWidthMeasureBlock = { measurables, h ->
+ maxIntrinsicWidthMeasureBlock = { measurables, h, _ ->
measurables.firstOrNull()?.maxIntrinsicWidth(h) ?: 0.ipx
},
- maxIntrinsicHeightMeasureBlock = { measurables, w ->
+ maxIntrinsicHeightMeasureBlock = { measurables, w, _ ->
measurables.firstOrNull()?.maxIntrinsicHeight(w) ?: 0.ipx
}
- ) { measurables, constraints ->
+ ) { measurables, constraints, _ ->
val measurable = measurables.firstOrNull()
val width = measurable?.maxIntrinsicWidth(constraints.maxHeight) ?: 0.ipx
val placeable = measurable?.measure(
@@ -176,19 +176,19 @@
fun MaxIntrinsicHeight(children: @Composable() () -> Unit) {
Layout(
children,
- minIntrinsicWidthMeasureBlock = { measurables, h ->
+ minIntrinsicWidthMeasureBlock = { measurables, h, _ ->
measurables.firstOrNull()?.minIntrinsicWidth(h) ?: 0.ipx
},
- minIntrinsicHeightMeasureBlock = { measurables, w ->
+ minIntrinsicHeightMeasureBlock = { measurables, w, _ ->
measurables.firstOrNull()?.maxIntrinsicHeight(w) ?: 0.ipx
},
- maxIntrinsicWidthMeasureBlock = { measurables, h ->
+ maxIntrinsicWidthMeasureBlock = { measurables, h, _ ->
measurables.firstOrNull()?.maxIntrinsicWidth(h) ?: 0.ipx
},
- maxIntrinsicHeightMeasureBlock = { measurables, w ->
+ maxIntrinsicHeightMeasureBlock = { measurables, w, _ ->
measurables.firstOrNull()?.maxIntrinsicHeight(w) ?: 0.ipx
}
- ) { measurables, constraints ->
+ ) { measurables, constraints, _ ->
val measurable = measurables.firstOrNull()
val height = measurable?.maxIntrinsicHeight(constraints.maxWidth) ?: 0.ipx
val placeable = measurable?.measure(
diff --git a/ui/ui-layout/src/main/java/androidx/ui/layout/LayoutDirections.kt b/ui/ui-layout/src/main/java/androidx/ui/layout/LayoutDirections.kt
index 53b7748..551a4c4 100644
--- a/ui/ui-layout/src/main/java/androidx/ui/layout/LayoutDirections.kt
+++ b/ui/ui-layout/src/main/java/androidx/ui/layout/LayoutDirections.kt
@@ -18,22 +18,19 @@
import androidx.ui.core.LayoutDirection
import androidx.ui.core.LayoutModifier
-import androidx.ui.core.ModifierScope
+import androidx.ui.unit.Density
/**
* A layout modifier that changes the layout direction of the corresponding layout node.
*/
-// TODO(soboleva) Make a public API
-internal object LayoutDirectionModifier {
+object LayoutDirectionModifier {
val Ltr: LayoutModifier = LayoutDirectionModifierImpl(LayoutDirection.Ltr)
val Rtl: LayoutModifier = LayoutDirectionModifierImpl(LayoutDirection.Rtl)
- val Restore: LayoutModifier = LayoutDirectionModifierImpl(null)
}
private data class LayoutDirectionModifierImpl(
- val newLayoutDirection: LayoutDirection?
+ val newLayoutDirection: LayoutDirection
) : LayoutModifier {
- // if newLayoutDirection set by modifier is null, then we restore to ambient's layout direction
- override fun ModifierScope.modifyLayoutDirection() =
- newLayoutDirection ?: ambientLayoutDirection
+ override fun Density.modifyLayoutDirection(layoutDirection: LayoutDirection) =
+ newLayoutDirection
}
diff --git a/ui/ui-layout/src/main/java/androidx/ui/layout/Padding.kt b/ui/ui-layout/src/main/java/androidx/ui/layout/Padding.kt
index 161ad31d..bcd96c4 100644
--- a/ui/ui-layout/src/main/java/androidx/ui/layout/Padding.kt
+++ b/ui/ui-layout/src/main/java/androidx/ui/layout/Padding.kt
@@ -20,7 +20,7 @@
import androidx.ui.core.Constraints
import androidx.ui.core.LayoutDirection
import androidx.ui.core.LayoutModifier
-import androidx.ui.core.ModifierScope
+import androidx.ui.unit.Density
import androidx.ui.core.offset
import androidx.ui.unit.Dp
import androidx.ui.unit.IntPxPosition
@@ -53,15 +53,17 @@
val end: Dp = 0.dp,
val bottom: Dp = 0.dp
) : LayoutModifier {
- override fun ModifierScope.modifyConstraints(
- constraints: Constraints
+ override fun Density.modifyConstraints(
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
) = constraints.offset(
horizontal = -start.toIntPx() - end.toIntPx(),
vertical = -top.toIntPx() - bottom.toIntPx()
)
- override fun ModifierScope.modifySize(
+ override fun Density.modifySize(
constraints: Constraints,
+ layoutDirection: LayoutDirection,
childSize: IntPxSize
) = IntPxSize(
(start.toIntPx() + childSize.width + end.toIntPx())
@@ -70,9 +72,10 @@
.coerceIn(constraints.minHeight, constraints.maxHeight)
)
- override fun ModifierScope.modifyPosition(
+ override fun Density.modifyPosition(
childSize: IntPxSize,
- containerSize: IntPxSize
+ containerSize: IntPxSize,
+ layoutDirection: LayoutDirection
): IntPxPosition = if (layoutDirection == LayoutDirection.Ltr) {
IntPxPosition(start.toIntPx(), top.toIntPx())
} else {
diff --git a/ui/ui-layout/src/main/java/androidx/ui/layout/SizeModifiers.kt b/ui/ui-layout/src/main/java/androidx/ui/layout/SizeModifiers.kt
index 1e5bedf..0b52878 100644
--- a/ui/ui-layout/src/main/java/androidx/ui/layout/SizeModifiers.kt
+++ b/ui/ui-layout/src/main/java/androidx/ui/layout/SizeModifiers.kt
@@ -18,9 +18,10 @@
import androidx.compose.Stable
import androidx.ui.core.Constraints
+import androidx.ui.core.LayoutDirection
import androidx.ui.core.LayoutModifier
import androidx.ui.core.Measurable
-import androidx.ui.core.ModifierScope
+import androidx.ui.unit.Density
import androidx.ui.core.enforce
import androidx.ui.core.hasBoundedHeight
import androidx.ui.core.hasBoundedWidth
@@ -29,28 +30,47 @@
import androidx.ui.unit.isFinite
private data class SizeModifier(private val modifierConstraints: DpConstraints) : LayoutModifier {
- override fun ModifierScope.modifyConstraints(constraints: Constraints) =
+ override fun Density.modifyConstraints(
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
+ ) =
Constraints(modifierConstraints).enforce(constraints)
- override fun ModifierScope.minIntrinsicWidthOf(measurable: Measurable, height: IntPx): IntPx =
+ override fun Density.minIntrinsicWidthOf(
+ measurable: Measurable,
+ height: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx =
measurable.minIntrinsicWidth(height).let {
val constraints = Constraints(modifierConstraints)
it.coerceIn(constraints.minWidth, constraints.maxWidth)
}
- override fun ModifierScope.maxIntrinsicWidthOf(measurable: Measurable, height: IntPx): IntPx =
+ override fun Density.maxIntrinsicWidthOf(
+ measurable: Measurable,
+ height: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx =
measurable.maxIntrinsicWidth(height).let {
val constraints = Constraints(modifierConstraints)
it.coerceIn(constraints.minWidth, constraints.maxWidth)
}
- override fun ModifierScope.minIntrinsicHeightOf(measurable: Measurable, width: IntPx): IntPx =
+ override fun Density.minIntrinsicHeightOf(
+ measurable: Measurable,
+ width: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx =
measurable.minIntrinsicHeight(width).let {
val constraints = Constraints(modifierConstraints)
it.coerceIn(constraints.minHeight, constraints.maxHeight)
}
- override fun ModifierScope.maxIntrinsicHeightOf(measurable: Measurable, width: IntPx): IntPx =
+ override fun Density.maxIntrinsicHeightOf(
+ measurable: Measurable,
+ width: IntPx,
+ layoutDirection: LayoutDirection
+ ): IntPx =
measurable.maxIntrinsicHeight(width).let {
val constraints = Constraints(modifierConstraints)
it.coerceIn(constraints.minHeight, constraints.maxHeight)
@@ -142,7 +162,10 @@
*/
@Stable
object Fill : LayoutModifier {
- override fun ModifierScope.modifyConstraints(constraints: Constraints): Constraints =
+ override fun Density.modifyConstraints(
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
+ ): Constraints =
if (constraints.hasBoundedWidth) {
constraints.copy(minWidth = constraints.maxWidth, maxWidth = constraints.maxWidth)
} else {
@@ -238,7 +261,10 @@
*/
@Stable
object Fill : LayoutModifier {
- override fun ModifierScope.modifyConstraints(constraints: Constraints): Constraints =
+ override fun Density.modifyConstraints(
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
+ ): Constraints =
if (constraints.hasBoundedHeight) {
constraints.copy(
minHeight = constraints.maxHeight,
@@ -384,7 +410,10 @@
*/
@Stable
object Fill : LayoutModifier {
- override fun ModifierScope.modifyConstraints(constraints: Constraints): Constraints =
+ override fun Density.modifyConstraints(
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
+ ): Constraints =
when {
constraints.hasBoundedWidth && constraints.hasBoundedHeight -> constraints.copy(
minWidth = constraints.maxWidth,
diff --git a/ui/ui-layout/src/main/java/androidx/ui/layout/Stack.kt b/ui/ui-layout/src/main/java/androidx/ui/layout/Stack.kt
index a38bd5b..9d48b87 100644
--- a/ui/ui-layout/src/main/java/androidx/ui/layout/Stack.kt
+++ b/ui/ui-layout/src/main/java/androidx/ui/layout/Stack.kt
@@ -48,7 +48,7 @@
) {
val stackChildren: @Composable() () -> Unit = { StackScope().children() }
- Layout(stackChildren, modifier = modifier) { measurables, constraints ->
+ Layout(stackChildren, modifier = modifier) { measurables, constraints, layoutDirection ->
val placeables = arrayOfNulls<Placeable>(measurables.size)
// First measure aligned children to get the size of the layout.
val childConstraints = constraints.copy(minWidth = 0.ipx, minHeight = 0.ipx)
diff --git a/ui/ui-layout/src/main/java/androidx/ui/layout/Table.kt b/ui/ui-layout/src/main/java/androidx/ui/layout/Table.kt
index 32436a8..b7b8d7c 100644
--- a/ui/ui-layout/src/main/java/androidx/ui/layout/Table.kt
+++ b/ui/ui-layout/src/main/java/androidx/ui/layout/Table.kt
@@ -524,7 +524,7 @@
minIntrinsicHeightMeasureBlock = MinIntrinsicHeightMeasureBlock(columns, columnWidth),
maxIntrinsicWidthMeasureBlock = MaxIntrinsicWidthMeasureBlock(columns, columnWidth),
maxIntrinsicHeightMeasureBlock = MaxIntrinsicHeightMeasureBlock(columns, columnWidth)
- ) { measurables, constraints ->
+ ) { measurables, constraints, _ ->
val rowMeasurables = measurables.filter { it.rowIndex != null }.groupBy { it.rowIndex }
val rows = rowMeasurables.size
fun measurableAt(row: Int, column: Int) = rowMeasurables[row]?.getOrNull(column)
@@ -630,7 +630,7 @@
private val MinIntrinsicWidthMeasureBlock:
(Int, (Int) -> TableColumnWidth) -> IntrinsicMeasureBlock =
{ columns, columnWidth ->
- { measurables, availableHeight ->
+ { measurables, availableHeight, _ ->
intrinsicWidth(
columns = columns,
columnWidth = columnWidth,
@@ -644,7 +644,7 @@
private val MinIntrinsicHeightMeasureBlock:
(Int, (Int) -> TableColumnWidth) -> IntrinsicMeasureBlock =
{ columns, columnWidth ->
- { measurables, availableWidth ->
+ { measurables, availableWidth, _ ->
intrinsicHeight(
columns = columns,
columnWidth = columnWidth,
@@ -658,7 +658,7 @@
private val MaxIntrinsicWidthMeasureBlock:
(Int, (Int) -> TableColumnWidth) -> IntrinsicMeasureBlock =
{ columns, columnWidth ->
- { measurables, availableHeight ->
+ { measurables, availableHeight, _ ->
intrinsicWidth(
columns = columns,
columnWidth = columnWidth,
@@ -672,7 +672,7 @@
private val MaxIntrinsicHeightMeasureBlock:
(Int, (Int) -> TableColumnWidth) -> IntrinsicMeasureBlock =
{ columns, columnWidth ->
- { measurables, availableWidth ->
+ { measurables, availableWidth, _ ->
intrinsicHeight(
columns = columns,
columnWidth = columnWidth,
diff --git a/ui/ui-layout/src/main/java/androidx/ui/layout/Wrap.kt b/ui/ui-layout/src/main/java/androidx/ui/layout/Wrap.kt
index 65eaa56..bdb8350 100644
--- a/ui/ui-layout/src/main/java/androidx/ui/layout/Wrap.kt
+++ b/ui/ui-layout/src/main/java/androidx/ui/layout/Wrap.kt
@@ -34,7 +34,7 @@
*/
@Composable
fun Wrap(alignment: Alignment = Alignment.TopStart, children: @Composable() () -> Unit) {
- Layout(children) { measurables, constraints ->
+ Layout(children) { measurables, constraints, _ ->
val measurable = measurables.firstOrNull()
// The child cannot be larger than our max constraints, but we ignore min constraints.
val placeable = measurable?.measure(constraints.copy(minWidth = 0.ipx, minHeight = 0.ipx))
diff --git a/ui/ui-material/src/main/java/androidx/ui/material/BottomNavigation.kt b/ui/ui-material/src/main/java/androidx/ui/material/BottomNavigation.kt
index 9b8388f..af34e83 100644
--- a/ui/ui-material/src/main/java/androidx/ui/material/BottomNavigation.kt
+++ b/ui/ui-material/src/main/java/androidx/ui/material/BottomNavigation.kt
@@ -257,7 +257,7 @@
children = text
)
}
- ) { measurables, constraints ->
+ ) { measurables, constraints, _ ->
val iconPlaceable = measurables.first { it.tag == "icon" }.measure(constraints)
val textPlaceable = measurables.first { it.tag == "text" }.measure(
diff --git a/ui/ui-material/src/main/java/androidx/ui/material/DataTable.kt b/ui/ui-material/src/main/java/androidx/ui/material/DataTable.kt
index 65bcd27..36e13cb 100644
--- a/ui/ui-material/src/main/java/androidx/ui/material/DataTable.kt
+++ b/ui/ui-material/src/main/java/androidx/ui/material/DataTable.kt
@@ -457,7 +457,7 @@
}
}
}
- Layout(children) { measurables, constraints ->
+ Layout(children) { measurables, constraints, _ ->
layout(constraints.maxWidth, constraints.maxHeight) {
measurables.forEach { measurable ->
val i = measurable.parentData as Int
diff --git a/ui/ui-material/src/main/java/androidx/ui/material/Drawer.kt b/ui/ui-material/src/main/java/androidx/ui/material/Drawer.kt
index a3e35ae..4641a91 100644
--- a/ui/ui-material/src/main/java/androidx/ui/material/Drawer.kt
+++ b/ui/ui-material/src/main/java/androidx/ui/material/Drawer.kt
@@ -295,7 +295,7 @@
) {
Layout(children = {
RepaintBoundary(children = child)
- }) { measurables, constraints ->
+ }) { measurables, constraints, _ ->
if (measurables.size > 1) {
throw IllegalStateException("Only one child is allowed")
}
diff --git a/ui/ui-material/src/main/java/androidx/ui/material/ListItem.kt b/ui/ui-material/src/main/java/androidx/ui/material/ListItem.kt
index 01ebb10..6e338e4 100644
--- a/ui/ui-material/src/main/java/androidx/ui/material/ListItem.kt
+++ b/ui/ui-material/src/main/java/androidx/ui/material/ListItem.kt
@@ -404,7 +404,7 @@
modifier: Modifier = Modifier.None,
children: @Composable() () -> Unit
) {
- Layout(children, modifier) { measurables, constraints ->
+ Layout(children, modifier) { measurables, constraints, _ ->
val childConstraints = constraints.copy(minHeight = 0.ipx, maxHeight = IntPx.Infinity)
val placeables = measurables.map { it.measure(childConstraints) }
@@ -445,7 +445,7 @@
modifier: Modifier = Modifier.None,
children: @Composable() () -> Unit
) {
- Layout(children, modifier) { measurables, constraints ->
+ Layout(children, modifier) { measurables, constraints, _ ->
val placeable = measurables[0].measure(constraints.copy(minHeight = 0.ipx))
val baseline = placeable[FirstBaseline]
val y: IntPx
diff --git a/ui/ui-material/src/main/java/androidx/ui/material/Scaffold.kt b/ui/ui-material/src/main/java/androidx/ui/material/Scaffold.kt
index 21c8dbe..dbb2146 100644
--- a/ui/ui-material/src/main/java/androidx/ui/material/Scaffold.kt
+++ b/ui/ui-material/src/main/java/androidx/ui/material/Scaffold.kt
@@ -231,7 +231,7 @@
},
fab
)
- }) { measurables, constraints ->
+ }) { measurables, constraints, _ ->
val (appBarPlaceable, fabPlaceable) = measurables.map { it.measure(constraints) }
val layoutWidth = appBarPlaceable.width
diff --git a/ui/ui-material/src/main/java/androidx/ui/material/Snackbar.kt b/ui/ui-material/src/main/java/androidx/ui/material/Snackbar.kt
index 305c796..3c54caa 100644
--- a/ui/ui-material/src/main/java/androidx/ui/material/Snackbar.kt
+++ b/ui/ui-material/src/main/java/androidx/ui/material/Snackbar.kt
@@ -94,7 +94,7 @@
Layout(
text,
modifier = LayoutPadding(start = HorizontalSpacing, end = HorizontalSpacing)
- ) { measurables, constraints ->
+ ) { measurables, constraints, _ ->
require(measurables.size == 1) {
"text for Snackbar expected to have exactly only one child"
}
@@ -144,7 +144,7 @@
Box(LayoutTag(actionTag), children = action)
},
modifier = LayoutPadding(start = HorizontalSpacing, end = HorizontalSpacingButtonSide)
- ) { measurables, constraints ->
+ ) { measurables, constraints, _ ->
val buttonPlaceable = measurables.first { it.tag == actionTag }.measure(constraints)
val textMaxWidth =
(constraints.maxWidth - buttonPlaceable.width - TextEndExtraSpacing.toIntPx())
diff --git a/ui/ui-material/src/main/java/androidx/ui/material/Tab.kt b/ui/ui-material/src/main/java/androidx/ui/material/Tab.kt
index 6e646ce..fc4e129 100644
--- a/ui/ui-material/src/main/java/androidx/ui/material/Tab.kt
+++ b/ui/ui-material/src/main/java/androidx/ui/material/Tab.kt
@@ -249,7 +249,7 @@
Box(LayoutTag(indicatorTag), children = indicator)
Box(LayoutTag(dividerTag), children = divider)
}
- ) { measurables, constraints ->
+ ) { measurables, constraints, _ ->
val tabPlaceables = mutableListOf<Pair<Placeable, IntPx>>()
val minTabWidth = ScrollableTabRowMinimumTabWidth.toIntPx()
@@ -582,7 +582,7 @@
)
Box(LayoutTag("icon"), children = icon)
}
- ) { measurables, constraints ->
+ ) { measurables, constraints, _ ->
val textPlaceable = measurables.first { it.tag == "text" }.measure(
// Measure with loose constraints for height as we don't want the text to take up more
// space than it needs
diff --git a/ui/ui-material/src/main/java/androidx/ui/material/surface/Surface.kt b/ui/ui-material/src/main/java/androidx/ui/material/surface/Surface.kt
index b073b4a..a03a041 100644
--- a/ui/ui-material/src/main/java/androidx/ui/material/surface/Surface.kt
+++ b/ui/ui-material/src/main/java/androidx/ui/material/surface/Surface.kt
@@ -126,7 +126,7 @@
// TODO("Andrey: Should be replaced with some basic layout implementation when we have it")
@Composable
private fun SurfaceLayout(modifier: Modifier = Modifier.None, children: @Composable() () -> Unit) {
- Layout(children, modifier) { measurables, constraints ->
+ Layout(children, modifier) { measurables, constraints, _ ->
if (measurables.size > 1) {
throw IllegalStateException("Surface can have only one direct measurable child!")
}
diff --git a/ui/ui-platform/api/0.1.0-dev06.txt b/ui/ui-platform/api/0.1.0-dev06.txt
index 0e5e7f3..d58af5e 100644
--- a/ui/ui-platform/api/0.1.0-dev06.txt
+++ b/ui/ui-platform/api/0.1.0-dev06.txt
@@ -173,11 +173,11 @@
method public void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.Density density);
method public boolean getAffectsParentSize();
method public androidx.ui.unit.IntPx? getAlignmentLine(androidx.ui.core.AlignmentLine line);
- method public androidx.ui.core.LayoutDirection getAmbientLayoutDirection();
method public androidx.ui.core.Constraints getConstraints();
method public androidx.ui.core.LayoutCoordinates getCoordinates();
method public androidx.ui.unit.IntPx getHeight();
method public java.util.List<androidx.ui.core.LayoutNode> getLayoutChildren();
+ method public androidx.ui.core.LayoutDirection? getLayoutDirection();
method public androidx.ui.core.LayoutNode.MeasureBlocks getMeasureBlocks();
method public androidx.ui.core.MeasureScope getMeasureScope();
method public androidx.ui.core.Modifier getModifier();
@@ -203,6 +203,7 @@
method public void place(androidx.ui.unit.IntPx x, androidx.ui.unit.IntPx y);
method public void requestRemeasure();
method public void setConstraints(androidx.ui.core.Constraints p);
+ method public void setLayoutDirection(androidx.ui.core.LayoutDirection? p);
method public void setMeasureBlocks(androidx.ui.core.LayoutNode.MeasureBlocks value);
method public void setModifier(androidx.ui.core.Modifier value);
method public void setOnAttach(kotlin.jvm.functions.Function1<? super androidx.ui.core.Owner,kotlin.Unit>? p);
@@ -210,7 +211,6 @@
method public void setPositionedDuringMeasurePass(boolean p);
method public void setRef(androidx.ui.core.Ref<androidx.ui.core.LayoutNode>? value);
property public final boolean affectsParentSize;
- property public final androidx.ui.core.LayoutDirection ambientLayoutDirection;
property public final androidx.ui.core.Constraints constraints;
property protected androidx.ui.core.LayoutNode? containingLayoutNode;
property public final androidx.ui.core.LayoutCoordinates coordinates;
@@ -219,6 +219,7 @@
property public final boolean isMeasuring;
property public final boolean isPlaced;
property public final java.util.List<androidx.ui.core.LayoutNode> layoutChildren;
+ property public final androidx.ui.core.LayoutDirection? layoutDirection;
property public final androidx.ui.core.LayoutNode.MeasureBlocks measureBlocks;
property public final androidx.ui.core.MeasureScope measureScope;
property public final androidx.ui.core.Modifier modifier;
@@ -240,19 +241,19 @@
}
public static interface LayoutNode.MeasureBlocks {
- method public androidx.ui.unit.IntPx maxIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public androidx.ui.unit.IntPx maxIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
- method public androidx.ui.core.MeasureScope.LayoutResult measure(androidx.ui.core.MeasureScope measureScope, java.util.List<? extends androidx.ui.core.Measurable> measurables, androidx.ui.core.Constraints constraints);
- method public androidx.ui.unit.IntPx minIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public androidx.ui.unit.IntPx minIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
+ method public androidx.ui.unit.IntPx maxIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx maxIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.MeasureScope.LayoutResult measure(androidx.ui.core.MeasureScope measureScope, java.util.List<? extends androidx.ui.core.Measurable> measurables, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
}
public abstract static class LayoutNode.NoIntrinsicsMeasureBlocks implements androidx.ui.core.LayoutNode.MeasureBlocks {
ctor public LayoutNode.NoIntrinsicsMeasureBlocks(String error);
- method public Void maxIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public Void maxIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
- method public Void minIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public Void minIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
+ method public Void maxIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public Void maxIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
+ method public Void minIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public Void minIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
}
public final class LayoutNodeWrapperKt {
diff --git a/ui/ui-platform/api/current.txt b/ui/ui-platform/api/current.txt
index 0e5e7f3..d58af5e 100644
--- a/ui/ui-platform/api/current.txt
+++ b/ui/ui-platform/api/current.txt
@@ -173,11 +173,11 @@
method public void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.Density density);
method public boolean getAffectsParentSize();
method public androidx.ui.unit.IntPx? getAlignmentLine(androidx.ui.core.AlignmentLine line);
- method public androidx.ui.core.LayoutDirection getAmbientLayoutDirection();
method public androidx.ui.core.Constraints getConstraints();
method public androidx.ui.core.LayoutCoordinates getCoordinates();
method public androidx.ui.unit.IntPx getHeight();
method public java.util.List<androidx.ui.core.LayoutNode> getLayoutChildren();
+ method public androidx.ui.core.LayoutDirection? getLayoutDirection();
method public androidx.ui.core.LayoutNode.MeasureBlocks getMeasureBlocks();
method public androidx.ui.core.MeasureScope getMeasureScope();
method public androidx.ui.core.Modifier getModifier();
@@ -203,6 +203,7 @@
method public void place(androidx.ui.unit.IntPx x, androidx.ui.unit.IntPx y);
method public void requestRemeasure();
method public void setConstraints(androidx.ui.core.Constraints p);
+ method public void setLayoutDirection(androidx.ui.core.LayoutDirection? p);
method public void setMeasureBlocks(androidx.ui.core.LayoutNode.MeasureBlocks value);
method public void setModifier(androidx.ui.core.Modifier value);
method public void setOnAttach(kotlin.jvm.functions.Function1<? super androidx.ui.core.Owner,kotlin.Unit>? p);
@@ -210,7 +211,6 @@
method public void setPositionedDuringMeasurePass(boolean p);
method public void setRef(androidx.ui.core.Ref<androidx.ui.core.LayoutNode>? value);
property public final boolean affectsParentSize;
- property public final androidx.ui.core.LayoutDirection ambientLayoutDirection;
property public final androidx.ui.core.Constraints constraints;
property protected androidx.ui.core.LayoutNode? containingLayoutNode;
property public final androidx.ui.core.LayoutCoordinates coordinates;
@@ -219,6 +219,7 @@
property public final boolean isMeasuring;
property public final boolean isPlaced;
property public final java.util.List<androidx.ui.core.LayoutNode> layoutChildren;
+ property public final androidx.ui.core.LayoutDirection? layoutDirection;
property public final androidx.ui.core.LayoutNode.MeasureBlocks measureBlocks;
property public final androidx.ui.core.MeasureScope measureScope;
property public final androidx.ui.core.Modifier modifier;
@@ -240,19 +241,19 @@
}
public static interface LayoutNode.MeasureBlocks {
- method public androidx.ui.unit.IntPx maxIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public androidx.ui.unit.IntPx maxIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
- method public androidx.ui.core.MeasureScope.LayoutResult measure(androidx.ui.core.MeasureScope measureScope, java.util.List<? extends androidx.ui.core.Measurable> measurables, androidx.ui.core.Constraints constraints);
- method public androidx.ui.unit.IntPx minIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public androidx.ui.unit.IntPx minIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
+ method public androidx.ui.unit.IntPx maxIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx maxIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.MeasureScope.LayoutResult measure(androidx.ui.core.MeasureScope measureScope, java.util.List<? extends androidx.ui.core.Measurable> measurables, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
}
public abstract static class LayoutNode.NoIntrinsicsMeasureBlocks implements androidx.ui.core.LayoutNode.MeasureBlocks {
ctor public LayoutNode.NoIntrinsicsMeasureBlocks(String error);
- method public Void maxIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public Void maxIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
- method public Void minIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public Void minIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
+ method public Void maxIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public Void maxIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
+ method public Void minIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public Void minIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
}
public final class LayoutNodeWrapperKt {
diff --git a/ui/ui-platform/api/public_plus_experimental_0.1.0-dev06.txt b/ui/ui-platform/api/public_plus_experimental_0.1.0-dev06.txt
index 57ce6c1..76d1af3 100644
--- a/ui/ui-platform/api/public_plus_experimental_0.1.0-dev06.txt
+++ b/ui/ui-platform/api/public_plus_experimental_0.1.0-dev06.txt
@@ -175,11 +175,11 @@
method public void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.Density density);
method public boolean getAffectsParentSize();
method public androidx.ui.unit.IntPx? getAlignmentLine(androidx.ui.core.AlignmentLine line);
- method public androidx.ui.core.LayoutDirection getAmbientLayoutDirection();
method public androidx.ui.core.Constraints getConstraints();
method public androidx.ui.core.LayoutCoordinates getCoordinates();
method public androidx.ui.unit.IntPx getHeight();
method public java.util.List<androidx.ui.core.LayoutNode> getLayoutChildren();
+ method public androidx.ui.core.LayoutDirection? getLayoutDirection();
method public androidx.ui.core.LayoutNode.MeasureBlocks getMeasureBlocks();
method public androidx.ui.core.MeasureScope getMeasureScope();
method public androidx.ui.core.Modifier getModifier();
@@ -205,6 +205,7 @@
method public void place(androidx.ui.unit.IntPx x, androidx.ui.unit.IntPx y);
method public void requestRemeasure();
method public void setConstraints(androidx.ui.core.Constraints p);
+ method public void setLayoutDirection(androidx.ui.core.LayoutDirection? p);
method public void setMeasureBlocks(androidx.ui.core.LayoutNode.MeasureBlocks value);
method public void setModifier(androidx.ui.core.Modifier value);
method public void setOnAttach(kotlin.jvm.functions.Function1<? super androidx.ui.core.Owner,kotlin.Unit>? p);
@@ -212,7 +213,6 @@
method public void setPositionedDuringMeasurePass(boolean p);
method public void setRef(androidx.ui.core.Ref<androidx.ui.core.LayoutNode>? value);
property public final boolean affectsParentSize;
- property public final androidx.ui.core.LayoutDirection ambientLayoutDirection;
property public final androidx.ui.core.Constraints constraints;
property protected androidx.ui.core.LayoutNode? containingLayoutNode;
property public final androidx.ui.core.LayoutCoordinates coordinates;
@@ -221,6 +221,7 @@
property public final boolean isMeasuring;
property public final boolean isPlaced;
property public final java.util.List<androidx.ui.core.LayoutNode> layoutChildren;
+ property public final androidx.ui.core.LayoutDirection? layoutDirection;
property public final androidx.ui.core.LayoutNode.MeasureBlocks measureBlocks;
property public final androidx.ui.core.MeasureScope measureScope;
property public final androidx.ui.core.Modifier modifier;
@@ -242,19 +243,19 @@
}
public static interface LayoutNode.MeasureBlocks {
- method public androidx.ui.unit.IntPx maxIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public androidx.ui.unit.IntPx maxIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
- method public androidx.ui.core.MeasureScope.LayoutResult measure(androidx.ui.core.MeasureScope measureScope, java.util.List<? extends androidx.ui.core.Measurable> measurables, androidx.ui.core.Constraints constraints);
- method public androidx.ui.unit.IntPx minIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public androidx.ui.unit.IntPx minIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
+ method public androidx.ui.unit.IntPx maxIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx maxIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.MeasureScope.LayoutResult measure(androidx.ui.core.MeasureScope measureScope, java.util.List<? extends androidx.ui.core.Measurable> measurables, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
}
public abstract static class LayoutNode.NoIntrinsicsMeasureBlocks implements androidx.ui.core.LayoutNode.MeasureBlocks {
ctor public LayoutNode.NoIntrinsicsMeasureBlocks(String error);
- method public Void maxIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public Void maxIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
- method public Void minIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public Void minIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
+ method public Void maxIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public Void maxIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
+ method public Void minIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public Void minIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
}
public final class LayoutNodeWrapperKt {
diff --git a/ui/ui-platform/api/public_plus_experimental_current.txt b/ui/ui-platform/api/public_plus_experimental_current.txt
index 57ce6c1..76d1af3 100644
--- a/ui/ui-platform/api/public_plus_experimental_current.txt
+++ b/ui/ui-platform/api/public_plus_experimental_current.txt
@@ -175,11 +175,11 @@
method public void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.Density density);
method public boolean getAffectsParentSize();
method public androidx.ui.unit.IntPx? getAlignmentLine(androidx.ui.core.AlignmentLine line);
- method public androidx.ui.core.LayoutDirection getAmbientLayoutDirection();
method public androidx.ui.core.Constraints getConstraints();
method public androidx.ui.core.LayoutCoordinates getCoordinates();
method public androidx.ui.unit.IntPx getHeight();
method public java.util.List<androidx.ui.core.LayoutNode> getLayoutChildren();
+ method public androidx.ui.core.LayoutDirection? getLayoutDirection();
method public androidx.ui.core.LayoutNode.MeasureBlocks getMeasureBlocks();
method public androidx.ui.core.MeasureScope getMeasureScope();
method public androidx.ui.core.Modifier getModifier();
@@ -205,6 +205,7 @@
method public void place(androidx.ui.unit.IntPx x, androidx.ui.unit.IntPx y);
method public void requestRemeasure();
method public void setConstraints(androidx.ui.core.Constraints p);
+ method public void setLayoutDirection(androidx.ui.core.LayoutDirection? p);
method public void setMeasureBlocks(androidx.ui.core.LayoutNode.MeasureBlocks value);
method public void setModifier(androidx.ui.core.Modifier value);
method public void setOnAttach(kotlin.jvm.functions.Function1<? super androidx.ui.core.Owner,kotlin.Unit>? p);
@@ -212,7 +213,6 @@
method public void setPositionedDuringMeasurePass(boolean p);
method public void setRef(androidx.ui.core.Ref<androidx.ui.core.LayoutNode>? value);
property public final boolean affectsParentSize;
- property public final androidx.ui.core.LayoutDirection ambientLayoutDirection;
property public final androidx.ui.core.Constraints constraints;
property protected androidx.ui.core.LayoutNode? containingLayoutNode;
property public final androidx.ui.core.LayoutCoordinates coordinates;
@@ -221,6 +221,7 @@
property public final boolean isMeasuring;
property public final boolean isPlaced;
property public final java.util.List<androidx.ui.core.LayoutNode> layoutChildren;
+ property public final androidx.ui.core.LayoutDirection? layoutDirection;
property public final androidx.ui.core.LayoutNode.MeasureBlocks measureBlocks;
property public final androidx.ui.core.MeasureScope measureScope;
property public final androidx.ui.core.Modifier modifier;
@@ -242,19 +243,19 @@
}
public static interface LayoutNode.MeasureBlocks {
- method public androidx.ui.unit.IntPx maxIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public androidx.ui.unit.IntPx maxIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
- method public androidx.ui.core.MeasureScope.LayoutResult measure(androidx.ui.core.MeasureScope measureScope, java.util.List<? extends androidx.ui.core.Measurable> measurables, androidx.ui.core.Constraints constraints);
- method public androidx.ui.unit.IntPx minIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public androidx.ui.unit.IntPx minIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
+ method public androidx.ui.unit.IntPx maxIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx maxIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.MeasureScope.LayoutResult measure(androidx.ui.core.MeasureScope measureScope, java.util.List<? extends androidx.ui.core.Measurable> measurables, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
}
public abstract static class LayoutNode.NoIntrinsicsMeasureBlocks implements androidx.ui.core.LayoutNode.MeasureBlocks {
ctor public LayoutNode.NoIntrinsicsMeasureBlocks(String error);
- method public Void maxIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public Void maxIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
- method public Void minIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public Void minIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
+ method public Void maxIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public Void maxIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
+ method public Void minIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public Void minIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
}
public final class LayoutNodeWrapperKt {
diff --git a/ui/ui-platform/api/restricted_0.1.0-dev06.txt b/ui/ui-platform/api/restricted_0.1.0-dev06.txt
index 48a90b3..0fad468 100644
--- a/ui/ui-platform/api/restricted_0.1.0-dev06.txt
+++ b/ui/ui-platform/api/restricted_0.1.0-dev06.txt
@@ -175,11 +175,11 @@
method public void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.Density density);
method public boolean getAffectsParentSize();
method public androidx.ui.unit.IntPx? getAlignmentLine(androidx.ui.core.AlignmentLine line);
- method public androidx.ui.core.LayoutDirection getAmbientLayoutDirection();
method public androidx.ui.core.Constraints getConstraints();
method public androidx.ui.core.LayoutCoordinates getCoordinates();
method public androidx.ui.unit.IntPx getHeight();
method public java.util.List<androidx.ui.core.LayoutNode> getLayoutChildren();
+ method public androidx.ui.core.LayoutDirection? getLayoutDirection();
method public androidx.ui.core.LayoutNode.MeasureBlocks getMeasureBlocks();
method public androidx.ui.core.MeasureScope getMeasureScope();
method public androidx.ui.core.Modifier getModifier();
@@ -205,6 +205,7 @@
method public void place(androidx.ui.unit.IntPx x, androidx.ui.unit.IntPx y);
method public void requestRemeasure();
method public void setConstraints(androidx.ui.core.Constraints p);
+ method public void setLayoutDirection(androidx.ui.core.LayoutDirection? p);
method public void setMeasureBlocks(androidx.ui.core.LayoutNode.MeasureBlocks value);
method public void setModifier(androidx.ui.core.Modifier value);
method public void setOnAttach(kotlin.jvm.functions.Function1<? super androidx.ui.core.Owner,kotlin.Unit>? p);
@@ -212,7 +213,6 @@
method public void setPositionedDuringMeasurePass(boolean p);
method public void setRef(androidx.ui.core.Ref<androidx.ui.core.LayoutNode>? value);
property public final boolean affectsParentSize;
- property public final androidx.ui.core.LayoutDirection ambientLayoutDirection;
property public final androidx.ui.core.Constraints constraints;
property protected androidx.ui.core.LayoutNode? containingLayoutNode;
property public final androidx.ui.core.LayoutCoordinates coordinates;
@@ -221,6 +221,7 @@
property public final boolean isMeasuring;
property public final boolean isPlaced;
property public final java.util.List<androidx.ui.core.LayoutNode> layoutChildren;
+ property public final androidx.ui.core.LayoutDirection? layoutDirection;
property public final androidx.ui.core.LayoutNode.MeasureBlocks measureBlocks;
property public final androidx.ui.core.MeasureScope measureScope;
property public final androidx.ui.core.Modifier modifier;
@@ -242,19 +243,19 @@
}
public static interface LayoutNode.MeasureBlocks {
- method public androidx.ui.unit.IntPx maxIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public androidx.ui.unit.IntPx maxIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
- method public androidx.ui.core.MeasureScope.LayoutResult measure(androidx.ui.core.MeasureScope measureScope, java.util.List<? extends androidx.ui.core.Measurable> measurables, androidx.ui.core.Constraints constraints);
- method public androidx.ui.unit.IntPx minIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public androidx.ui.unit.IntPx minIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
+ method public androidx.ui.unit.IntPx maxIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx maxIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.MeasureScope.LayoutResult measure(androidx.ui.core.MeasureScope measureScope, java.util.List<? extends androidx.ui.core.Measurable> measurables, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
}
public abstract static class LayoutNode.NoIntrinsicsMeasureBlocks implements androidx.ui.core.LayoutNode.MeasureBlocks {
ctor public LayoutNode.NoIntrinsicsMeasureBlocks(String error);
- method public Void maxIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public Void maxIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
- method public Void minIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public Void minIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
+ method public Void maxIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public Void maxIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
+ method public Void minIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public Void minIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
}
public final class LayoutNodeWrapperKt {
diff --git a/ui/ui-platform/api/restricted_current.txt b/ui/ui-platform/api/restricted_current.txt
index 48a90b3..0fad468 100644
--- a/ui/ui-platform/api/restricted_current.txt
+++ b/ui/ui-platform/api/restricted_current.txt
@@ -175,11 +175,11 @@
method public void draw(androidx.ui.graphics.Canvas canvas, androidx.ui.unit.Density density);
method public boolean getAffectsParentSize();
method public androidx.ui.unit.IntPx? getAlignmentLine(androidx.ui.core.AlignmentLine line);
- method public androidx.ui.core.LayoutDirection getAmbientLayoutDirection();
method public androidx.ui.core.Constraints getConstraints();
method public androidx.ui.core.LayoutCoordinates getCoordinates();
method public androidx.ui.unit.IntPx getHeight();
method public java.util.List<androidx.ui.core.LayoutNode> getLayoutChildren();
+ method public androidx.ui.core.LayoutDirection? getLayoutDirection();
method public androidx.ui.core.LayoutNode.MeasureBlocks getMeasureBlocks();
method public androidx.ui.core.MeasureScope getMeasureScope();
method public androidx.ui.core.Modifier getModifier();
@@ -205,6 +205,7 @@
method public void place(androidx.ui.unit.IntPx x, androidx.ui.unit.IntPx y);
method public void requestRemeasure();
method public void setConstraints(androidx.ui.core.Constraints p);
+ method public void setLayoutDirection(androidx.ui.core.LayoutDirection? p);
method public void setMeasureBlocks(androidx.ui.core.LayoutNode.MeasureBlocks value);
method public void setModifier(androidx.ui.core.Modifier value);
method public void setOnAttach(kotlin.jvm.functions.Function1<? super androidx.ui.core.Owner,kotlin.Unit>? p);
@@ -212,7 +213,6 @@
method public void setPositionedDuringMeasurePass(boolean p);
method public void setRef(androidx.ui.core.Ref<androidx.ui.core.LayoutNode>? value);
property public final boolean affectsParentSize;
- property public final androidx.ui.core.LayoutDirection ambientLayoutDirection;
property public final androidx.ui.core.Constraints constraints;
property protected androidx.ui.core.LayoutNode? containingLayoutNode;
property public final androidx.ui.core.LayoutCoordinates coordinates;
@@ -221,6 +221,7 @@
property public final boolean isMeasuring;
property public final boolean isPlaced;
property public final java.util.List<androidx.ui.core.LayoutNode> layoutChildren;
+ property public final androidx.ui.core.LayoutDirection? layoutDirection;
property public final androidx.ui.core.LayoutNode.MeasureBlocks measureBlocks;
property public final androidx.ui.core.MeasureScope measureScope;
property public final androidx.ui.core.Modifier modifier;
@@ -242,19 +243,19 @@
}
public static interface LayoutNode.MeasureBlocks {
- method public androidx.ui.unit.IntPx maxIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public androidx.ui.unit.IntPx maxIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
- method public androidx.ui.core.MeasureScope.LayoutResult measure(androidx.ui.core.MeasureScope measureScope, java.util.List<? extends androidx.ui.core.Measurable> measurables, androidx.ui.core.Constraints constraints);
- method public androidx.ui.unit.IntPx minIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public androidx.ui.unit.IntPx minIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
+ method public androidx.ui.unit.IntPx maxIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx maxIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.core.MeasureScope.LayoutResult measure(androidx.ui.core.MeasureScope measureScope, java.util.List<? extends androidx.ui.core.Measurable> measurables, androidx.ui.core.Constraints constraints, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public androidx.ui.unit.IntPx minIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
}
public abstract static class LayoutNode.NoIntrinsicsMeasureBlocks implements androidx.ui.core.LayoutNode.MeasureBlocks {
ctor public LayoutNode.NoIntrinsicsMeasureBlocks(String error);
- method public Void maxIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public Void maxIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
- method public Void minIntrinsicHeight(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w);
- method public Void minIntrinsicWidth(androidx.ui.core.ModifierScope modifierScope, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h);
+ method public Void maxIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public Void maxIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
+ method public Void minIntrinsicHeight(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx w, androidx.ui.core.LayoutDirection layoutDirection);
+ method public Void minIntrinsicWidth(androidx.ui.unit.Density density, java.util.List<? extends androidx.ui.core.IntrinsicMeasurable> measurables, androidx.ui.unit.IntPx h, androidx.ui.core.LayoutDirection layoutDirection);
}
public final class LayoutNodeWrapperKt {
diff --git a/ui/ui-platform/src/main/java/androidx/ui/core/AndroidOwner.kt b/ui/ui-platform/src/main/java/androidx/ui/core/AndroidOwner.kt
index ea3a8a8..6ceb2a4 100644
--- a/ui/ui-platform/src/main/java/androidx/ui/core/AndroidOwner.kt
+++ b/ui/ui-platform/src/main/java/androidx/ui/core/AndroidOwner.kt
@@ -79,6 +79,7 @@
val root = LayoutNode().also {
it.measureBlocks = RootMeasureBlocks
+ it.layoutDirection = context.getLayoutDirection()
}
// LayoutNodes that need measure and layout
@@ -666,6 +667,15 @@
dispatchTouchEvent(event)
}
+ private fun Context.getLayoutDirection() =
+ when (applicationContext.resources.configuration.layoutDirection) {
+ android.util.LayoutDirection.LTR -> LayoutDirection.Ltr
+ android.util.LayoutDirection.RTL -> LayoutDirection.Rtl
+ // API doc says Configuration#getLayoutDirection only returns LTR or RTL.
+ // Fallback to LTR for unexpected return value.
+ else -> LayoutDirection.Ltr
+ }
+
private val textInputServiceAndroid = TextInputServiceAndroid(this)
val textInputService = TextInputService(textInputServiceAndroid)
@@ -752,7 +762,8 @@
override fun measure(
measureScope: MeasureScope,
measurables: List<Measurable>,
- constraints: Constraints
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
): MeasureScope.LayoutResult {
return when {
measurables.isEmpty() -> measureScope.layout(IntPx.Zero, IntPx.Zero) {}
@@ -780,27 +791,31 @@
}
override fun minIntrinsicWidth(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- h: IntPx
+ h: IntPx,
+ layoutDirection: LayoutDirection
) = error("Undefined intrinsics block and it is required")
override fun minIntrinsicHeight(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- w: IntPx
+ w: IntPx,
+ layoutDirection: LayoutDirection
) = error("Undefined intrinsics block and it is required")
override fun maxIntrinsicWidth(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- h: IntPx
+ h: IntPx,
+ layoutDirection: LayoutDirection
) = error("Undefined intrinsics block and it is required")
override fun maxIntrinsicHeight(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- w: IntPx
+ w: IntPx,
+ layoutDirection: LayoutDirection
) = error("Undefined intrinsics block and it is required")
}
}
diff --git a/ui/ui-platform/src/main/java/androidx/ui/core/ComponentNodes.kt b/ui/ui-platform/src/main/java/androidx/ui/core/ComponentNodes.kt
index d893bf2..4286caa 100644
--- a/ui/ui-platform/src/main/java/androidx/ui/core/ComponentNodes.kt
+++ b/ui/ui-platform/src/main/java/androidx/ui/core/ComponentNodes.kt
@@ -842,69 +842,78 @@
fun measure(
measureScope: MeasureScope,
measurables: List<Measurable>,
- constraints: Constraints
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
): MeasureScope.LayoutResult
/**
* The function used to calculate [IntrinsicMeasurable.minIntrinsicWidth].
*/
fun minIntrinsicWidth(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- h: IntPx
+ h: IntPx,
+ layoutDirection: LayoutDirection
): IntPx
/**
* The lambda used to calculate [IntrinsicMeasurable.minIntrinsicHeight].
*/
fun minIntrinsicHeight(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- w: IntPx
+ w: IntPx,
+ layoutDirection: LayoutDirection
): IntPx
/**
* The function used to calculate [IntrinsicMeasurable.maxIntrinsicWidth].
*/
fun maxIntrinsicWidth(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- h: IntPx
+ h: IntPx,
+ layoutDirection: LayoutDirection
): IntPx
/**
* The lambda used to calculate [IntrinsicMeasurable.maxIntrinsicHeight].
*/
fun maxIntrinsicHeight(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- w: IntPx
+ w: IntPx,
+ layoutDirection: LayoutDirection
): IntPx
}
abstract class NoIntrinsicsMeasureBlocks(private val error: String) : MeasureBlocks {
override fun minIntrinsicWidth(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- h: IntPx
+ h: IntPx,
+ layoutDirection: LayoutDirection
) = error(error)
override fun minIntrinsicHeight(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- w: IntPx
+ w: IntPx,
+ layoutDirection: LayoutDirection
) = error(error)
override fun maxIntrinsicWidth(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- h: IntPx
+ h: IntPx,
+ layoutDirection: LayoutDirection
) = error(error)
override fun maxIntrinsicHeight(
- modifierScope: ModifierScope,
+ density: Density,
measurables: List<IntrinsicMeasurable>,
- w: IntPx
+ w: IntPx,
+ layoutDirection: LayoutDirection
) = error(error)
}
@@ -924,15 +933,6 @@
}
}
- var ambientLayoutDirection = LayoutDirection.Ltr
- internal set(value) {
- if (value != field) {
- field = value
- measureScope.layoutDirection = value
- measureScope.ambientLayoutDirection = value
- }
- }
-
/**
* The scope used to run the [MeasureBlocks.measure] [MeasureBlock].
*/
@@ -952,6 +952,18 @@
var constraints: Constraints = Constraints.fixed(IntPx.Zero, IntPx.Zero)
/**
+ * The layout direction of the layout node.
+ */
+ var layoutDirection: LayoutDirection? = null
+ get() {
+ if (field == null) {
+ // root node doesn't have a parent but its LD value is set during root creation
+ field = parentLayoutNode?.layoutDirection
+ }
+ return field
+ }
+
+ /**
* Implementation oddity around composition; used to capture a reference to this
* [LayoutNode] when composed. This is a reverse property that mutates its right-hand side.
*/
@@ -1412,7 +1424,8 @@
override fun measure(
measureScope: MeasureScope,
measurables: List<Measurable>,
- constraints: Constraints
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
) = error("Undefined measure and it is required")
}
diff --git a/ui/ui-platform/src/main/java/androidx/ui/core/LayoutNodeWrapper.kt b/ui/ui-platform/src/main/java/androidx/ui/core/LayoutNodeWrapper.kt
index 94de704..09f98c7 100644
--- a/ui/ui-platform/src/main/java/androidx/ui/core/LayoutNodeWrapper.kt
+++ b/ui/ui-platform/src/main/java/androidx/ui/core/LayoutNodeWrapper.kt
@@ -232,7 +232,8 @@
val layoutResult = layoutNode.measureBlocks.measure(
layoutNode.measureScope,
layoutNode.layoutChildren,
- constraints
+ constraints,
+ layoutNode.layoutDirection!!
)
layoutNode.handleLayoutResult(layoutResult)
return this
@@ -241,33 +242,41 @@
override val parentData: Any?
get() = layoutNode.parentDataNode?.value
- override fun minIntrinsicWidth(height: IntPx): IntPx =
- layoutNode.measureBlocks.minIntrinsicWidth(
+ override fun minIntrinsicWidth(height: IntPx): IntPx {
+ return layoutNode.measureBlocks.minIntrinsicWidth(
layoutNode.measureScope,
layoutNode.layoutChildren,
- height
+ height,
+ layoutNode.layoutDirection!!
)
+ }
- override fun minIntrinsicHeight(width: IntPx): IntPx =
- layoutNode.measureBlocks.minIntrinsicHeight(
+ override fun minIntrinsicHeight(width: IntPx): IntPx {
+ return layoutNode.measureBlocks.minIntrinsicHeight(
layoutNode.measureScope,
layoutNode.layoutChildren,
- width
+ width,
+ layoutNode.layoutDirection!!
)
+ }
- override fun maxIntrinsicWidth(height: IntPx): IntPx =
- layoutNode.measureBlocks.maxIntrinsicWidth(
+ override fun maxIntrinsicWidth(height: IntPx): IntPx {
+ return layoutNode.measureBlocks.maxIntrinsicWidth(
layoutNode.measureScope,
layoutNode.layoutChildren,
- height
+ height,
+ layoutNode.layoutDirection!!
)
+ }
- override fun maxIntrinsicHeight(width: IntPx): IntPx =
- layoutNode.measureBlocks.maxIntrinsicHeight(
+ override fun maxIntrinsicHeight(width: IntPx): IntPx {
+ return layoutNode.measureBlocks.maxIntrinsicHeight(
layoutNode.measureScope,
layoutNode.layoutChildren,
- width
+ width,
+ layoutNode.layoutDirection!!
)
+ }
override fun place(position: IntPxPosition) {
layoutNode.isPlaced = true
@@ -360,7 +369,9 @@
override fun measure(constraints: Constraints): Placeable = with(layoutModifier) {
updateLayoutDirection()
val measureResult = withMeasuredConstraints(constraints) {
- wrapped.measure(layoutNode.measureScope.modifyConstraints(constraints))
+ wrapped.measure(
+ layoutNode.measureScope.modifyConstraints(constraints, layoutNode.layoutDirection!!)
+ )
}
measuredPlaceable = measureResult
this@ModifiedLayoutNode
@@ -368,40 +379,52 @@
override fun minIntrinsicWidth(height: IntPx): IntPx = with(layoutModifier) {
updateLayoutDirection()
- layoutNode.measureScope.minIntrinsicWidthOf(wrapped, height)
+ layoutNode.measureScope.minIntrinsicWidthOf(wrapped, height, layoutNode.layoutDirection!!)
}
override fun maxIntrinsicWidth(height: IntPx): IntPx = with(layoutModifier) {
updateLayoutDirection()
- layoutNode.measureScope.maxIntrinsicWidthOf(wrapped, height)
+ layoutNode.measureScope.maxIntrinsicWidthOf(wrapped, height, layoutNode.layoutDirection!!)
}
override fun minIntrinsicHeight(width: IntPx): IntPx = with(layoutModifier) {
updateLayoutDirection()
- layoutNode.measureScope.minIntrinsicHeightOf(wrapped, width)
+ layoutNode.measureScope.minIntrinsicHeightOf(wrapped, width, layoutNode.layoutDirection!!)
}
override fun maxIntrinsicHeight(width: IntPx): IntPx = with(layoutModifier) {
updateLayoutDirection()
- layoutNode.measureScope.maxIntrinsicHeightOf(wrapped, width)
+ layoutNode.measureScope.maxIntrinsicHeightOf(wrapped, width, layoutNode.layoutDirection!!)
}
override fun place(position: IntPxPosition) {
this.position = position
val placeable = measuredPlaceable ?: error("Placeable not measured")
val relativePosition = with(layoutModifier) {
- layoutNode.measureScope.modifyPosition(placeable.size, size)
+ layoutNode.measureScope.modifyPosition(
+ placeable.size,
+ size,
+ layoutNode.layoutDirection!!
+ )
}
placeable.place(relativePosition)
}
override operator fun get(line: AlignmentLine): IntPx? = with(layoutModifier) {
- return layoutNode.measureScope.modifyAlignmentLine(line, super.get(line))
+ return layoutNode.measureScope.modifyAlignmentLine(
+ line,
+ super.get(line),
+ layoutNode.layoutDirection!!
+ )
}
override fun layoutSize(innermostSize: IntPxSize): IntPxSize = with(layoutModifier) {
val constraints = measuredConstraints ?: error("must be called during measurement")
- layoutNode.measureScope.modifySize(constraints, wrapped.layoutSize(innermostSize)).also {
+ layoutNode.measureScope.modifySize(
+ constraints,
+ layoutNode.layoutDirection!!,
+ wrapped.layoutSize(innermostSize)
+ ).also {
size = it
}
}
@@ -424,7 +447,9 @@
}
private fun updateLayoutDirection() = with(layoutModifier) {
- layoutNode.measureScope.layoutDirection = layoutNode.measureScope.modifyLayoutDirection()
+ val modifiedLayoutDirection =
+ layoutNode.measureScope.modifyLayoutDirection(layoutNode.layoutDirection!!)
+ layoutNode.layoutDirection = modifiedLayoutDirection
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/IsDisplayedTests.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/IsDisplayedTests.kt
index c2701dc..f5ced55 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/IsDisplayedTests.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/IsDisplayedTests.kt
@@ -110,7 +110,7 @@
val thirdNode = @Composable {
Layout({
lastNode()
- }) { measurables, constraints ->
+ }) { measurables, constraints, _ ->
val placeable = measurables[0].measure(constraints)
layout(0.ipx, 0.ipx) {
placeable.place(0.ipx, 0.ipx)
@@ -121,7 +121,7 @@
val secondNode = @Composable {
Layout({
thirdNode()
- }) { measurables, constraints ->
+ }) { measurables, constraints, _ ->
if (model.value) {
val placeable = measurables[0].measure(constraints)
layout(0.ipx, 0.ipx) {
@@ -136,7 +136,7 @@
val topNode = @Composable {
Layout({
secondNode()
- }) { measurables, constraints ->
+ }) { measurables, constraints, _ ->
if (model.value) {
val placeable = measurables[0].measure(constraints)
layout(0.ipx, 0.ipx) {
@@ -177,7 +177,7 @@
}
}
}
- }) { measurables, constraints ->
+ }) { measurables, constraints, _ ->
val placeable =
measurables[0].measure(constraints.copy(maxWidth = IntPx.Infinity))
layout(placeable.width, placeable.height) {
diff --git a/ui/ui-text/integration-tests/text-demos/src/main/java/androidx/ui/text/demos/ComposeVariousInputField.kt b/ui/ui-text/integration-tests/text-demos/src/main/java/androidx/ui/text/demos/ComposeVariousInputField.kt
index 64cc0bd..39c26ac 100644
--- a/ui/ui-text/integration-tests/text-demos/src/main/java/androidx/ui/text/demos/ComposeVariousInputField.kt
+++ b/ui/ui-text/integration-tests/text-demos/src/main/java/androidx/ui/text/demos/ComposeVariousInputField.kt
@@ -277,7 +277,7 @@
Layout({
inputField()
Container(LayoutTag("hintText"), children = hintText)
- }) { measurable, constraints ->
+ }) { measurable, constraints, _ ->
val inputFieldPlacable =
measurable.first { it.tag == "inputField" }.measure(constraints)
val hintTextPlacable = measurable.first { it.tag == "hintText" }.measure(constraints)