Fixed
Status Update
Comments
je...@google.com <je...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit f1efe6700e7d878703da650b01f059b831f5c473
Author: Jelle Fresen <jellefresen@google.com>
Date: Thu Jul 02 15:24:59 2020
Use unclipped bounds when asserting node bounds
When asserting bounds and positions of nodes, unclipped bounds are
preferred over clipped bounds. Otherwise you won't be able to
distinguish between a correctly positioned node that is clipped to
certain bounds, and an incorrectly positioned node that happens to be
clipped to the same bounds.
Add positionInRoot to the SemanticsNode API and use the unclipped bounds
in BoundsAssertions.
Fixes: 161336532
Test: ./gradlew ui:ui-test:cC
Relnote: "Added `SemanticsNode.positionInRoot` to get the position of a
SemanticsNode relative to the root of the Compose hierarchy"
Change-Id: Icdf262558341d6441ae91dfb8807d19f88f5b3fb
M ui/ui-core/api/0.1.0-dev16.txt
M ui/ui-core/api/current.txt
M ui/ui-core/api/public_plus_experimental_0.1.0-dev16.txt
M ui/ui-core/api/public_plus_experimental_current.txt
M ui/ui-core/api/restricted_0.1.0-dev16.txt
M ui/ui-core/api/restricted_current.txt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsNode.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/assertions/BoundsAssertionsTest.kt
M ui/ui-test/src/main/java/androidx/ui/test/Assertions.kt
M ui/ui-test/src/main/java/androidx/ui/test/BoundsAssertions.kt
M ui/ui-test/src/main/java/androidx/ui/test/Output.kt
https://android-review.googlesource.com/1366919
Branch: androidx-master-dev
commit f1efe6700e7d878703da650b01f059b831f5c473
Author: Jelle Fresen <jellefresen@google.com>
Date: Thu Jul 02 15:24:59 2020
Use unclipped bounds when asserting node bounds
When asserting bounds and positions of nodes, unclipped bounds are
preferred over clipped bounds. Otherwise you won't be able to
distinguish between a correctly positioned node that is clipped to
certain bounds, and an incorrectly positioned node that happens to be
clipped to the same bounds.
Add positionInRoot to the SemanticsNode API and use the unclipped bounds
in BoundsAssertions.
Fixes: 161336532
Test: ./gradlew ui:ui-test:cC
Relnote: "Added `SemanticsNode.positionInRoot` to get the position of a
SemanticsNode relative to the root of the Compose hierarchy"
Change-Id: Icdf262558341d6441ae91dfb8807d19f88f5b3fb
M ui/ui-core/api/0.1.0-dev16.txt
M ui/ui-core/api/current.txt
M ui/ui-core/api/public_plus_experimental_0.1.0-dev16.txt
M ui/ui-core/api/public_plus_experimental_current.txt
M ui/ui-core/api/restricted_0.1.0-dev16.txt
M ui/ui-core/api/restricted_current.txt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsNode.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/assertions/BoundsAssertionsTest.kt
M ui/ui-test/src/main/java/androidx/ui/test/Assertions.kt
M ui/ui-test/src/main/java/androidx/ui/test/BoundsAssertions.kt
M ui/ui-test/src/main/java/androidx/ui/test/Output.kt
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit d714d90ed827e4ece35d8d3803a4243344d174d5
Author: Jelle Fresen <jellefresen@google.com>
Date: Tue Jul 21 18:32:55 2020
Rename bounds to unclippedBounds in SemanticsNodeInteraction API
The functions in SemanticsNodeInteraction that refer to "bounds" are now
actually using unclipped bounds. Make this explicit to avoid confusion
with "bounds" in SemanticsNode, where it exclusively refers to _clipped_
bounds.
Bug: 161336532
Test: ./gradlew ui:ui-test:cC
Relnote: "Renamed `SemanticsNodeInteraction.getBoundsInRoot()` to
`SemanticsNodeInteraction.getUnclippedBoundsInRoot()`"
Change-Id: Icafdf63b2e2f03f48d5b51371e733917dedcf422
M ui/ui-foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyColumnForTest.kt
M ui/ui-foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyRowForTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/AppBarTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/BottomNavigationTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/SnackbarTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/TabTest.kt
M ui/ui-test/api/current.txt
M ui/ui-test/api/public_plus_experimental_current.txt
M ui/ui-test/api/restricted_current.txt
M ui/ui-test/src/main/java/androidx/ui/test/BoundsAssertions.kt
https://android-review.googlesource.com/1369517
Branch: androidx-master-dev
commit d714d90ed827e4ece35d8d3803a4243344d174d5
Author: Jelle Fresen <jellefresen@google.com>
Date: Tue Jul 21 18:32:55 2020
Rename bounds to unclippedBounds in SemanticsNodeInteraction API
The functions in SemanticsNodeInteraction that refer to "bounds" are now
actually using unclipped bounds. Make this explicit to avoid confusion
with "bounds" in SemanticsNode, where it exclusively refers to _clipped_
bounds.
Bug: 161336532
Test: ./gradlew ui:ui-test:cC
Relnote: "Renamed `SemanticsNodeInteraction.getBoundsInRoot()` to
`SemanticsNodeInteraction.getUnclippedBoundsInRoot()`"
Change-Id: Icafdf63b2e2f03f48d5b51371e733917dedcf422
M ui/ui-foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyColumnForTest.kt
M ui/ui-foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyRowForTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/AppBarTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/BottomNavigationTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/SnackbarTest.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/TabTest.kt
M ui/ui-test/api/current.txt
M ui/ui-test/api/public_plus_experimental_current.txt
M ui/ui-test/api/restricted_current.txt
M ui/ui-test/src/main/java/androidx/ui/test/BoundsAssertions.kt
Description
When asserting the position of a node, or when printing positions of nodes in the semantics tree, use the unclipped bounds instead of the clipped bounds. Using the clipped bounds is confusing to the user, and makes it impossible to distinguish between a correctly sized node that is clipped to size S, and an incorrectly sized node that is clipped to size S.