Add IntBounds. Use it in Menus and ui-tooling.
Relnote: An IntBounds unit class has been added, representing integer pixel bounds from layout. The API of PopupPositionProvider has been updated to use it.
Bug: 159596546
Test: IntBoundsTest, PopupTest
Change-Id: I0d8d03c5535c80c6808d8f9ca7a210408890e6e7
diff --git a/ui/ui-unit/api/0.1.0-dev15.txt b/ui/ui-unit/api/0.1.0-dev15.txt
index ddc351f..7fe4172 100644
--- a/ui/ui-unit/api/0.1.0-dev15.txt
+++ b/ui/ui-unit/api/0.1.0-dev15.txt
@@ -259,6 +259,29 @@
field public static final long SecondsPerMinute = 60L; // 0x3cL
}
+ @androidx.compose.Immutable public final class IntBounds {
+ ctor public IntBounds(int left, int top, int right, int bottom);
+ method public int component1();
+ method public int component2();
+ method public int component3();
+ method public int component4();
+ method @androidx.compose.Immutable public androidx.ui.unit.IntBounds copy(int left, int top, int right, int bottom);
+ method public int getBottom();
+ method public int getLeft();
+ method public int getRight();
+ method public int getTop();
+ }
+
+ public final class IntBoundsKt {
+ method @androidx.compose.Stable public static inline androidx.ui.unit.IntBounds IntBounds(androidx.ui.unit.IntOffset topLeft, androidx.ui.unit.IntSize size);
+ method @androidx.compose.Stable public static inline androidx.ui.unit.IntOffset center(androidx.ui.unit.IntBounds);
+ method public static inline int getHeight(androidx.ui.unit.IntBounds);
+ method public static inline int getWidth(androidx.ui.unit.IntBounds);
+ method @androidx.compose.Stable public static androidx.ui.unit.IntBounds toBounds(androidx.ui.unit.IntSize);
+ method @androidx.compose.Stable public static androidx.ui.geometry.Rect toRect(androidx.ui.unit.IntBounds);
+ method @androidx.compose.Stable public static androidx.ui.unit.IntSize toSize(androidx.ui.unit.IntBounds);
+ }
+
@androidx.compose.Immutable public final class IntOffset {
ctor public IntOffset(internal long value);
method @androidx.compose.Stable public inline operator int component1();
diff --git a/ui/ui-unit/api/current.txt b/ui/ui-unit/api/current.txt
index ddc351f..7fe4172 100644
--- a/ui/ui-unit/api/current.txt
+++ b/ui/ui-unit/api/current.txt
@@ -259,6 +259,29 @@
field public static final long SecondsPerMinute = 60L; // 0x3cL
}
+ @androidx.compose.Immutable public final class IntBounds {
+ ctor public IntBounds(int left, int top, int right, int bottom);
+ method public int component1();
+ method public int component2();
+ method public int component3();
+ method public int component4();
+ method @androidx.compose.Immutable public androidx.ui.unit.IntBounds copy(int left, int top, int right, int bottom);
+ method public int getBottom();
+ method public int getLeft();
+ method public int getRight();
+ method public int getTop();
+ }
+
+ public final class IntBoundsKt {
+ method @androidx.compose.Stable public static inline androidx.ui.unit.IntBounds IntBounds(androidx.ui.unit.IntOffset topLeft, androidx.ui.unit.IntSize size);
+ method @androidx.compose.Stable public static inline androidx.ui.unit.IntOffset center(androidx.ui.unit.IntBounds);
+ method public static inline int getHeight(androidx.ui.unit.IntBounds);
+ method public static inline int getWidth(androidx.ui.unit.IntBounds);
+ method @androidx.compose.Stable public static androidx.ui.unit.IntBounds toBounds(androidx.ui.unit.IntSize);
+ method @androidx.compose.Stable public static androidx.ui.geometry.Rect toRect(androidx.ui.unit.IntBounds);
+ method @androidx.compose.Stable public static androidx.ui.unit.IntSize toSize(androidx.ui.unit.IntBounds);
+ }
+
@androidx.compose.Immutable public final class IntOffset {
ctor public IntOffset(internal long value);
method @androidx.compose.Stable public inline operator int component1();
diff --git a/ui/ui-unit/api/public_plus_experimental_0.1.0-dev15.txt b/ui/ui-unit/api/public_plus_experimental_0.1.0-dev15.txt
index ddc351f..7fe4172 100644
--- a/ui/ui-unit/api/public_plus_experimental_0.1.0-dev15.txt
+++ b/ui/ui-unit/api/public_plus_experimental_0.1.0-dev15.txt
@@ -259,6 +259,29 @@
field public static final long SecondsPerMinute = 60L; // 0x3cL
}
+ @androidx.compose.Immutable public final class IntBounds {
+ ctor public IntBounds(int left, int top, int right, int bottom);
+ method public int component1();
+ method public int component2();
+ method public int component3();
+ method public int component4();
+ method @androidx.compose.Immutable public androidx.ui.unit.IntBounds copy(int left, int top, int right, int bottom);
+ method public int getBottom();
+ method public int getLeft();
+ method public int getRight();
+ method public int getTop();
+ }
+
+ public final class IntBoundsKt {
+ method @androidx.compose.Stable public static inline androidx.ui.unit.IntBounds IntBounds(androidx.ui.unit.IntOffset topLeft, androidx.ui.unit.IntSize size);
+ method @androidx.compose.Stable public static inline androidx.ui.unit.IntOffset center(androidx.ui.unit.IntBounds);
+ method public static inline int getHeight(androidx.ui.unit.IntBounds);
+ method public static inline int getWidth(androidx.ui.unit.IntBounds);
+ method @androidx.compose.Stable public static androidx.ui.unit.IntBounds toBounds(androidx.ui.unit.IntSize);
+ method @androidx.compose.Stable public static androidx.ui.geometry.Rect toRect(androidx.ui.unit.IntBounds);
+ method @androidx.compose.Stable public static androidx.ui.unit.IntSize toSize(androidx.ui.unit.IntBounds);
+ }
+
@androidx.compose.Immutable public final class IntOffset {
ctor public IntOffset(internal long value);
method @androidx.compose.Stable public inline operator int component1();
diff --git a/ui/ui-unit/api/public_plus_experimental_current.txt b/ui/ui-unit/api/public_plus_experimental_current.txt
index ddc351f..7fe4172 100644
--- a/ui/ui-unit/api/public_plus_experimental_current.txt
+++ b/ui/ui-unit/api/public_plus_experimental_current.txt
@@ -259,6 +259,29 @@
field public static final long SecondsPerMinute = 60L; // 0x3cL
}
+ @androidx.compose.Immutable public final class IntBounds {
+ ctor public IntBounds(int left, int top, int right, int bottom);
+ method public int component1();
+ method public int component2();
+ method public int component3();
+ method public int component4();
+ method @androidx.compose.Immutable public androidx.ui.unit.IntBounds copy(int left, int top, int right, int bottom);
+ method public int getBottom();
+ method public int getLeft();
+ method public int getRight();
+ method public int getTop();
+ }
+
+ public final class IntBoundsKt {
+ method @androidx.compose.Stable public static inline androidx.ui.unit.IntBounds IntBounds(androidx.ui.unit.IntOffset topLeft, androidx.ui.unit.IntSize size);
+ method @androidx.compose.Stable public static inline androidx.ui.unit.IntOffset center(androidx.ui.unit.IntBounds);
+ method public static inline int getHeight(androidx.ui.unit.IntBounds);
+ method public static inline int getWidth(androidx.ui.unit.IntBounds);
+ method @androidx.compose.Stable public static androidx.ui.unit.IntBounds toBounds(androidx.ui.unit.IntSize);
+ method @androidx.compose.Stable public static androidx.ui.geometry.Rect toRect(androidx.ui.unit.IntBounds);
+ method @androidx.compose.Stable public static androidx.ui.unit.IntSize toSize(androidx.ui.unit.IntBounds);
+ }
+
@androidx.compose.Immutable public final class IntOffset {
ctor public IntOffset(internal long value);
method @androidx.compose.Stable public inline operator int component1();
diff --git a/ui/ui-unit/api/restricted_0.1.0-dev15.txt b/ui/ui-unit/api/restricted_0.1.0-dev15.txt
index 293c6ed..a9c734a 100644
--- a/ui/ui-unit/api/restricted_0.1.0-dev15.txt
+++ b/ui/ui-unit/api/restricted_0.1.0-dev15.txt
@@ -259,6 +259,29 @@
field public static final long SecondsPerMinute = 60L; // 0x3cL
}
+ @androidx.compose.Immutable public final class IntBounds {
+ ctor public IntBounds(int left, int top, int right, int bottom);
+ method public int component1();
+ method public int component2();
+ method public int component3();
+ method public int component4();
+ method @androidx.compose.Immutable public androidx.ui.unit.IntBounds copy(int left, int top, int right, int bottom);
+ method public int getBottom();
+ method public int getLeft();
+ method public int getRight();
+ method public int getTop();
+ }
+
+ public final class IntBoundsKt {
+ method @androidx.compose.Stable public static inline androidx.ui.unit.IntBounds IntBounds(androidx.ui.unit.IntOffset topLeft, androidx.ui.unit.IntSize size);
+ method @androidx.compose.Stable public static inline androidx.ui.unit.IntOffset center(androidx.ui.unit.IntBounds);
+ method public static inline int getHeight(androidx.ui.unit.IntBounds);
+ method public static inline int getWidth(androidx.ui.unit.IntBounds);
+ method @androidx.compose.Stable public static androidx.ui.unit.IntBounds toBounds(androidx.ui.unit.IntSize);
+ method @androidx.compose.Stable public static androidx.ui.geometry.Rect toRect(androidx.ui.unit.IntBounds);
+ method @androidx.compose.Stable public static androidx.ui.unit.IntSize toSize(androidx.ui.unit.IntBounds);
+ }
+
@androidx.compose.Immutable public final class IntOffset {
ctor public IntOffset(internal long value);
method @androidx.compose.Stable public inline operator int component1();
diff --git a/ui/ui-unit/api/restricted_current.txt b/ui/ui-unit/api/restricted_current.txt
index 293c6ed..a9c734a 100644
--- a/ui/ui-unit/api/restricted_current.txt
+++ b/ui/ui-unit/api/restricted_current.txt
@@ -259,6 +259,29 @@
field public static final long SecondsPerMinute = 60L; // 0x3cL
}
+ @androidx.compose.Immutable public final class IntBounds {
+ ctor public IntBounds(int left, int top, int right, int bottom);
+ method public int component1();
+ method public int component2();
+ method public int component3();
+ method public int component4();
+ method @androidx.compose.Immutable public androidx.ui.unit.IntBounds copy(int left, int top, int right, int bottom);
+ method public int getBottom();
+ method public int getLeft();
+ method public int getRight();
+ method public int getTop();
+ }
+
+ public final class IntBoundsKt {
+ method @androidx.compose.Stable public static inline androidx.ui.unit.IntBounds IntBounds(androidx.ui.unit.IntOffset topLeft, androidx.ui.unit.IntSize size);
+ method @androidx.compose.Stable public static inline androidx.ui.unit.IntOffset center(androidx.ui.unit.IntBounds);
+ method public static inline int getHeight(androidx.ui.unit.IntBounds);
+ method public static inline int getWidth(androidx.ui.unit.IntBounds);
+ method @androidx.compose.Stable public static androidx.ui.unit.IntBounds toBounds(androidx.ui.unit.IntSize);
+ method @androidx.compose.Stable public static androidx.ui.geometry.Rect toRect(androidx.ui.unit.IntBounds);
+ method @androidx.compose.Stable public static androidx.ui.unit.IntSize toSize(androidx.ui.unit.IntBounds);
+ }
+
@androidx.compose.Immutable public final class IntOffset {
ctor public IntOffset(internal long value);
method @androidx.compose.Stable public inline operator int component1();