Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit fcf76b3241844f18106d6e850004952046d4bfb6
Author: Leland Richardson <lelandr@google.com>
Date: Wed May 13 16:58:59 2020
Deprecate @Model
Relnote: “
@Model annotation is now deprecated. Use state and mutableStateOf as alternatives. This deprecation decision was reached after much careful discussion.
Justification
=============
Rationale includes but is not limited to:
- Reduces API surface area and concepts we need to teach
- More closely aligns with other comparable toolkits (Swift UI, React, Flutter)
- Reversible decision. We can always bring @Model back later.
- Removes corner-case usage and difficult to answer questions about configuring @Model as things we need to handle
- @Model data classes, equals, hashcode, etc.
- How do I have some properties “observed” and others not?
- How do I specify structural vs. referential equality to be used in observation?
- Reduces “magic” in the system. Would reduce the likelihood of someone assuming system was smarter than it is (ie, it knowing how to diff a list)
- Makes the granularity of observation more intuitive.
- Improves refactorability from variable -> property on class
- Potentially opens up possibilities to do hand-crafted State-specific optimizations
- More closely aligns with the rest of the ecosystem and reduces ambiguity towards immutable or us “embracing mutable state”
Migration Notes
===============
Almost all existing usages of @Model are fairly trivially transformed in one of two ways. The example below has a @Model class with two properties just for the sake of example, and has it being used in a composable.
```
@Model class Position(
var x: Int,
var y: Int
)
@Composable fun Example() {
var p = remember { Position(0, 0) }
PositionChanger(
position=p,
onXChange={ p.x = it }
onYChange={ p.y = it }
)
}
```
Alternative 1: Use State<OriginalClass> and create copies.
----------------------------------------------------------
This approach is made easier with Kotlin’s data classes. Essentially, make all previously `var` properties into `val` properties of a data class, and then use `state` instead of `remember`, and assign the state value to cloned copies of the original using the data class `copy(...)` convenience method.
It’s important to note that this approach only works when the only mutations to that class were done in the same scope that the `State` instance is created. If the class is internally mutating itself outside of the scope of usage, and you are relying on the observation of that, then the next approach is the one you will want to use.
```
data class Position(
val x: Int,
val y: Int
)
@Composable fun Example() {
var p by state { Position(0, 0) }
PositionChanger(
position=p,
onXChange={ p = p.copy(x=it) }
onYChange={ p = p.copy(y=it) }
)
}
```
Alternative 2: Use mutableStateOf and property delegates
--------------------------------------------------------
This approach is made easier with Kotlin’s property delegates and the `mutableStateOf` API which allows you to create MutableState instances outside of composition. Essentially, replace all `var` properties of the original class with `var` properties with `mutableStateOf` as their property delegate. This has the advantage that the usage of the class will not change at all, only the internal implementation of it. The behavior is not completely identical to the original example though, as each property is now observed/subscribed to individually, so the recompositions you see after this refactor could be more narrow (a good thing).
```
class Position(x: Int, y: Int) {
var x by mutableStateOf(x)
var y by mutableStateOf(y)
}
// source of Example is identical to original
@Composable fun Example() {
var p = remember { Position(0, 0) }
PositionChanger(
position=p,
onXChange={ p.x = it }
onYChange={ p.y = it }
)
}
```
“
Bug: 156546430
Bug: 152993135
Bug: 152050010
Bug: 148866188
Bug: 148422703
Bug: 148394427
Bug: 146362815
Bug: 146342522
Bug: 143413369
Bug: 135715219
Bug: 126418732
Bug: 147088098
Bug: 143263925
Bug: 139653744
Change-Id: I409e8c158841eae1dd548b33f1ec80bb609cba31
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/frames/FrameDiagnosticTests.kt
M compose/compose-runtime/api/0.1.0-dev12.txt
M compose/compose-runtime/api/current.txt
M compose/compose-runtime/api/public_plus_experimental_0.1.0-dev12.txt
M compose/compose-runtime/api/public_plus_experimental_current.txt
M compose/compose-runtime/api/restricted_0.1.0-dev12.txt
M compose/compose-runtime/api/restricted_current.txt
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/benchmark/ComposeBenchmark.kt
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/benchmark/SiblingBenchmark.kt
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/benchmark/dbmonster/DbMonster.kt
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/benchmark/realworld4/RealWorld4_DataModels.kt
M compose/compose-runtime/samples/src/main/java/androidx/compose/samples/ModelSamples.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/FrameManager.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Model.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/MutableState.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Observe.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Recompose.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/StableMarker.kt
M ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/ModelObserverBenchmark.kt
M ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/RadioGroupBenchmark.kt
M ui/integration-tests/demos/src/main/java/androidx/ui/demos/DemoColorPalette.kt
M ui/integration-tests/src/main/java/androidx/ui/integration/test/foundation/RectsInColumnSharedModelTestCase.kt
M ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/WebComponentActivity.kt
M ui/ui-animation/src/main/java/androidx/ui/animation/AnimatedValueEffects.kt
M ui/ui-animation/src/main/java/androidx/ui/animation/Transition.kt
M ui/ui-core/src/androidTest/java/androidx/ui/core/test/AndroidLayoutDrawTest.kt
M ui/ui-core/src/androidTest/java/androidx/ui/core/test/AndroidViewCompatTest.kt
M ui/ui-core/src/androidTest/java/androidx/ui/core/test/ClipTest.kt
M ui/ui-core/src/androidTest/java/androidx/ui/core/test/DrawShadowTest.kt
M ui/ui-core/src/androidTest/java/androidx/ui/core/test/ModelReadsTest.kt
M ui/ui-core/src/androidTest/java/androidx/ui/core/test/OpacityTest.kt
D ui/ui-core/src/androidTest/java/androidx/ui/core/test/ValueModel.kt
M ui/ui-core/src/androidTest/java/androidx/ui/core/test/WithConstraintsTest.kt
M ui/ui-core/src/androidTest/java/androidx/ui/res/ResourcesTest.kt
M ui/ui-core/src/androidTest/java/androidx/ui/semantics/SemanticsTests.kt
M ui/ui-core/src/main/java/androidx/ui/core/ModelObserver.kt
M ui/ui-core/src/main/java/androidx/ui/res/Resources.kt
M ui/ui-core/src/test/java/androidx/ui/core/selection/SelectionManagerDragTest.kt
M ui/ui-core/src/test/java/androidx/ui/core/selection/SelectionManagerLongPressDragTest.kt
M ui/ui-core/src/test/java/androidx/ui/core/selection/SelectionManagerTest.kt
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/DeterminateProgressTest.kt
M ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/ContainerTest.kt
M ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/OnPositionedTest.kt
M ui/ui-material/api/0.1.0-dev12.txt
M ui/ui-material/api/current.txt
M ui/ui-material/api/public_plus_experimental_0.1.0-dev12.txt
M ui/ui-material/api/public_plus_experimental_current.txt
M ui/ui-material/api/restricted_0.1.0-dev12.txt
M ui/ui-material/api/restricted_current.txt
M ui/ui-material/integration-tests/material-demos/src/main/java/androidx/ui/material/demos/DynamicThemeActivity.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/DrawerTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ProgressIndicatorTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/RadioGroupUiTest.kt
M ui/ui-material/src/main/java/androidx/ui/material/Color.kt
M ui/ui-material/src/main/java/androidx/ui/material/Scaffold.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/AndroidComposeTestCaseRunnerTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/MultipleComposeRootsTest.kt
M ui/ui-text/src/main/java/androidx/ui/text/CoreText.kt
M ui/ui-text/src/main/java/androidx/ui/text/CoreTextField.kt
https://android-review.googlesource.com/1311293
Branch: androidx-master-dev
commit fcf76b3241844f18106d6e850004952046d4bfb6
Author: Leland Richardson <lelandr@google.com>
Date: Wed May 13 16:58:59 2020
Deprecate @Model
Relnote: “
@Model annotation is now deprecated. Use state and mutableStateOf as alternatives. This deprecation decision was reached after much careful discussion.
Justification
=============
Rationale includes but is not limited to:
- Reduces API surface area and concepts we need to teach
- More closely aligns with other comparable toolkits (Swift UI, React, Flutter)
- Reversible decision. We can always bring @Model back later.
- Removes corner-case usage and difficult to answer questions about configuring @Model as things we need to handle
- @Model data classes, equals, hashcode, etc.
- How do I have some properties “observed” and others not?
- How do I specify structural vs. referential equality to be used in observation?
- Reduces “magic” in the system. Would reduce the likelihood of someone assuming system was smarter than it is (ie, it knowing how to diff a list)
- Makes the granularity of observation more intuitive.
- Improves refactorability from variable -> property on class
- Potentially opens up possibilities to do hand-crafted State-specific optimizations
- More closely aligns with the rest of the ecosystem and reduces ambiguity towards immutable or us “embracing mutable state”
Migration Notes
===============
Almost all existing usages of @Model are fairly trivially transformed in one of two ways. The example below has a @Model class with two properties just for the sake of example, and has it being used in a composable.
```
@Model class Position(
var x: Int,
var y: Int
)
@Composable fun Example() {
var p = remember { Position(0, 0) }
PositionChanger(
position=p,
onXChange={ p.x = it }
onYChange={ p.y = it }
)
}
```
Alternative 1: Use State<OriginalClass> and create copies.
----------------------------------------------------------
This approach is made easier with Kotlin’s data classes. Essentially, make all previously `var` properties into `val` properties of a data class, and then use `state` instead of `remember`, and assign the state value to cloned copies of the original using the data class `copy(...)` convenience method.
It’s important to note that this approach only works when the only mutations to that class were done in the same scope that the `State` instance is created. If the class is internally mutating itself outside of the scope of usage, and you are relying on the observation of that, then the next approach is the one you will want to use.
```
data class Position(
val x: Int,
val y: Int
)
@Composable fun Example() {
var p by state { Position(0, 0) }
PositionChanger(
position=p,
onXChange={ p = p.copy(x=it) }
onYChange={ p = p.copy(y=it) }
)
}
```
Alternative 2: Use mutableStateOf and property delegates
--------------------------------------------------------
This approach is made easier with Kotlin’s property delegates and the `mutableStateOf` API which allows you to create MutableState instances outside of composition. Essentially, replace all `var` properties of the original class with `var` properties with `mutableStateOf` as their property delegate. This has the advantage that the usage of the class will not change at all, only the internal implementation of it. The behavior is not completely identical to the original example though, as each property is now observed/subscribed to individually, so the recompositions you see after this refactor could be more narrow (a good thing).
```
class Position(x: Int, y: Int) {
var x by mutableStateOf(x)
var y by mutableStateOf(y)
}
// source of Example is identical to original
@Composable fun Example() {
var p = remember { Position(0, 0) }
PositionChanger(
position=p,
onXChange={ p.x = it }
onYChange={ p.y = it }
)
}
```
“
Bug: 156546430
Bug: 152993135
Bug: 152050010
Bug: 148866188
Bug: 148422703
Bug: 148394427
Bug: 146362815
Bug: 146342522
Bug: 143413369
Bug: 135715219
Bug: 126418732
Bug: 147088098
Bug: 143263925
Bug: 139653744
Change-Id: I409e8c158841eae1dd548b33f1ec80bb609cba31
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/frames/FrameDiagnosticTests.kt
M compose/compose-runtime/api/0.1.0-dev12.txt
M compose/compose-runtime/api/current.txt
M compose/compose-runtime/api/public_plus_experimental_0.1.0-dev12.txt
M compose/compose-runtime/api/public_plus_experimental_current.txt
M compose/compose-runtime/api/restricted_0.1.0-dev12.txt
M compose/compose-runtime/api/restricted_current.txt
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/benchmark/ComposeBenchmark.kt
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/benchmark/SiblingBenchmark.kt
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/benchmark/dbmonster/DbMonster.kt
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/benchmark/realworld4/RealWorld4_DataModels.kt
M compose/compose-runtime/samples/src/main/java/androidx/compose/samples/ModelSamples.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/FrameManager.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Model.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/MutableState.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Observe.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Recompose.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/StableMarker.kt
M ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/ModelObserverBenchmark.kt
M ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/RadioGroupBenchmark.kt
M ui/integration-tests/demos/src/main/java/androidx/ui/demos/DemoColorPalette.kt
M ui/integration-tests/src/main/java/androidx/ui/integration/test/foundation/RectsInColumnSharedModelTestCase.kt
M ui/ui-android-view/integration-tests/android-view-demos/src/main/java/androidx/ui/androidview/demos/WebComponentActivity.kt
M ui/ui-animation/src/main/java/androidx/ui/animation/AnimatedValueEffects.kt
M ui/ui-animation/src/main/java/androidx/ui/animation/Transition.kt
M ui/ui-core/src/androidTest/java/androidx/ui/core/test/AndroidLayoutDrawTest.kt
M ui/ui-core/src/androidTest/java/androidx/ui/core/test/AndroidViewCompatTest.kt
M ui/ui-core/src/androidTest/java/androidx/ui/core/test/ClipTest.kt
M ui/ui-core/src/androidTest/java/androidx/ui/core/test/DrawShadowTest.kt
M ui/ui-core/src/androidTest/java/androidx/ui/core/test/ModelReadsTest.kt
M ui/ui-core/src/androidTest/java/androidx/ui/core/test/OpacityTest.kt
D ui/ui-core/src/androidTest/java/androidx/ui/core/test/ValueModel.kt
M ui/ui-core/src/androidTest/java/androidx/ui/core/test/WithConstraintsTest.kt
M ui/ui-core/src/androidTest/java/androidx/ui/res/ResourcesTest.kt
M ui/ui-core/src/androidTest/java/androidx/ui/semantics/SemanticsTests.kt
M ui/ui-core/src/main/java/androidx/ui/core/ModelObserver.kt
M ui/ui-core/src/main/java/androidx/ui/res/Resources.kt
M ui/ui-core/src/test/java/androidx/ui/core/selection/SelectionManagerDragTest.kt
M ui/ui-core/src/test/java/androidx/ui/core/selection/SelectionManagerLongPressDragTest.kt
M ui/ui-core/src/test/java/androidx/ui/core/selection/SelectionManagerTest.kt
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/DeterminateProgressTest.kt
M ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/ContainerTest.kt
M ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/OnPositionedTest.kt
M ui/ui-material/api/0.1.0-dev12.txt
M ui/ui-material/api/current.txt
M ui/ui-material/api/public_plus_experimental_0.1.0-dev12.txt
M ui/ui-material/api/public_plus_experimental_current.txt
M ui/ui-material/api/restricted_0.1.0-dev12.txt
M ui/ui-material/api/restricted_current.txt
M ui/ui-material/integration-tests/material-demos/src/main/java/androidx/ui/material/demos/DynamicThemeActivity.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/DrawerTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ProgressIndicatorTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/RadioGroupUiTest.kt
M ui/ui-material/src/main/java/androidx/ui/material/Color.kt
M ui/ui-material/src/main/java/androidx/ui/material/Scaffold.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/AndroidComposeTestCaseRunnerTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/MultipleComposeRootsTest.kt
M ui/ui-text/src/main/java/androidx/ui/text/CoreText.kt
M ui/ui-text/src/main/java/androidx/ui/text/CoreTextField.kt
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 082882b45b4f332b1a6a319604153bbcbd9bf756
Author: Doris Liu <tianliu@google.com>
Date: Thu Jan 21 12:15:12 2021
Deprecate AnimatedValue/Float
This is the first step of the deprecation, which marks the
APIs as @Deprecate. The remaining work is for each component
that uses AnimatedFloat/Value to move onto the
new Animatable API.
RelNote: "AnimatedValue/Float is now deprecated. Please use
Animatable instead."
Bug: 177457083
Test: Removed
Change-Id: I713457f88b04e50fbc5deb70a5bb7bbcf777e630
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.txt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/AnimatedValue.kt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/DynamicTargetAnimation.kt
D compose/animation/animation-core/src/test/java/androidx/compose/animation/core/AnimatedValueTest.kt
M compose/animation/animation-core/src/test/java/androidx/compose/animation/core/TypeConverterTest.kt
M compose/animation/animation/api/current.txt
M compose/animation/animation/api/public_plus_experimental_current.txt
M compose/animation/animation/api/restricted_current.txt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/AnimatedValueEffects.kt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/AnimationModifier.kt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/Crossfade.kt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/EnterExitTransition.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/animation/FlingConfig.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Scrollable.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Zoomable.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldCursor.kt
M compose/material/material/samples/src/main/java/androidx/compose/material/samples/ScaffoldSamples.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/BottomSheetScaffold.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/ModalBottomSheet.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Slider.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/SnackbarHost.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Swipeable.kt
M compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/LayerModifierSamples.kt
https://android-review.googlesource.com/1556513
Branch: androidx-main
commit 082882b45b4f332b1a6a319604153bbcbd9bf756
Author: Doris Liu <tianliu@google.com>
Date: Thu Jan 21 12:15:12 2021
Deprecate AnimatedValue/Float
This is the first step of the deprecation, which marks the
APIs as @Deprecate. The remaining work is for each component
that uses AnimatedFloat/Value to move onto the
new Animatable API.
RelNote: "AnimatedValue/Float is now deprecated. Please use
Animatable instead."
Bug: 177457083
Test: Removed
Change-Id: I713457f88b04e50fbc5deb70a5bb7bbcf777e630
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.txt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/AnimatedValue.kt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/DynamicTargetAnimation.kt
D compose/animation/animation-core/src/test/java/androidx/compose/animation/core/AnimatedValueTest.kt
M compose/animation/animation-core/src/test/java/androidx/compose/animation/core/TypeConverterTest.kt
M compose/animation/animation/api/current.txt
M compose/animation/animation/api/public_plus_experimental_current.txt
M compose/animation/animation/api/restricted_current.txt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/AnimatedValueEffects.kt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/AnimationModifier.kt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/Crossfade.kt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/EnterExitTransition.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/animation/FlingConfig.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Scrollable.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Zoomable.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldCursor.kt
M compose/material/material/samples/src/main/java/androidx/compose/material/samples/ScaffoldSamples.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/BottomSheetScaffold.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/ModalBottomSheet.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Slider.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/SnackbarHost.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Swipeable.kt
M compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/LayerModifierSamples.kt
cl...@google.com <cl...@google.com>
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit e908f36986a2a2b1adc6f9ac3890c0e3e964c47b
Author: Doris Liu <tianliu@google.com>
Date: Mon Jan 25 22:12:34 2021
Migrate animateContentSize to Animatable
RelNote: "Updated Modifier.animateContentSize API to be consistent
with the rest of the animation system."
Bug: 177457083
Test: Updated
Change-Id: I0bf752ff98bd11094a834099cbd1b42c600ebcaf
M compose/animation/animation/api/current.txt
M compose/animation/animation/api/public_plus_experimental_current.txt
M compose/animation/animation/api/restricted_current.txt
M compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/AnimationModifierTest.kt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/AnimationModifier.kt
https://android-review.googlesource.com/1559981
Branch: androidx-main
commit e908f36986a2a2b1adc6f9ac3890c0e3e964c47b
Author: Doris Liu <tianliu@google.com>
Date: Mon Jan 25 22:12:34 2021
Migrate animateContentSize to Animatable
RelNote: "Updated Modifier.animateContentSize API to be consistent
with the rest of the animation system."
Bug: 177457083
Test: Updated
Change-Id: I0bf752ff98bd11094a834099cbd1b42c600ebcaf
M compose/animation/animation/api/current.txt
M compose/animation/animation/api/public_plus_experimental_current.txt
M compose/animation/animation/api/restricted_current.txt
M compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/AnimationModifierTest.kt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/AnimationModifier.kt
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit b78571e5e6c03de373857162141f099fecb10a70
Author: Doris Liu <tianliu@google.com>
Date: Mon Jan 25 20:53:20 2021
Migrate Crossfade from using AnimatedFloat to using transition v2
Relnote: "Updated Crossfade's method signature to be more consistent
with the rest of the animation system."
Bug: 177457083
Test: All existing tests pass
Change-Id: Ib05ed5405bd4a781d2d78c84b7c06c0d153e8dc2
M compose/animation/animation/api/current.txt
M compose/animation/animation/api/public_plus_experimental_current.txt
M compose/animation/animation/api/restricted_current.txt
M compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/CrossfadeDemo.kt
M compose/animation/animation/samples/src/main/java/androidx/compose/animation/samples/CrossfadeSample.kt
M compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/CrossfadeTest.kt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/Crossfade.kt
https://android-review.googlesource.com/1559996
Branch: androidx-main
commit b78571e5e6c03de373857162141f099fecb10a70
Author: Doris Liu <tianliu@google.com>
Date: Mon Jan 25 20:53:20 2021
Migrate Crossfade from using AnimatedFloat to using transition v2
Relnote: "Updated Crossfade's method signature to be more consistent
with the rest of the animation system."
Bug: 177457083
Test: All existing tests pass
Change-Id: Ib05ed5405bd4a781d2d78c84b7c06c0d153e8dc2
M compose/animation/animation/api/current.txt
M compose/animation/animation/api/public_plus_experimental_current.txt
M compose/animation/animation/api/restricted_current.txt
M compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/CrossfadeDemo.kt
M compose/animation/animation/samples/src/main/java/androidx/compose/animation/samples/CrossfadeSample.kt
M compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/CrossfadeTest.kt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/Crossfade.kt
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
commit 3286e61018fe0f1dd1aa3c2978ea4d347c630b21
Author: Doris Liu <tianliu@google.com>
Date: Tue Feb 02 15:17:32 2021
Migrate AnimatedVisibility from AnimatedFoo to Animatable
Relnote: "Unified the param name for AnimationSpec to animationSpec
across the animation system. Also constrain the Enter/ExitTransition
to accept FiniteAnimationSpec."
Test: All tests pass
Bug: 177457083
Change-Id: Ie47c54ef91d1a4330e4d6f0f18ec3cde78d903ad
M compose/animation/animation/api/current.txt
M compose/animation/animation/api/public_plus_experimental_current.txt
M compose/animation/animation/api/restricted_current.txt
M compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/AnimatedVisibilityDemo.kt
M compose/animation/animation/samples/src/main/java/androidx/compose/animation/samples/AnimatedVisibilitySamples.kt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/AnimatedVisibility.kt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/EnterExitTransition.kt
https://android-review.googlesource.com/1570789
Branch: androidx-main
commit 3286e61018fe0f1dd1aa3c2978ea4d347c630b21
Author: Doris Liu <tianliu@google.com>
Date: Tue Feb 02 15:17:32 2021
Migrate AnimatedVisibility from AnimatedFoo to Animatable
Relnote: "Unified the param name for AnimationSpec to animationSpec
across the animation system. Also constrain the Enter/ExitTransition
to accept FiniteAnimationSpec."
Test: All tests pass
Bug: 177457083
Change-Id: Ie47c54ef91d1a4330e4d6f0f18ec3cde78d903ad
M compose/animation/animation/api/current.txt
M compose/animation/animation/api/public_plus_experimental_current.txt
M compose/animation/animation/api/restricted_current.txt
M compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/AnimatedVisibilityDemo.kt
M compose/animation/animation/samples/src/main/java/androidx/compose/animation/samples/AnimatedVisibilitySamples.kt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/AnimatedVisibility.kt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/EnterExitTransition.kt
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-main
commit b98e676468ea3f3a07549c2d873b9e1bce944205
Author: Doris Liu <tianliu@google.com>
Date: Wed Feb 03 18:17:31 2021
Remove deprecated animate, animatedValue, AnimatedValue
Relnote: "animate, animatedValue, AnimatedValue APIs have
been removed"
Bug: 177457083
Bug: 175134945
Test: Already removed
Change-Id: If27bc4f86851a978239709a6f7ddab8ec94070ca
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.txt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/AnimateAsState.kt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/AnimatedValue.kt
M compose/animation/animation/api/current.txt
M compose/animation/animation/api/public_plus_experimental_current.txt
M compose/animation/animation/api/restricted_current.txt
M compose/animation/animation/samples/src/main/java/androidx/compose/animation/samples/AnimatedValueSamples.kt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/AnimatedValueEffects.kt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/SingleValueAnimation.kt
https://android-review.googlesource.com/1573623
Branch: androidx-main
commit b98e676468ea3f3a07549c2d873b9e1bce944205
Author: Doris Liu <tianliu@google.com>
Date: Wed Feb 03 18:17:31 2021
Remove deprecated animate, animatedValue, AnimatedValue
Relnote: "animate, animatedValue, AnimatedValue APIs have
been removed"
Bug: 177457083
Bug: 175134945
Test: Already removed
Change-Id: If27bc4f86851a978239709a6f7ddab8ec94070ca
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.txt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/AnimateAsState.kt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/AnimatedValue.kt
M compose/animation/animation/api/current.txt
M compose/animation/animation/api/public_plus_experimental_current.txt
M compose/animation/animation/api/restricted_current.txt
M compose/animation/animation/samples/src/main/java/androidx/compose/animation/samples/AnimatedValueSamples.kt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/AnimatedValueEffects.kt
M compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/SingleValueAnimation.kt
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-main
commit 42c913ab535f0d76554e6805aa9995f2fa6222df
Author: Doris Liu <tianliu@google.com>
Date: Wed Feb 03 11:44:37 2021
Move zoomable, Slider, SnackbarHost to suspend animation
Relnote: "ZoomableController.smoothScaleBy and
ZoomableController.stopAnimation are now suspend functions."
Bug: 177457083
Test: Updated and passed
Change-Id: I7f970ebd60086d3fbe4d805ac115de749bbd4240
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/public_plus_experimental_current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/ZoomableSample.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ZoomableTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Zoomable.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Slider.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/SnackbarHost.kt
https://android-review.googlesource.com/1573402
Branch: androidx-main
commit 42c913ab535f0d76554e6805aa9995f2fa6222df
Author: Doris Liu <tianliu@google.com>
Date: Wed Feb 03 11:44:37 2021
Move zoomable, Slider, SnackbarHost to suspend animation
Relnote: "ZoomableController.smoothScaleBy and
ZoomableController.stopAnimation are now suspend functions."
Bug: 177457083
Test: Updated and passed
Change-Id: I7f970ebd60086d3fbe4d805ac115de749bbd4240
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/public_plus_experimental_current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/ZoomableSample.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ZoomableTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Zoomable.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Slider.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/SnackbarHost.kt
ap...@google.com <ap...@google.com> #9
Project: platform/frameworks/support
Branch: androidx-main
commit 0a55e899914b1398bed87b33303b083b2efcd418
Author: Doris Liu <tianliu@google.com>
Date: Thu Feb 04 16:28:30 2021
Remove AnimationClockObservable and AnimatedFloat
RelNote: "AnimationClockObservable and subclasses have been
removed. AnimatedFloat has been removed."
Note: this CL is based on aosp/1576426 and aosp/1570862, but
the parent pointer isn't pointing to either of those. This is
to prevent the rebasing of this CL from accidentally uploading
patches to the two CLs above, creating unnecessary churns.
Bug: 177457083
Bug: 178448485
Test: removed
Change-Id: Icde5248072620b741bdf4d8cf59291e7b2994e6a
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.txt
D compose/animation/animation-core/src/androidMain/kotlin/androidx/compose/animation/core/AndroidAnimationClock.kt
D compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/AnimatedValue.kt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/Animation.kt
D compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/AnimationClock.kt
D compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/AnimationClockObservable.kt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/DynamicTargetAnimation.kt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/ManualFrameClock.kt
D compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/MonotonicFrameAnimationClock.kt
D compose/animation/animation-core/src/test/java/androidx/compose/animation/core/AnimationClockTest.kt
M compose/animation/animation-core/src/test/java/androidx/compose/animation/core/AnimationTest.kt
M compose/animation/animation/api/current.txt
M compose/animation/animation/api/public_plus_experimental_current.txt
M compose/animation/animation/api/restricted_current.txt
D compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/AnimatedValueEffects.kt
D compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/DisposableAnimationClock.kt
D compose/animation/animation/src/test/kotlin/androidx/compose/animation/DisposableAnimationClockTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollableTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/animation/FlingConfig.kt
M compose/foundation/foundation/src/desktopTest/kotlin/androidx/compose/foundation/gestures/DesktopScrollableTest.kt
D compose/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/AnimationClockBenchmark.kt
M compose/test-utils/src/commonMain/kotlin/androidx/compose/testutils/AnimationClocks.kt
M compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/MonotonicFrameClockTestRule.kt
M compose/ui/ui-test/api/current.txt
M compose/ui/ui-test/api/public_plus_experimental_current.txt
M compose/ui/ui-test/api/restricted_current.txt
M compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/CoroutineBuilders.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/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidCompositionLocals.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/platform/CompositionLocals.kt
M compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopOwners.kt
M compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/Wrapper.kt
https://android-review.googlesource.com/1576077
Branch: androidx-main
commit 0a55e899914b1398bed87b33303b083b2efcd418
Author: Doris Liu <tianliu@google.com>
Date: Thu Feb 04 16:28:30 2021
Remove AnimationClockObservable and AnimatedFloat
RelNote: "AnimationClockObservable and subclasses have been
removed. AnimatedFloat has been removed."
Note: this CL is based on aosp/1576426 and aosp/1570862, but
the parent pointer isn't pointing to either of those. This is
to prevent the rebasing of this CL from accidentally uploading
patches to the two CLs above, creating unnecessary churns.
Bug: 177457083
Bug: 178448485
Test: removed
Change-Id: Icde5248072620b741bdf4d8cf59291e7b2994e6a
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.txt
D compose/animation/animation-core/src/androidMain/kotlin/androidx/compose/animation/core/AndroidAnimationClock.kt
D compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/AnimatedValue.kt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/Animation.kt
D compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/AnimationClock.kt
D compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/AnimationClockObservable.kt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/DynamicTargetAnimation.kt
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/ManualFrameClock.kt
D compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/MonotonicFrameAnimationClock.kt
D compose/animation/animation-core/src/test/java/androidx/compose/animation/core/AnimationClockTest.kt
M compose/animation/animation-core/src/test/java/androidx/compose/animation/core/AnimationTest.kt
M compose/animation/animation/api/current.txt
M compose/animation/animation/api/public_plus_experimental_current.txt
M compose/animation/animation/api/restricted_current.txt
D compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/AnimatedValueEffects.kt
D compose/animation/animation/src/commonMain/kotlin/androidx/compose/animation/DisposableAnimationClock.kt
D compose/animation/animation/src/test/kotlin/androidx/compose/animation/DisposableAnimationClockTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollableTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/animation/FlingConfig.kt
M compose/foundation/foundation/src/desktopTest/kotlin/androidx/compose/foundation/gestures/DesktopScrollableTest.kt
D compose/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/AnimationClockBenchmark.kt
M compose/test-utils/src/commonMain/kotlin/androidx/compose/testutils/AnimationClocks.kt
M compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/MonotonicFrameClockTestRule.kt
M compose/ui/ui-test/api/current.txt
M compose/ui/ui-test/api/public_plus_experimental_current.txt
M compose/ui/ui-test/api/restricted_current.txt
M compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/CoroutineBuilders.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/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidCompositionLocals.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/platform/CompositionLocals.kt
M compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopOwners.kt
M compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/Wrapper.kt
ti...@google.com <ti...@google.com> #10
ap...@google.com <ap...@google.com> #11
Project: platform/frameworks/support
Branch: androidx-main
commit 1b90334880260ad5c1f0fde255fd1b6715221844
Author: Doris Liu <tianliu@google.com>
Date: Mon Feb 08 17:59:28 2021
Remove TargetAnimation API
TargetAnimation was used as a part of the AnimatedFloat/Value
API. Now that all usages have been migrated onto the new
suspend animation API. No need to keep this around any more.
Also removes unused @ExperimentalAnimationApi import in material.
RelNote: TargetAnimation API has been removed.
Bug: 177457083
Test: all tests pass
Change-Id: If47d1f88096955c131af20c1660a5c450d5b7ed9
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.txt
A compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/AnimationEndReason.kt
D compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/DynamicTargetAnimation.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/BottomSheetScaffold.kt
https://android-review.googlesource.com/1580890
Branch: androidx-main
commit 1b90334880260ad5c1f0fde255fd1b6715221844
Author: Doris Liu <tianliu@google.com>
Date: Mon Feb 08 17:59:28 2021
Remove TargetAnimation API
TargetAnimation was used as a part of the AnimatedFloat/Value
API. Now that all usages have been migrated onto the new
suspend animation API. No need to keep this around any more.
Also removes unused @ExperimentalAnimationApi import in material.
RelNote: TargetAnimation API has been removed.
Bug: 177457083
Test: all tests pass
Change-Id: If47d1f88096955c131af20c1660a5c450d5b7ed9
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.txt
A compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/AnimationEndReason.kt
D compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/DynamicTargetAnimation.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/BottomSheetScaffold.kt
Description
The work involved is:
AnimatedFoo
usage from public APIAnimatedFoo
to the new Animatable, and add that to the API doc.AnimatedFoo
@Deprecate, and suppress deprecation in places where it's used as impl detail before all usages are migrated to new suspend APIs.AnimatedFoo
from animation lib (this may happen later)