Fixed
Status Update
Comments
ma...@google.com <ma...@google.com>
mo...@google.com <mo...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit cdd20c9d43f86a8bf9749757330466794ec799ae
Author: George Mount <mount@google.com>
Date: Thu Dec 10 20:03:46 2020
Add common Unspecified helper methods.
Color has 3 useful methods/vals for managing the
Unspecified value: isSpecified, isUnspecified, and
useOrElse(). For consistency, we should have these
on all classes that have "Unspecified" constant values.
Relnote: "Added isSpecified, isUnspecified, and useOrElse for
inline classes with an Unspecified constant."
Fixes: 174310811
Test: new tests
Change-Id: I93f7b4f1b6c3ef08a3fc6d89fa397a122ef41348
M compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/AlignmentLine.kt
M compose/ui/ui-geometry/api/current.txt
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/commonMain/kotlin/androidx/compose/ui/geometry/Offset.kt
M compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/Size.kt
M compose/ui/ui-geometry/src/test/kotlin/androidx/compose/ui/geometry/OffsetTest.kt
M compose/ui/ui-geometry/src/test/kotlin/androidx/compose/ui/geometry/SizeTest.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidParagraphHelper.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/extensions/SpannableExtensions.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/ParagraphStyle.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/Placeholder.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/SpanStyle.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/TextStyle.kt
M compose/ui/ui-text/src/desktopMain/kotlin/androidx/compose/ui/text/platform/DesktopParagraph.kt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/SpanStyleTest.kt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/TextStyleTest.kt
M compose/ui/ui-unit/api/current.txt
M compose/ui/ui-unit/api/public_plus_experimental_current.txt
M compose/ui/ui-unit/api/restricted_current.txt
M compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Dp.kt
M compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/TextUnit.kt
M compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Uptime.kt
M compose/ui/ui-unit/src/test/kotlin/androidx/compose/ui/unit/DpTest.kt
M compose/ui/ui-unit/src/test/kotlin/androidx/compose/ui/unit/TextUnitTest.kt
M compose/ui/ui-unit/src/test/kotlin/androidx/compose/ui/unit/UptimeTest.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/ScaleFactor.kt
M compose/ui/ui/src/test/kotlin/androidx/compose/ui/layout/ScaleFactorTest.kt
https://android-review.googlesource.com/1524458
Branch: androidx-master-dev
commit cdd20c9d43f86a8bf9749757330466794ec799ae
Author: George Mount <mount@google.com>
Date: Thu Dec 10 20:03:46 2020
Add common Unspecified helper methods.
Color has 3 useful methods/vals for managing the
Unspecified value: isSpecified, isUnspecified, and
useOrElse(). For consistency, we should have these
on all classes that have "Unspecified" constant values.
Relnote: "Added isSpecified, isUnspecified, and useOrElse for
inline classes with an Unspecified constant."
Fixes: 174310811
Test: new tests
Change-Id: I93f7b4f1b6c3ef08a3fc6d89fa397a122ef41348
M compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/AlignmentLine.kt
M compose/ui/ui-geometry/api/current.txt
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/commonMain/kotlin/androidx/compose/ui/geometry/Offset.kt
M compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/Size.kt
M compose/ui/ui-geometry/src/test/kotlin/androidx/compose/ui/geometry/OffsetTest.kt
M compose/ui/ui-geometry/src/test/kotlin/androidx/compose/ui/geometry/SizeTest.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidParagraphHelper.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/extensions/SpannableExtensions.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/ParagraphStyle.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/Placeholder.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/SpanStyle.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/TextStyle.kt
M compose/ui/ui-text/src/desktopMain/kotlin/androidx/compose/ui/text/platform/DesktopParagraph.kt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/SpanStyleTest.kt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/TextStyleTest.kt
M compose/ui/ui-unit/api/current.txt
M compose/ui/ui-unit/api/public_plus_experimental_current.txt
M compose/ui/ui-unit/api/restricted_current.txt
M compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Dp.kt
M compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/TextUnit.kt
M compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Uptime.kt
M compose/ui/ui-unit/src/test/kotlin/androidx/compose/ui/unit/DpTest.kt
M compose/ui/ui-unit/src/test/kotlin/androidx/compose/ui/unit/TextUnitTest.kt
M compose/ui/ui-unit/src/test/kotlin/androidx/compose/ui/unit/UptimeTest.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/ScaleFactor.kt
M compose/ui/ui/src/test/kotlin/androidx/compose/ui/layout/ScaleFactorTest.kt
Description
These would mirror the
Color.isSpecified
,Color.isUnspecified
, andColor.useOrElse
helper functions, which are useful when dealing withColor
s that could potentially beColor.Unspecified
.If this request is accepted, it might be worth auditing the rest of the Compose libraries (to see if there are any similar types that define
Unspecified
values)