Status Update
Comments
nj...@google.com <nj...@google.com> #2
Hey Matvei, can you describe in more detail why this API is necessary for checkbox?
Generally this is needed for animated vector graphics, however, checkbox should avoid path usage if possible. We should sync up to understand the requirements here.
ya...@google.com <ya...@google.com>
ma...@google.com <ma...@google.com> #3
Hey Nader.
The need for this is to draw a fraction of a tick mark during animation. so when you click the checkbox, it feels like you're drawing checkbox with the pen from left to right.
here's the visual representation on what I'm talking about :
As you mentioned, this can be also useful for vector graphics. I think that would be in general beneficial for us to have this functionality in declarative drawing API, but I'm leaving this decision to you.
I'm happy to get any guidance on how to make checkbox animation operate without path measuring, while not complicating the code drastically.
ap...@google.com <ap...@google.com> #4
Branch: androidx-master-dev
commit 0cc479b910fa19aac7610628b42505413c722a5a
Author: Yuichi Araki <yaraki@google.com>
Date: Thu Jun 18 15:26:58 2020
Support path trimming in vector graphics
Relnote: "Support path trimming in vector graphics"
Bug: 158188351
Test: VectorTest.testVectorTrimPath
Change-Id: Ie16c93cdb5dc389a818418e7729d58b7999b68af
M ui/ui-core/api/current.txt
M ui/ui-core/api/public_plus_experimental_current.txt
M ui/ui-core/api/restricted_current.txt
M ui/ui-core/src/androidAndroidTest/kotlin/androidx/compose/ui/graphics/vector/VectorTest.kt
M ui/ui-core/src/commonMain/kotlin/androidx/compose/ui/graphics/vector/Vector.kt
M ui/ui-core/src/commonMain/kotlin/androidx/compose/ui/graphics/vector/VectorCompose.kt
M ui/ui-desktop/src/jvmMain/kotlin/androidx/ui/desktop/DesktopParagraph.kt
M ui/ui-graphics/api/current.txt
M ui/ui-graphics/api/public_plus_experimental_current.txt
M ui/ui-graphics/api/restricted_current.txt
M ui/ui-graphics/src/androidMain/kotlin/androidx/compose/ui/graphics/AndroidPathMeasure.kt
M ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/PathMeasure.kt
Description
We need to be able to draw a fraction of the path in declarative drawing and/or on androidx.Canvas.
For now the solution is to use PathMeasure and operate with Path.asAndroidPath, which we should abstract away to not to use asAndroidPath in components.
After this change, CheckBox will be able to leverage this API