Status Update
Comments
je...@google.com <je...@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
ap...@google.com <ap...@google.com> #3
ap...@google.com <ap...@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
tc...@google.com <tc...@google.com> #5
ae...@google.com <ae...@google.com> #6
Hi Jelle. I was chatting with Doris today about top animation priorities before beta and deprecation+removal of AnimationClockObservable
(filed as internal
(in general, API deletions are higher priority than API additions in these last few weeks before beta). Would you be able to temporarily put aside the infinite animation work I saw you're working on this week to complete the clock transition?
pa...@google.com <pa...@google.com> #7
I think the infinite animation work is almost done so it wouldn't be worth postponing. Also we are removing other awkward APIs on our side due to this change. Is something preventing us from just deprecating the APIs? If this is only about some tests migration they can depend on test-utils which is our internal package.
ti...@google.com <ti...@google.com> #8
Re #7:
If infinite animation work is almost done, please go ahead and finish. We are in desperate need for help deprecate AnimationClockObservable
. My plate is overflowing with API finalization for Animatable
and AnimatedVisibility
right now, which won't leave enough time for the clock deprecation. :(
Could Jelle loan us a helpful hand on this high priority deprecation, if he's not swamped with critical issues himself? (It is high priority because API changes as such must be done before beta.)
je...@google.com <je...@google.com> #9
The infinite animation work is in state of completion now, and I'll start working on migration from AnimationClockObservable today.
My apologies for not responding earlier, I had to take a few days off due to circumstances. Things are better now though!
ti...@google.com <ti...@google.com> #10
Thank you so much Jelle! I really appreciate that.:)
ap...@google.com <ap...@google.com> #11
Branch: androidx-main
commit ff9e1216e79fe9480ba7ee9bcb490432221f324c
Author: Jelle Fresen <jellefresen@google.com>
Date: Thu Feb 04 19:38:09 2021
Remove MockAnimationClock
When an object requires a clock and you don't care about the clock,
create the object in composition using it's rememberXxx factory that
retrieves the ambient clock.
Bug: 161247083
Test: ./gradlew compose:foundation:foundation:cC && \
./gradlew compose:ui:ui-test:cC
Change-Id: I383420bacdc61ba27204b25bddb6648db6231d5d
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollableTest.kt
D compose/test-utils/src/commonMain/kotlin/androidx/compose/testutils/MockAnimationClock.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/gesturescope/SendSwipeTest.kt
ap...@google.com <ap...@google.com> #12
Branch: androidx-main
commit 58bcedbc6dd053649cba35fd75a0347a94aab086
Author: Jelle Fresen <jellefresen@google.com>
Date: Thu Feb 04 19:01:17 2021
Remove manual clocks from material androidTest
Instead of injecting a ManualAnimationClock in the tests, create the
state objects in composition and rely on `ComposeTestRule.mainClock` to
manually advance time.
Bug: 161247083
Test: ./gradlew compose:material:material:cC
Change-Id: I8a074549e7ea939a0f30217239beee0d65635039
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/BackdropScaffoldTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/BottomSheetScaffoldTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ModalBottomSheetTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwipeToDismissTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwipeableTest.kt
Description
No description yet.