Fixed
Status Update
Comments
an...@google.com <an...@google.com>
de...@gmail.com <de...@gmail.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
po...@google.com <po...@google.com>
al...@google.com <al...@google.com>
ni...@google.com <ni...@google.com> #3
PointF was the main (possibly only) mutability issue, marking this as fixed
xz...@gmail.com <xz...@gmail.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
sg...@google.com <sg...@google.com>
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit ea62ec81f8492863dfe208ae85a80db9cff8ca1d
Author: Shalom Gibly <sgibly@google.com>
Date: Mon May 01 17:22:15 2023
Adds a ScrollState param to dropdown menus
This CL:
- Adds a ScrollState param to dropdown menus to allow control over the
menu items positioing when the popup is displayed.
- Deprecates the current DropdownMenu function and adds another that
takes a ScrollState parameter.
- Modifies the experimental ExposedDropdownMenu function to take a
ScrollState parameter.
Bug: 185304441
Test: MenuTest, ExposedDropdownMenuTest
Relnote: "Added an option to pass in a ScrollState when constructing a
DropdownMenu or an ExposedDropdownMenu for controlling the vertical
scroll state of the displayed menu items."
Change-Id: Ia0734c832441988ff0047f25719d7c8edae8db5c
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/public_plus_experimental_current.txt
M compose/material3/material3/api/restricted_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/MenuSamples.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/ExposedDropdownMenuTest.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/MenuScreenshotTest.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/MenuTest.kt
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/AndroidMenu.android.kt
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/ExposedDropdownMenu.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Menu.kt
https://android-review.googlesource.com/2573579
Branch: androidx-main
commit ea62ec81f8492863dfe208ae85a80db9cff8ca1d
Author: Shalom Gibly <sgibly@google.com>
Date: Mon May 01 17:22:15 2023
Adds a ScrollState param to dropdown menus
This CL:
- Adds a ScrollState param to dropdown menus to allow control over the
menu items positioing when the popup is displayed.
- Deprecates the current DropdownMenu function and adds another that
takes a ScrollState parameter.
- Modifies the experimental ExposedDropdownMenu function to take a
ScrollState parameter.
Bug: 185304441
Test: MenuTest, ExposedDropdownMenuTest
Relnote: "Added an option to pass in a ScrollState when constructing a
DropdownMenu or an ExposedDropdownMenu for controlling the vertical
scroll state of the displayed menu items."
Change-Id: Ia0734c832441988ff0047f25719d7c8edae8db5c
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/public_plus_experimental_current.txt
M compose/material3/material3/api/restricted_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/MenuSamples.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/ExposedDropdownMenuTest.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/MenuScreenshotTest.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/MenuTest.kt
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/AndroidMenu.android.kt
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/ExposedDropdownMenu.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Menu.kt
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
commit 9a8f9209f18b9b8a2efb463204beb94896dfdfb5
Author: Shalom Gibly <sgibly@google.com>
Date: Tue May 02 16:15:48 2023
Adds ScrollState param to M2 dropdown menus
This CL applies similar changes to Material 2 from the previously
submitted CL athttps://r.android.com/2573579 :
- Adds a ScrollState param to dropdown menus to allow control over the
menu items positioing when the popup is displayed.
- Deprecates the current DropdownMenu function and adds another that
takes a ScrollState parameter.
- Modifies the experimental ExposedDropdownMenu function to take a
ScrollState parameter.
- Changes and deprecations to the Desktop menu.
Fixes: 185304441
Test: MenuTest, ExposedDropdownMenuTest
Relnote: "Added an option to pass in a ScrollState when constructing a
DropdownMenu or an ExposedDropdownMenu for controlling the vertical
scroll state of the displayed menu items."
Change-Id: Idb0090cd1b9bb4853e448d82094156a8af39d65b
M compose/material/material/api/current.txt
M compose/material/material/api/public_plus_experimental_current.txt
M compose/material/material/api/restricted_current.txt
M compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/model/Examples.kt
M compose/material/material/samples/src/main/java/androidx/compose/material/samples/MenuSamples.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ExposedDropdownMenuTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/MenuTest.kt
M compose/material/material/src/androidMain/kotlin/androidx/compose/material/AndroidMenu.android.kt
M compose/material/material/src/androidMain/kotlin/androidx/compose/material/ExposedDropdownMenu.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Menu.kt
M compose/material/material/src/desktopMain/kotlin/androidx/compose/material/DesktopMenu.desktop.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/MenuTest.kt
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/AndroidMenu.android.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Menu.kt
https://android-review.googlesource.com/2577210
Branch: androidx-main
commit 9a8f9209f18b9b8a2efb463204beb94896dfdfb5
Author: Shalom Gibly <sgibly@google.com>
Date: Tue May 02 16:15:48 2023
Adds ScrollState param to M2 dropdown menus
This CL applies similar changes to Material 2 from the previously
submitted CL at
- Adds a ScrollState param to dropdown menus to allow control over the
menu items positioing when the popup is displayed.
- Deprecates the current DropdownMenu function and adds another that
takes a ScrollState parameter.
- Modifies the experimental ExposedDropdownMenu function to take a
ScrollState parameter.
- Changes and deprecations to the Desktop menu.
Fixes: 185304441
Test: MenuTest, ExposedDropdownMenuTest
Relnote: "Added an option to pass in a ScrollState when constructing a
DropdownMenu or an ExposedDropdownMenu for controlling the vertical
scroll state of the displayed menu items."
Change-Id: Idb0090cd1b9bb4853e448d82094156a8af39d65b
M compose/material/material/api/current.txt
M compose/material/material/api/public_plus_experimental_current.txt
M compose/material/material/api/restricted_current.txt
M compose/material/material/integration-tests/material-catalog/src/main/java/androidx/compose/material/catalog/library/model/Examples.kt
M compose/material/material/samples/src/main/java/androidx/compose/material/samples/MenuSamples.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ExposedDropdownMenuTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/MenuTest.kt
M compose/material/material/src/androidMain/kotlin/androidx/compose/material/AndroidMenu.android.kt
M compose/material/material/src/androidMain/kotlin/androidx/compose/material/ExposedDropdownMenu.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Menu.kt
M compose/material/material/src/desktopMain/kotlin/androidx/compose/material/DesktopMenu.desktop.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/MenuTest.kt
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/AndroidMenu.android.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Menu.kt
ju...@google.com <ju...@google.com> #7
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material:material:1.5.0-beta01
androidx.compose.material3:material3:1.2.0-alpha02
androidx.compose.material3:material3-android:1.2.0-alpha02
Description
Versions information
Jetpack Compose release version: 1.0.0-beta04
Android Studio Build:
Description
The composable doesn't allow the caller to pass a which prevents us to set the default scroll position upon opening.
DropdownMenu
ScrollState
Also, passing a
Modifier
with averticalScroll
crashes the app with the following exception: