Status Update
Comments
am...@gmail.com <am...@gmail.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
am...@gmail.com <am...@gmail.com> #3
am...@gmail.com <am...@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
ap...@google.com <ap...@google.com> #5
Branch: androidx-main
commit 040e3103bc0cfb65b085ec7401e5f4aee7b2f893
Author: Max Alfonso-Ying <maxying@google.com>
Date: Wed Mar 27 17:36:06 2024
Make SearchBar take input field as a slot
- SearchBarInputField moved into SearchBarDefaults and made public
- Deprecated SearchBarColors inputFieldColors param
- renamed "active" to "expanded" in new API to better align with spec language
Bug:
Fixes:
Relnote: "`SearchBar` and `DockedSearchBar` have new overloads that
take a text field parameter. This allows styling the text field
separately from the rest of the search bar as well as passing in
custom text fields. The text field of the current implementation
has been made available as `SearchBarDefaults.InputField`."
Test: tests updated
Change-Id: I50c73509b4a67247df7240207e7ad13d5863a7ff
M compose/material3/benchmark/src/androidTest/java/androidx/compose/material3/benchmark/SearchBarBenchmark.kt
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/restricted_current.txt
M compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/SearchBarSamples.kt
M compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/SearchBarScreenshotTest.kt
M compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/SearchBarTest.kt
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/SearchBar.android.kt
ma...@google.com <ma...@google.com> #6
A change was made to SearchBar
that allows passing the text field as a parameter, so you can use a custom text field that supports TextFieldValue
. This should be available in the next 1-2 alpha releases of the library.
However, the reason we have not (and will not) add a TextFieldValue
version of SearchBar
in the library is because BasicTextField
has been undergoing a rewrite. Once the new version is fully stable, we will add support to SearchBar
that uses the new TextFieldState
API, which supports selection and cursor position and can replace the use case of TextFieldValue
. If interested, you can follow this thread:
na...@google.com <na...@google.com> #7
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material3:material3:1.3.0-alpha05
androidx.compose.material3:material3-android:1.3.0-alpha05
androidx.compose.material3:material3-desktop:1.3.0-alpha05
Description
Jetpack Compose Material 3 version: 1.1.0-beta02
Jetpack Compose component used: androidx.compose.material3.SearchBar
Android Studio Build: #AI-222.4459.24.2221.9862592
Kotlin version: 1.8.20
Currently the query parameter of SearchBar component is only String, there is no TextFieldValue variant which would allow us to control the selection, etc.