Status Update
Comments
sg...@google.com <sg...@google.com>
sg...@google.com <sg...@google.com>
ap...@google.com <ap...@google.com> #2
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
sg...@google.com <sg...@google.com>
to...@gmail.com <to...@gmail.com> #3
sg...@google.com <sg...@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
de...@gmail.com <de...@gmail.com> #5
Rly? So the upcoming stable 1.0.0 will be unusable for a lot of people...?
si...@gmail.com <si...@gmail.com> #6
to...@gmail.com <to...@gmail.com> #7
Alpha1 will be out at the same time as the final as they usually do.
The only real question for me that allows alpha in prod, is that I hope that 1.1 won't be pinned to compose UI 1.4 and still allow 1.3.
sg...@google.com <sg...@google.com> #8
We understand the urgency, but please note that the top app bar is still marked as experimental, so changes should always be expected until we remove this mark :)
Also, there is a chance we will release a 1.3.1 bug-fix release. If that happens, this will be cherry-picked into an equivalent Material3 1.0.1.
Cheers.
to...@gmail.com <to...@gmail.com> #9
Ok so M3 1.1 is tied to Compose 1.4 :( And this fix did not make it to 1.1 A1 will be in A2 :(
na...@google.com <na...@google.com> #10
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material3:material3:1.0.1
androidx.compose.material3:material3:1.1.0-alpha02
Description
Jetpack Compose version: 1.3 B3 / 4 Jetpack Compose component used: M3
The fix https://issuetracker.google.com/issues/245575782 was not applied to MediumTopAppBarand LargeTopAppBar.
It is necessary to properly change colors on those as only the first row of the topbar have the proper color now the rest have the surface one.