Fixed
Status Update
Comments
ni...@google.com <ni...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit a330c0d3bcdd41326f37968a60e6084ad4a2e32c
Author: Chet Haase <chet@google.com>
Date: Wed Jul 05 07:26:46 2023
Convert APIs using PointF to use Float instead
PointF is a convenient mechanism for passing around x.y values
representing 2D points. But there are downsides, including:
- Converting to PointF: You may not have the data in PointF form
to begin with, so using an API which takes PointF requires converting
the data to that form (including allocating a PointF object every time)
- Mutability: Point structures can be mutated internally, causing
unpredictability in what that mutation means. Should the library
react to those changes? Ignore them? Do defensive copies (requiring
even more allocations)? Using primitive types like Float make the
behavior more obvious (by making the data inherently immutable).
- Allocations: Whenever we use object types, there are necessarily
allocations on the Java heap for them. This puts pressure on the GC
at both allocation and collection time. Given the amount of points
being passed around (especially at morph creation time, when curves
are being split and created), this causes a lot of PointF objects to
be allocated (even temporarily). Using Float avoids that problem.
Also fixed bug with unclosed paths causing discontinuity at the
start/end point.
Bug: 276466399
Bug: 290254314
Test: integration and unit tests pass
Relnote: PointF parameters changed to Float pairs
Change-Id: Id4705d27c7be31b26ade8186b99fffe2e2f8450e
M graphics/graphics-shapes/api/current.txt
M graphics/graphics-shapes/api/restricted_current.txt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/CubicShapeTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/CubicTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/PolygonMeasureTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/PolygonTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/RoundedPolygonTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/ShapesTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/TestUtils.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/Cubic.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/CubicShape.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/FeatureMapping.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/FloatMapping.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/Morph.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/PolygonMeasure.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/RoundedPolygon.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/Shapes.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/Utils.kt
M graphics/integration-tests/testapp-compose/src/main/java/androidx/graphics/shapes/testcompose/DebugDraw.kt
M graphics/integration-tests/testapp-compose/src/main/java/androidx/graphics/shapes/testcompose/ShapeEditor.kt
M graphics/integration-tests/testapp/src/main/java/androidx/graphics/shapes/test/MaterialShapes.kt
https://android-review.googlesource.com/2649119
Branch: androidx-main
commit a330c0d3bcdd41326f37968a60e6084ad4a2e32c
Author: Chet Haase <chet@google.com>
Date: Wed Jul 05 07:26:46 2023
Convert APIs using PointF to use Float instead
PointF is a convenient mechanism for passing around x.y values
representing 2D points. But there are downsides, including:
- Converting to PointF: You may not have the data in PointF form
to begin with, so using an API which takes PointF requires converting
the data to that form (including allocating a PointF object every time)
- Mutability: Point structures can be mutated internally, causing
unpredictability in what that mutation means. Should the library
react to those changes? Ignore them? Do defensive copies (requiring
even more allocations)? Using primitive types like Float make the
behavior more obvious (by making the data inherently immutable).
- Allocations: Whenever we use object types, there are necessarily
allocations on the Java heap for them. This puts pressure on the GC
at both allocation and collection time. Given the amount of points
being passed around (especially at morph creation time, when curves
are being split and created), this causes a lot of PointF objects to
be allocated (even temporarily). Using Float avoids that problem.
Also fixed bug with unclosed paths causing discontinuity at the
start/end point.
Bug: 276466399
Bug: 290254314
Test: integration and unit tests pass
Relnote: PointF parameters changed to Float pairs
Change-Id: Id4705d27c7be31b26ade8186b99fffe2e2f8450e
M graphics/graphics-shapes/api/current.txt
M graphics/graphics-shapes/api/restricted_current.txt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/CubicShapeTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/CubicTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/PolygonMeasureTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/PolygonTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/RoundedPolygonTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/ShapesTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/TestUtils.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/Cubic.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/CubicShape.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/FeatureMapping.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/FloatMapping.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/Morph.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/PolygonMeasure.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/RoundedPolygon.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/Shapes.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/Utils.kt
M graphics/integration-tests/testapp-compose/src/main/java/androidx/graphics/shapes/testcompose/DebugDraw.kt
M graphics/integration-tests/testapp-compose/src/main/java/androidx/graphics/shapes/testcompose/ShapeEditor.kt
M graphics/integration-tests/testapp/src/main/java/androidx/graphics/shapes/test/MaterialShapes.kt
ma...@google.com <ma...@google.com> #3
PointF was the main (possibly only) mutability issue, marking this as fixed
so...@google.com <so...@google.com> #4
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.graphics:graphics-shapes:1.0.0-alpha04
ni...@google.com <ni...@google.com> #5
Could you please check if this is on the correct iteration?
ma...@google.com <ma...@google.com>
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support-golden
Branch: androidx-main
commit c15bd36a088423392f6d607d0dd1a951a0d31702
Author: Max Alfonso-Ying <maxying@google.com>
Date: Wed Jan 25 00:38:05 2023
Add goldens for text field prefix/suffix.
Bug: b/179884561
Change-Id: I6522629d366b1249fdfcd887e9e8402ee32c7df6
A compose/material3/material3/outlinedTextField_prefixSuffix_withLabelAndInput_cuttlefish.png
A compose/material3/material3/outlinedTextField_prefixSuffix_withLabelAndInput_darkTheme_cuttlefish.png
A compose/material3/material3/outlinedTextField_prefixSuffix_withLabelAndInput_focused_cuttlefish.png
A compose/material3/material3/outlinedTextField_prefixSuffix_withLeadingTrailingIcons_cuttlefish.png
A compose/material3/material3/outlinedTextField_prefixSuffix_withPlaceholder_cuttlefish.png
A compose/material3/material3/textField_prefixSuffix_withLabelAndInput_cuttlefish.png
A compose/material3/material3/textField_prefixSuffix_withLabelAndInput_darkTheme_cuttlefish.png
A compose/material3/material3/textField_prefixSuffix_withLabelAndInput_focused_cuttlefish.png
A compose/material3/material3/textField_prefixSuffix_withLeadingTrailingIcons_cuttlefish.png
A compose/material3/material3/textField_prefixSuffix_withPlaceholder_cuttlefish.png
https://android-review.googlesource.com/2402252
Branch: androidx-main
commit c15bd36a088423392f6d607d0dd1a951a0d31702
Author: Max Alfonso-Ying <maxying@google.com>
Date: Wed Jan 25 00:38:05 2023
Add goldens for text field prefix/suffix.
Bug:
Change-Id: I6522629d366b1249fdfcd887e9e8402ee32c7df6
A compose/material3/material3/outlinedTextField_prefixSuffix_withLabelAndInput_cuttlefish.png
A compose/material3/material3/outlinedTextField_prefixSuffix_withLabelAndInput_darkTheme_cuttlefish.png
A compose/material3/material3/outlinedTextField_prefixSuffix_withLabelAndInput_focused_cuttlefish.png
A compose/material3/material3/outlinedTextField_prefixSuffix_withLeadingTrailingIcons_cuttlefish.png
A compose/material3/material3/outlinedTextField_prefixSuffix_withPlaceholder_cuttlefish.png
A compose/material3/material3/textField_prefixSuffix_withLabelAndInput_cuttlefish.png
A compose/material3/material3/textField_prefixSuffix_withLabelAndInput_darkTheme_cuttlefish.png
A compose/material3/material3/textField_prefixSuffix_withLabelAndInput_focused_cuttlefish.png
A compose/material3/material3/textField_prefixSuffix_withLeadingTrailingIcons_cuttlefish.png
A compose/material3/material3/textField_prefixSuffix_withPlaceholder_cuttlefish.png
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-main
commit d747bed10677621f865067e57a6099c7179502c3
Author: Max Alfonso-Ying <maxying@google.com>
Date: Tue Jan 03 17:50:57 2023
Implement prefix/suffix for M3 text field.
Fixes: b/179884561
Test: added
Relnote: "Slot APIs for prefix and suffix text have been
added to Material 3 text fields."
Change-Id: Ia85786c582981e8f16a7053a869e06c2c1a43fb8
M compose/material3/material3/api/public_plus_experimental_current.txt
M compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/model/Examples.kt
M compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/TextFieldSamples.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/OutlinedTextFieldScreenshotTest.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/OutlinedTextFieldTest.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/TextFieldScreenshotTest.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/TextFieldTest.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/OutlinedTextField.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TextField.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TextFieldDefaults.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TextFieldImpl.kt
https://android-review.googlesource.com/2400915
Branch: androidx-main
commit d747bed10677621f865067e57a6099c7179502c3
Author: Max Alfonso-Ying <maxying@google.com>
Date: Tue Jan 03 17:50:57 2023
Implement prefix/suffix for M3 text field.
Fixes:
Test: added
Relnote: "Slot APIs for prefix and suffix text have been
added to Material 3 text fields."
Change-Id: Ia85786c582981e8f16a7053a869e06c2c1a43fb8
M compose/material3/material3/api/public_plus_experimental_current.txt
M compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/model/Examples.kt
M compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/TextFieldSamples.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/OutlinedTextFieldScreenshotTest.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/OutlinedTextFieldTest.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/TextFieldScreenshotTest.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/TextFieldTest.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/OutlinedTextField.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TextField.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TextFieldDefaults.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TextFieldImpl.kt
pr...@google.com <pr...@google.com> #8
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material3:material3:1.1.0-alpha06
ya...@gmail.com <ya...@gmail.com> #9
your text fields in compose are terrible
Description
There is a leadingIcon and trailingIcon APIs in the text field that are intended to be used to put an icon or iconbutton. But it was not designed to be used with prefix/suffix text as it requires a baseline alignment. We need to explore how to nicely support this.
Possibly related ticket: 1