Fixed
Status Update
Comments
kl...@google.com <kl...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 1ecd58d4d36341aea4dba6a89331d1c884af7332
Author: Zach Klippenstein <klippenstein@google.com>
Date: Mon Jul 11 14:28:49 2022
Make contains function an operator on Rect, RoundRect, and MutableRect.
This allows the Kotlin syntax `offset in rect` as well as the more
traditional `rect.contains(offset)`.
This change should be binary and source backwards compatible, it simply
allows using the sugared syntax.
Fixes: b/238642990
Relnote: "`Rect`, `RoundRect`, and `MutableRect` now support the Kotlin
`in` syntax for calling the `contains` function."
Test: Updated tests to use `in` operator.
Test: ./gradlew :compose:ui:ui-geometry:test
Change-Id: Ie42b063455800b15524996628a4d6c94d4596ce8
M compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/Rect.kt
M compose/ui/ui-geometry/src/test/kotlin/androidx/compose/ui/geometry/RectTest.kt
M compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/RoundRect.kt
M compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/MutableRect.kt
M compose/ui/ui-geometry/api/public_plus_experimental_current.txt
M compose/ui/ui-geometry/api/restricted_current.txt
M compose/ui/ui-geometry/src/test/kotlin/androidx/compose/ui/geometry/MutableRectTest.kt
M compose/ui/ui-geometry/src/test/kotlin/androidx/compose/ui/geometry/RoundRectTest.kt
M compose/ui/ui-geometry/api/current.txt
https://android-review.googlesource.com/2150517
Branch: androidx-main
commit 1ecd58d4d36341aea4dba6a89331d1c884af7332
Author: Zach Klippenstein <klippenstein@google.com>
Date: Mon Jul 11 14:28:49 2022
Make contains function an operator on Rect, RoundRect, and MutableRect.
This allows the Kotlin syntax `offset in rect` as well as the more
traditional `rect.contains(offset)`.
This change should be binary and source backwards compatible, it simply
allows using the sugared syntax.
Fixes:
Relnote: "`Rect`, `RoundRect`, and `MutableRect` now support the Kotlin
`in` syntax for calling the `contains` function."
Test: Updated tests to use `in` operator.
Test: ./gradlew :compose:ui:ui-geometry:test
Change-Id: Ie42b063455800b15524996628a4d6c94d4596ce8
M compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/Rect.kt
M compose/ui/ui-geometry/src/test/kotlin/androidx/compose/ui/geometry/RectTest.kt
M compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/RoundRect.kt
M compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/MutableRect.kt
M compose/ui/ui-geometry/api/public_plus_experimental_current.txt
M compose/ui/ui-geometry/api/restricted_current.txt
M compose/ui/ui-geometry/src/test/kotlin/androidx/compose/ui/geometry/MutableRectTest.kt
M compose/ui/ui-geometry/src/test/kotlin/androidx/compose/ui/geometry/RoundRectTest.kt
M compose/ui/ui-geometry/api/current.txt
Description
Currently,
Rect
definesfun contains(offset: Offset): Boolean
, which is not marked asoperator
, but very well could be for cleaner usage.See class Rect