Change module and package of Dp, IntPx, etc to unit.
Moved units into ui-unit. Moved some basic utilities
to ui-util. Moved rect, etc into ui-geometry.
This is a start to making proper packages for ui-core classes.
Test: ran tests and connectedCheck
Change-Id: I45fe4a154c0f91cb1526cd73aad6e6e8bed3616a
diff --git a/ui/ui-layout/integration-tests/layout-demos/src/main/java/androidx/ui/layout/demos/ComplexLayoutDemos.kt b/ui/ui-layout/integration-tests/layout-demos/src/main/java/androidx/ui/layout/demos/ComplexLayoutDemos.kt
index 7a3690b4..2e0fd92 100644
--- a/ui/ui-layout/integration-tests/layout-demos/src/main/java/androidx/ui/layout/demos/ComplexLayoutDemos.kt
+++ b/ui/ui-layout/integration-tests/layout-demos/src/main/java/androidx/ui/layout/demos/ComplexLayoutDemos.kt
@@ -20,39 +20,39 @@
import androidx.compose.Composable
import androidx.compose.Model
import androidx.compose.onCommit
+import androidx.compose.remember
import androidx.ui.core.Alignment
import androidx.ui.core.Constraints
import androidx.ui.core.Draw
import androidx.ui.core.FirstBaseline
import androidx.ui.core.HorizontalAlignmentLine
-import androidx.ui.core.IntPx
-import androidx.ui.core.IntPxSize
import androidx.ui.core.Layout
import androidx.ui.core.Text
import androidx.ui.core.VerticalAlignmentLine
import androidx.ui.core.WithConstraints
import androidx.ui.core.constrain
-import androidx.ui.core.dp
-import androidx.ui.core.ipx
-import androidx.ui.core.max
-import androidx.ui.core.sp
-import androidx.ui.core.toRect
import androidx.ui.graphics.Color
import androidx.ui.graphics.Paint
import androidx.ui.layout.Align
-import androidx.ui.layout.LayoutAlign
import androidx.ui.layout.AlignmentLineOffset
import androidx.ui.layout.Column
+import androidx.ui.layout.LayoutAlign
import androidx.ui.layout.LayoutGravity
import androidx.ui.layout.LayoutPadding
import androidx.ui.layout.Padding
import androidx.ui.layout.Row
import androidx.ui.layout.Stack
-import androidx.compose.remember
import androidx.ui.layout.Wrap
import androidx.ui.layout.samples.DrawRectangle
import androidx.ui.layout.samples.SizedRectangle
import androidx.ui.text.TextStyle
+import androidx.ui.unit.IntPx
+import androidx.ui.unit.IntPxSize
+import androidx.ui.unit.dp
+import androidx.ui.unit.ipx
+import androidx.ui.unit.max
+import androidx.ui.unit.sp
+import androidx.ui.unit.toRect
/**
* A composable that forces its only child to be as wide as its min intrinsic width.
diff --git a/ui/ui-layout/integration-tests/layout-demos/src/main/java/androidx/ui/layout/demos/ConstraintLayoutActivity.kt b/ui/ui-layout/integration-tests/layout-demos/src/main/java/androidx/ui/layout/demos/ConstraintLayoutActivity.kt
index b24948e..01dd8b3 100644
--- a/ui/ui-layout/integration-tests/layout-demos/src/main/java/androidx/ui/layout/demos/ConstraintLayoutActivity.kt
+++ b/ui/ui-layout/integration-tests/layout-demos/src/main/java/androidx/ui/layout/demos/ConstraintLayoutActivity.kt
@@ -22,16 +22,16 @@
import androidx.ui.core.Draw
import androidx.ui.core.LayoutTag
import androidx.ui.core.Text
-import androidx.ui.core.dp
import androidx.ui.core.setContent
-import androidx.ui.core.sp
-import androidx.ui.core.toRect
import androidx.ui.graphics.Color
import androidx.ui.graphics.Paint
import androidx.ui.layout.constraintlayout.ConstraintLayout
import androidx.ui.layout.constraintlayout.ConstraintSet
import androidx.ui.layout.constraintlayout.ConstraintSetBuilderScope
import androidx.ui.text.TextStyle
+import androidx.ui.unit.dp
+import androidx.ui.unit.sp
+import androidx.ui.unit.toRect
/**
* Simple ConstraintLayout demo
diff --git a/ui/ui-layout/integration-tests/layout-demos/src/main/java/androidx/ui/layout/demos/LayoutActivity.kt b/ui/ui-layout/integration-tests/layout-demos/src/main/java/androidx/ui/layout/demos/LayoutActivity.kt
index 8e5ab43..7287d7f 100644
--- a/ui/ui-layout/integration-tests/layout-demos/src/main/java/androidx/ui/layout/demos/LayoutActivity.kt
+++ b/ui/ui-layout/integration-tests/layout-demos/src/main/java/androidx/ui/layout/demos/LayoutActivity.kt
@@ -18,25 +18,25 @@
import android.app.Activity
import android.os.Bundle
-import androidx.ui.core.Dp
-import androidx.ui.core.Text
-import androidx.ui.core.dp
-import androidx.ui.layout.Column
-import androidx.ui.layout.Container
-import androidx.ui.layout.LayoutHeight
-import androidx.ui.layout.Spacer
-import androidx.ui.layout.Row
-import androidx.ui.layout.LayoutWidth
-import androidx.ui.layout.Wrap
-import androidx.ui.graphics.Color
-import androidx.ui.text.TextStyle
import androidx.compose.Composable
import androidx.ui.core.Modifier
+import androidx.ui.core.Text
import androidx.ui.core.setContent
-import androidx.ui.core.sp
+import androidx.ui.graphics.Color
import androidx.ui.layout.Arrangement
+import androidx.ui.layout.Column
+import androidx.ui.layout.Container
import androidx.ui.layout.LayoutGravity
+import androidx.ui.layout.LayoutHeight
+import androidx.ui.layout.LayoutWidth
+import androidx.ui.layout.Row
+import androidx.ui.layout.Spacer
+import androidx.ui.layout.Wrap
import androidx.ui.layout.samples.DrawRectangle
+import androidx.ui.text.TextStyle
+import androidx.ui.unit.Dp
+import androidx.ui.unit.dp
+import androidx.ui.unit.sp
class LayoutActivity : Activity() {
diff --git a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/AlignSample.kt b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/AlignSample.kt
index 8abbe94..c85e53b 100644
--- a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/AlignSample.kt
+++ b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/AlignSample.kt
@@ -19,16 +19,16 @@
import androidx.annotation.Sampled
import androidx.compose.Composable
import androidx.ui.core.Alignment
-import androidx.ui.core.dp
import androidx.ui.graphics.Color
import androidx.ui.layout.Align
-import androidx.ui.layout.LayoutAlign
import androidx.ui.layout.Center
import androidx.ui.layout.Column
+import androidx.ui.layout.LayoutAlign
import androidx.ui.layout.LayoutGravity
import androidx.ui.layout.LayoutHeight
import androidx.ui.layout.LayoutWidth
import androidx.ui.layout.Row
+import androidx.ui.unit.dp
@Sampled
@Composable
diff --git a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/AspectRatioSample.kt b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/AspectRatioSample.kt
index 55151bc..13a5d76 100644
--- a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/AspectRatioSample.kt
+++ b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/AspectRatioSample.kt
@@ -18,12 +18,12 @@
import androidx.annotation.Sampled
import androidx.compose.Composable
-import androidx.ui.core.dp
import androidx.ui.foundation.ColoredRect
import androidx.ui.graphics.Color
-import androidx.ui.layout.LayoutAspectRatio
import androidx.ui.layout.Container
import androidx.ui.layout.DpConstraints
+import androidx.ui.layout.LayoutAspectRatio
+import androidx.ui.unit.dp
@Sampled
@Composable
diff --git a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/FlexSample.kt b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/FlexSample.kt
index 92b377d..18f02be1 100644
--- a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/FlexSample.kt
+++ b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/FlexSample.kt
@@ -20,8 +20,6 @@
import androidx.compose.Composable
import androidx.ui.core.FirstBaseline
import androidx.ui.core.Text
-import androidx.ui.core.dp
-import androidx.ui.core.ipx
import androidx.ui.graphics.Color
import androidx.ui.layout.Column
import androidx.ui.layout.Container
@@ -29,6 +27,8 @@
import androidx.ui.layout.LayoutHeight
import androidx.ui.layout.Row
import androidx.ui.text.TextStyle
+import androidx.ui.unit.dp
+import androidx.ui.unit.ipx
@Sampled
@Composable
diff --git a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/FlowSample.kt b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/FlowSample.kt
index d7cfac0..09695db 100644
--- a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/FlowSample.kt
+++ b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/FlowSample.kt
@@ -18,10 +18,10 @@
import androidx.annotation.Sampled
import androidx.compose.Composable
-import androidx.ui.core.dp
import androidx.ui.graphics.Color
import androidx.ui.layout.FlowColumn
import androidx.ui.layout.FlowRow
+import androidx.ui.unit.dp
val sizes = listOf(
50.dp, 50.dp, 50.dp, 30.dp, 40.dp, 110.dp, 100.dp, 40.dp, 30.dp,
diff --git a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/IntrinsicSample.kt b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/IntrinsicSample.kt
index ad740f9b..ec52991 100644
--- a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/IntrinsicSample.kt
+++ b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/IntrinsicSample.kt
@@ -19,7 +19,6 @@
import androidx.annotation.Sampled
import androidx.compose.Composable
import androidx.ui.core.Text
-import androidx.ui.core.dp
import androidx.ui.foundation.shape.DrawShape
import androidx.ui.foundation.shape.RectangleShape
import androidx.ui.graphics.Color
@@ -35,6 +34,7 @@
import androidx.ui.layout.MinIntrinsicWidth
import androidx.ui.layout.Row
import androidx.ui.layout.Wrap
+import androidx.ui.unit.dp
/**
* Builds a layout containing three [Container] having the same width as the widest one.
diff --git a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/LayoutPaddingSample.kt b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/LayoutPaddingSample.kt
index 37210ce5..7e33a32 100644
--- a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/LayoutPaddingSample.kt
+++ b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/LayoutPaddingSample.kt
@@ -19,13 +19,13 @@
import androidx.annotation.Sampled
import androidx.compose.Composable
import androidx.ui.core.Alignment
-import androidx.ui.core.dp
import androidx.ui.graphics.Color
import androidx.ui.layout.Align
import androidx.ui.layout.Container
import androidx.ui.layout.EdgeInsets
import androidx.ui.layout.LayoutPadding
import androidx.ui.layout.Padding
+import androidx.ui.unit.dp
@Sampled
@Composable
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 b30d4ac..b0c6a29 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
@@ -17,16 +17,16 @@
package androidx.ui.layout.samples
import androidx.compose.Composable
-import androidx.ui.core.Dp
import androidx.ui.core.Layout
import androidx.ui.core.Modifier
import androidx.ui.core.VerticalAlignmentLine
-import androidx.ui.core.ipx
-import androidx.ui.core.max
-import androidx.ui.core.min
import androidx.ui.foundation.shape.DrawShape
import androidx.ui.foundation.shape.RectangleShape
import androidx.ui.graphics.Color
+import androidx.ui.unit.Dp
+import androidx.ui.unit.ipx
+import androidx.ui.unit.max
+import androidx.ui.unit.min
/**
* A rectangle layout that tries to size itself to specified width and height, subject to
diff --git a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/SizeModifierSample.kt b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/SizeModifierSample.kt
index 97b2453..18d0b56 100644
--- a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/SizeModifierSample.kt
+++ b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/SizeModifierSample.kt
@@ -19,18 +19,18 @@
import androidx.annotation.Sampled
import androidx.compose.Composable
import androidx.ui.core.Alignment
-import androidx.ui.core.dp
import androidx.ui.foundation.ColoredRect
import androidx.ui.foundation.shape.DrawShape
import androidx.ui.foundation.shape.RectangleShape
import androidx.ui.graphics.Color
import androidx.ui.layout.Align
-import androidx.ui.layout.LayoutAspectRatio
import androidx.ui.layout.Center
import androidx.ui.layout.Container
+import androidx.ui.layout.LayoutAspectRatio
import androidx.ui.layout.LayoutHeight
import androidx.ui.layout.LayoutSize
import androidx.ui.layout.LayoutWidth
+import androidx.ui.unit.dp
@Sampled
@Composable
diff --git a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/SpacerSample.kt b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/SpacerSample.kt
index 6a8ca70..ec217bc 100644
--- a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/SpacerSample.kt
+++ b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/SpacerSample.kt
@@ -18,11 +18,11 @@
import androidx.annotation.Sampled
import androidx.compose.Composable
-import androidx.ui.core.dp
import androidx.ui.graphics.Color
+import androidx.ui.layout.LayoutWidth
import androidx.ui.layout.Row
import androidx.ui.layout.Spacer
-import androidx.ui.layout.LayoutWidth
+import androidx.ui.unit.dp
@Sampled
@Composable
diff --git a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/StackSample.kt b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/StackSample.kt
index 67afd8d..812a860 100644
--- a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/StackSample.kt
+++ b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/StackSample.kt
@@ -18,12 +18,12 @@
import androidx.annotation.Sampled
import androidx.compose.Composable
-import androidx.ui.core.dp
import androidx.ui.graphics.Color
import androidx.ui.layout.LayoutGravity
import androidx.ui.layout.LayoutPadding
import androidx.ui.layout.LayoutSize
import androidx.ui.layout.Stack
+import androidx.ui.unit.dp
@Sampled
@Composable
diff --git a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/TableSample.kt b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/TableSample.kt
index 8ecdd34..9907ea0 100644
--- a/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/TableSample.kt
+++ b/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/TableSample.kt
@@ -18,8 +18,6 @@
import androidx.annotation.Sampled
import androidx.compose.Composable
-import androidx.ui.core.Dp
-import androidx.ui.core.dp
import androidx.ui.foundation.shape.DrawShape
import androidx.ui.foundation.shape.corner.CircleShape
import androidx.ui.graphics.Color
@@ -27,6 +25,8 @@
import androidx.ui.layout.Padding
import androidx.ui.layout.Table
import androidx.ui.layout.TableColumnWidth
+import androidx.ui.unit.Dp
+import androidx.ui.unit.dp
@Sampled
@Composable