Removal of Px usages part 5 of n
Relnote: "Replaced usage of Px class in various
compose classes as part of the large
refactoring effort to only rely on Dp
and primitive types for pixel parameters"
Bug: 156681014
Test: re-ran compose tests
Change-Id: Id343458210b56a9a4cdae4ef3d0f97ea79004942
diff --git a/ui/ui-core/src/androidTest/java/androidx/ui/core/test/OnPositionedTest.kt b/ui/ui-core/src/androidTest/java/androidx/ui/core/test/OnPositionedTest.kt
index 6c2cb50d..f1ce65a 100644
--- a/ui/ui-core/src/androidTest/java/androidx/ui/core/test/OnPositionedTest.kt
+++ b/ui/ui-core/src/androidTest/java/androidx/ui/core/test/OnPositionedTest.kt
@@ -77,7 +77,7 @@
minWidth = size,
minHeight = size,
modifier = Modifier.onPositioned { coordinates ->
- wrap1Position = coordinates.globalPosition.x
+ wrap1Position = coordinates.globalPosition.x.px
latch.countDown()
}
)
@@ -86,7 +86,7 @@
minWidth = size,
minHeight = size,
modifier = Modifier.onPositioned { coordinates ->
- wrap2Position = coordinates.globalPosition.x
+ wrap2Position = coordinates.globalPosition.x.px
latch.countDown()
}
)
@@ -148,7 +148,7 @@
@Test
fun callbackCalledForChildWhenParentMoved() {
var position by mutableStateOf(0.ipx)
- var childGlobalPosition = PxPosition(0.px, 0.px)
+ var childGlobalPosition = PxPosition(0f, 0f)
var latch = CountDownLatch(1)
rule.runOnUiThreadIR {
activity.setContent {
@@ -185,7 +185,7 @@
}
assertTrue(latch.await(1, TimeUnit.SECONDS))
- assertEquals(PxPosition(10.px, 0.px), childGlobalPosition)
+ assertEquals(PxPosition(10f, 0f), childGlobalPosition)
}
@Test
@@ -259,7 +259,7 @@
assertTrue(positionedLatch.await(1, TimeUnit.SECONDS))
rule.runOnUiThread {
- assertEquals(PxPosition(5.px, 5.px), coordinates!!.positionInParent)
+ assertEquals(PxPosition(5f, 5f), coordinates!!.positionInParent)
var root = coordinates!!
while (root.parentCoordinates != null) {