Status Update
Comments
ap...@google.com <ap...@google.com> #2
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
tc...@google.com <tc...@google.com>
ti...@google.com <ti...@google.com> #3
lp...@google.com <lp...@google.com> #4
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
ti...@google.com <ti...@google.com> #5
Re #4:
Could you elaborate on what moving animation
to be a lower group would look like? Is this animation
or both animation
and animation-core
?
I assume there's a policy against having animation-core
and animation
in separate groups? That would solve the cicular dependency between groups.
BTW, AnimationClock
is going away by Beta, although that wouldn't solve the animated vectors issue.
lp...@google.com <lp...@google.com> #6
Re #4: Could you elaborate on what moving animation to be a lower group would look like? Is this animation or both animation and animation-core?
Sorry, I meant moving the group androidx.compose.animation
'down' - so that would be both animation
and animation-core
.
Currently our dependencies are something like: (we want to prevent these groups from depending on things above them)
material
foundation
animation
ui
runtime
If we swap animation
and ui
, and make it so that nothing in the animation
group depends on ui
, but allow the ui
group to depend on animation, it sounds like we can fix this dependency issue, move UI related APIs like animateContentSize
out of animation
keeping the animation
group strictly animation related, and also lets us add new APIs to ui
like animated vectors since we would be able to depend directly on animation
and animation-core
from within ui
.
From a brief look it doesn't look like this would affect much, there aren't many ui
related imports in animation
.
ti...@google.com <ti...@google.com> #7
Thanks for the walk-through. It was very helpful. :) I would propose a small tweak to your suggestion: Bring animation
lib into ui group, instead of moving APIs. That would allow us to animation group down.
The design intention for animation
as a library was to host higher level APIs that depend on both animation-core
and other modules. If we were to move the animation group down and remove animation
lib's dependency on ui, and move all the APIs that depend on ui
to ui
, we might as well move the whole lib to ui. This way animation group would only contain animation-core
(and demos and samples module for it), and it's gauranteed to not depend on anything above it. Wdyt?
lp...@google.com <lp...@google.com> #8
Sounds like a reasonable option to me as well, although I kinda like having the separation of androidx.compose.animation
- I don't see why things like transition and single animated value should be tied to Compose UI
, theoretically they could be useful for other tree types. Either option sounds good, but we should decide and land this soon.
ti...@google.com <ti...@google.com> #9
Transition v2 is in animation-core
. Single value animation can also be moved to animation-core
as a result of recent decision to have it depend on runtime. We plan on re-naming the animate
APIs as well. Agreed that we should make a decision on this soon.
cc+ George
lp...@google.com <lp...@google.com> #10
result of recent decision to have it depend on runtime
I wonder if it's still fair to call it animation-core
at this point. How about we move everything in animation-core
to animation
, and the ui
bits go to ui-animation
? So we would have:
// Compose animation library (transition / single value animation etc)
androidx.compose.animation:animation
// Animation integration for Compose UI (crossfade / animated modifier, etc)
androidx.compose.ui:ui-animation
ti...@google.com <ti...@google.com> #11
Yes, assuming we do decide to move animation
into ui
group, then it makes total sense to rename animation-core
to animation
. :)
ad...@google.com <ad...@google.com>
lp...@google.com <lp...@google.com> #12
Is this actually obsolete? We still have a dependency on :compose:animation:animation-core
from compose:ui:ui
Looks like this is used in our animated vector support, shouldn't these be moved up to a separate module? (having an api
dependency here in particular seems very worrying..)
ti...@google.com <ti...@google.com> #13
Seems like it's a different reason for the dependency now - previously it was ambient animation clock. Splitting animation and animation-core in separate groups is no longer a viable option. Moving animation group up is reasonable as long as we could sort out the dependency issue. :)
Looping in Yuichi, owner of animated vector. Yuichi, would it be possible to move the animated vector impl to the animation group or another module that depends on both animation and ui? If I remember correctly, we tried that approach and ended up with a bunch of extra APIs to support cross module communication. :(
ad...@google.com <ad...@google.com>
ti...@google.com <ti...@google.com> #14
Louis, how critical is this? This would require a large refactor that I think might be too late at this stage of Beta. :(
ad...@google.com <ad...@google.com> #15
My understanding is that we don't currently have a circular dependency, just a module separation that isn't critical to have anymore, right?
lp...@google.com <lp...@google.com> #16
My understanding is that we don't currently have a circular dependency, just a module separation that isn't critical to have anymore, right?
We still have a cycle between library groups:
animation:animation
depends on ui:ui
which depends on animation:animation-core
This will make it very difficult to independently version these library groups (ui and animation), since if a developer increases the version of ui:ui
, it might actually end up increasing the version of animation:animation-core
too.
ad...@google.com <ad...@google.com> #17
if that's the case then either animation and ui are effectively part of the same version group, or animation and animation-core are separate version groups of their own and may not establish and use opt-in internal APIs between them.
ti...@google.com <ti...@google.com> #18
animation and ui are effectively part of the same version group
What would this look like? I'd rather not put a hard requirement to never use internal or experimental APIs across the two animation libs, which would be required by the other option.
ti...@google.com <ti...@google.com> #19
After some investigation, I think we can eliminate the dependency from ui to animation to simplify things a bit. This would require refactoring out the impl of animated-vector that depends on animation group into a separate module. Since the animated-vector features are experimental, this can be done post 1.0.
However, there is unfortunately another group level dependency cycle:
foundation (from foundation group) -> animation -> foundation-layout (from foundation group)
I don't see a good way to avoid this without creating hurdles that'd make animation feature development difficult. It is somewhat analogous to the group level dependency story between
lifecycle-extensions (from lifecycle group) -> fragment -> lifecycle-viewModel/livedata-core (from lifecycle group)
Louis is right that independent versioning would be difficult. Animation and foundation would need to be released in lock steps, similar to lifecycle and fragment. It's still lesser of the two evils, compared to splitting animation libs. The animation
lib requires animation-core
to add new low-level experimental APIs (for example: Transition.createChildTransition) to support high level animation features. Not allowing experimental API usage between these two libs would therefore hinder feature development.
lp...@google.com <lp...@google.com> #20
foundation (from foundation group) -> animation -> foundation-layout (from foundation group)
We have usages in Crossfade
and AnimatedVisibility
Crossfade
just uses a Box
as an implementation detail, we can probably refactor that out and just build our own simpler box for internal usage.
AnimatedVisibility
has (experimental) extensions for RowScope
and ColumnScope
, which seems more problematic.
Do these extensions need to live here? Or when the underlying APIs are stable, could they live in foundation-layout
? It seems reasonable that ColumnScope / RowScope animation implementations, live in the same place that they are defined, then we could remove this dependency inversion. I would really like to avoid the case where updating your animation dependency so you can make use of new animation APIs also ends up updating how Row behaves.
ti...@google.com <ti...@google.com> #21
I would really like to avoid the case where updating your animation dependency so you can make use of new animation APIs also ends up updating how Row behaves.
I understand the desire to make the two libs independent. I'm in full support of removing the dependency on animation from ui group.
Updating how Row behaves when updpating animation may be desired because going forward we'll lean more and more on foundation-layout to reuse some of the implementation so that animation doesn't need to reinvent the wheels and implement the same layout logic. For example, I'm planning on implementing AnimatedRow
, for which I'd prefer to reuse as much from the Row's static layout/spacing logic as possible, rather than duplicating the code. I won't be able to put something like AnimatedRow
outside of animation, because animating values not known until measure/layout is not supported in stable animation API yet.
Do these extensions need to live here? Or when the underlying APIs are stable, could they live in foundation-layout? It seems reasonable that ColumnScope / RowScope animation implementations, live in the same place that they are defined, then we could remove this dependency inversion.
That's a great question. We are just starting with the layout animation APIs. There will be more and more cases where we'd put out experiemental animation APIs, as well as their Row/Column specific variant. The Row/ColumnScope extension of AnimatedVisibility account for the majority API use for AnimatedVisiblity nowadays, because they are tailored to the specific layouts and therefore more convenient. We'd hurt the dev experience more than we gain if we had to take that (and future opportunities of) optimization away.
ad...@google.com <ad...@google.com> #22
Doris and I chatted; it looks like a promising path forward is aligning the compose-animation modules with the foundation version group and breaking the dependency from compose-ui on animation-core. The only usages in a quick survey are the experimental animated vector support, tests, and samples. If we move the experimental animated vector support to a foundation-level module that depends on animation, we can keep the compose-ui <-> compose-foundation version boundary strict.
ti...@google.com <ti...@google.com> #23
Yes, that was also what I meant in #21 by "removing the dependency on animation from ui group."
Yuichi has kindly agreed to take on the task to move the animated vector work out of ui, therefore removing ui's dependency on animation-core. We can cherry-pick that change into release branch once it lands. (
I'll fix the tests' and sample's dependency on animation from ui in a follow-up CL.
ap...@google.com <ap...@google.com> #25
Branch: androidx-main
commit c9db3b353eb3f114fde65b0eea0d3ed93b29fee7
Author: Yuichi Araki <yaraki@google.com>
Date: Tue Jun 29 11:39:30 2021
Remove AnimatedImageVector and related APIs
These need to be moved out of 'ui'.
Relnote: "AnimatedImageVector was temporarily removed in order to change the module structure."
Bug: 160602714
Test: Other tests run
Change-Id: I419062b1b225003ee594f4d8522b11bb024144d6
M compose/integration-tests/docs-snippets/src/main/java/androidx/compose/integration/docs/resources/Resources.kt
M compose/ui/ui/api/current.ignore
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_current.ignore
M compose/ui/ui/api/restricted_current.txt
D compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/AnimatedVectorGraphicsDemo.kt
M compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/UiDemos.kt
D compose/ui/ui/integration-tests/ui-demos/src/main/res/drawable/ic_hourglass_animated.xml
D compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/AnimatedVectorSample.kt
D compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/graphics/vector/AnimatedImageVectorTest.kt
D compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/graphics/vector/compat/XmlAnimatedVectorParserTest.kt
D compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/graphics/vector/compat/XmlAnimatorParserTest.kt
D compose/ui/ui/src/androidAndroidTest/res/animator/complex_background.xml
D compose/ui/ui/src/androidAndroidTest/res/animator/object_animator_1d.xml
D compose/ui/ui/src/androidAndroidTest/res/animator/object_animator_2d.xml
D compose/ui/ui/src/androidAndroidTest/res/animator/property_values_holders.xml
D compose/ui/ui/src/androidAndroidTest/res/animator/set.xml
D compose/ui/ui/src/androidAndroidTest/res/drawable/avd_complex.xml
D compose/ui/ui/src/androidAndroidTest/res/drawable/vd_complex.xml
D compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/graphics/vector/compat/XmlAnimatedVectorParser.android.kt
D compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/graphics/vector/compat/XmlAnimatorParser.android.kt
D compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/graphics/vector/compat/XmlPullParserUtils.android.kt
D compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/res/AnimatedVectorResources.android.kt
D compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/res/AnimatorResources.android.kt
D compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/graphics/vector/AnimatedImageVector.kt
D compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/graphics/vector/Animator.kt
ap...@google.com <ap...@google.com> #26
Branch: androidx-main
commit fc869555e8d6ebab8d9f7fda20e20c1243114f53
Author: Doris Liu <tianliu@google.com>
Date: Mon Jun 28 21:30:02 2021
Sever ui's dependency on animation-core
Bug: 160602714
Test: Build and run tests
Relnote: "Moved InfiniteAnimationPolicy to :compose:ui"
Change-Id: I5eb09c7aa24a85fd2e66cc9b84ea6c906dc5210a
M compose/animation/animation-core/api/current.ignore
M compose/animation/animation-core/api/current.txt
M compose/animation/animation-core/api/public_plus_experimental_current.txt
M compose/animation/animation-core/api/restricted_current.ignore
M compose/animation/animation-core/api/restricted_current.txt
M compose/animation/animation-core/benchmark/build.gradle
M compose/animation/animation-core/build.gradle
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/InfiniteAnimationPolicy.kt
M compose/ui/ui-test-junit4/build.gradle
M compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/AndroidComposeTestRule.android.kt
M compose/ui/ui-test-junit4/src/test/kotlin/androidx/compose/ui/test/junit4/InfiniteAnimationPolicyTest.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/build.gradle
M compose/ui/ui/samples/build.gradle
A compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/platform/InfiniteAnimationPolicy.kt
M compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Application.desktop.kt
ti...@google.com <ti...@google.com> #27
It'd be nice to enforce the lib group dependency so it can only be one-way from higher level groups on lower level groups. Filed feature request at
sh...@gmail.com <sh...@gmail.com> #28
In 1.0.0 the animatedvectorresource and the AnimatedImageVector is missing. please release it as soon as possible as it is causing issues with my app. please sugest some workaround as my app heavely depend on it.
ti...@google.com <ti...@google.com> #29
Re #28:
AnimatedVectorResource will be included in the next Compose release in 1-2 weeks in a new lib: animation-graphics
. Stay tuned! Sorry for the inconvenience.
sh...@gmail.com <sh...@gmail.com> #30
Thanks
Description
with the module moves we end up with a cycle between module groups.
animation
depends oncore
andcore
depends onanimation-core
This is due to the AnimationClock ambient. If we break this dependency then we clear the cycle