使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Dynamicanimation
使用基于物理特性的动画 API 制作流畅的动画。
最近更新时间 |
稳定版 |
候选版 |
Beta 版 |
Alpha 版 |
2025 年 4 月 9 日 |
1.1.0 |
- |
- |
- |
声明依赖项
如需添加 DynamicAnimation 的依赖项,您必须将 Google Maven 制品库添加到项目中。如需了解详情,请参阅 Google 的 Maven 代码库。
在应用或模块的 build.gradle
文件中添加所需工件的依赖项:
Groovy
dependencies {
// Java language implementation
implementation "androidx.dynamicanimation:dynamicanimation:1.1.0"
// Kotlin
implementation "androidx.dynamicanimation:dynamicanimation-ktx:"
}
Kotlin
dependencies {
// Java language implementation
implementation("androidx.dynamicanimation:dynamicanimation:1.1.0")
// Kotlin
implementation("androidx.dynamicanimation:dynamicanimation-ktx:")
}
如需详细了解依赖项,请参阅添加 build 依赖项。
反馈
您的反馈将帮助我们改进 Jetpack。如果您发现了新问题,或对此库有任何改进建议,请告诉我们。创建新问题前,请先查看此库中的现有问题。您可以点击星标按钮,为现有问题投票。
创建新问题
如需了解详情,请参阅问题跟踪器文档。
版本 1.1.0
版本 1.1.0
2025 年 4 月 9 日
发布了 androidx.dynamicanimation:dynamicanimation:1.1.0
和 androidx.dynamicanimation:dynamicanimation-ktx:1.1.0
。版本 1.1.0 包含这些提交内容。
API 变更
版本 1.1.0-rc01
2025 年 3 月 26 日
发布了 androidx.dynamicanimation:dynamicanimation:1.1.0-rc01
和 androidx.dynamicanimation:dynamicanimation-ktx:1.1.0-rc01
。版本 1.1.0-rc01 包含这些提交内容。
版本 1.1.0-beta01
2025 年 3 月 12 日
发布了 androidx.dynamicanimation:dynamicanimation:1.1.0-beta01
。版本 1.1.0-beta01 包含这些提交内容。
API 变更
- 隐藏了 AnimationHandler 类的公开范围。(I8072e)
bug 修复
版本 1.1.0-alpha03
2019 年 12 月 4 日
发布了 androidx.dynamicanimation:dynamicanimation:1.1.0-alpha03
,该版本与 1.1.0-alpha02
相比没有明显的公开变更。版本 1.1.0-alpha03 中包含这些提交内容。
版本 1.1.0-alpha02
2019 年 7 月 2 日
发布了 androidx.dynamicanimation:dynamicanimation:1.1.0-alpha02
。点击此处可查看此版本中包含的提交内容。
bug 修复
版本 1.1.0-alpha01
2019 年 4 月 3 日
发布了 androidx.dynamicanimation:dynamicanimation:1.1.0-alpha01
。点击此处可查看此版本中包含的提交内容。
Dynamicanimation-Ktx 版本 1.0.0
版本 1.0.0-beta01
2025 年 3 月 12 日
发布了 androidx.dynamicanimation:dynamicanimation-ktx:1.0.0-beta01
。版本 1.0.0-beta01 包含这些提交内容。
DynamicAnimation-Ktx 版本 1.0.0-alpha03
2019 年 12 月 4 日
发布了 androidx.dynamicanimation:dynamicanimation-ktx:1.0.0-alpha03
,该版本与 1.0.0-alpha02
相比没有明显的公开变更。版本 1.0.0-alpha03 中包含这些提交内容。
DynamicAnimation-Ktx 版本 1.0.0-alpha02
2019 年 4 月 3 日
发布了 androidx.dynamicanimation:dynamicanimation-ktx:1.0.0-alpha02
。点击此处可查看此版本中包含的提交内容。
API 变更
- 更改了
springAnimationOf
和 flingAnimationOf
以接受 setter 和 getter(而不是一个目标和 FloatPropertyCompat
,以分别实例化 SpringAnimation
和 FlingAnimation
。
Dynamicanimation-Ktx 版本 1.0.0-alpha01
2019 年 2 月 7 日
发布了 androidx.dynamicanimation:dynamicanimation-ktx:1.0.0-alpha01
。这是 dynamic-animation-ktx 的第一个版本。
新功能
- 新增了 Kotlin API,用于创建
SpringAnimations
和 FlingAnimations
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Dynamicanimation\n================\n\n[User Guide](/guide/topics/graphics/spring-animation) [Code Sample](https://github.com/android/animation-samples/tree/main/Motion#list--oscillation) \nAPI Reference \n[androidx.dynamicanimation.animation](/reference/kotlin/androidx/dynamicanimation/animation/package-summary) \nCreate smooth animations with a physics-based animation API. \n\n| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |\n|---------------|------------------------------------------------------------|-------------------|--------------|---------------|\n| April 9, 2025 | [1.1.0](/jetpack/androidx/releases/dynamicanimation#1.1.0) | - | - | - |\n\nDeclaring dependencies\n----------------------\n\nTo add a dependency on DynamicAnimation, you must add the Google Maven repository to your\nproject. Read [Google's Maven repository](/studio/build/dependencies#google-maven)\nfor more information.\n\nAdd the dependencies for the artifacts you need in the `build.gradle` file for\nyour app or module: \n\n### Groovy\n\n```groovy\ndependencies {\n // Java language implementation\n implementation \"androidx.dynamicanimation:dynamicanimation:1.1.0\"\n\n // Kotlin\n implementation \"androidx.dynamicanimation:dynamicanimation-ktx:\"\n}\n```\n\n### Kotlin\n\n```kotlin\ndependencies {\n // Java language implementation\n implementation(\"androidx.dynamicanimation:dynamicanimation:1.1.0\")\n\n // Kotlin\n implementation(\"androidx.dynamicanimation:dynamicanimation-ktx:\")\n}\n```\n\nFor more information about dependencies, see [Add build dependencies](/studio/build/dependencies).\n\nFeedback\n--------\n\nYour feedback helps make Jetpack better. Let us know if you discover new issues or have\nideas for improving this library. Please take a look at the\n[existing issues](https://issuetracker.google.com/issues?q=componentid:460912%20status:open)\nin this library before you create a new one. You can add your vote to an existing issue by\nclicking the star button.\n\n[Create a new issue](https://issuetracker.google.com/issues/new?component=460912&template=1422624)\n\nSee the [Issue Tracker documentation](https://developers.google.com/issue-tracker)\nfor more information.\n\nVersion 1.1.0\n-------------\n\n### Version 1.1.0\n\nApril 9, 2025\n\n`androidx.dynamicanimation:dynamicanimation:1.1.0` and `androidx.dynamicanimation:dynamicanimation-ktx:1.1.0` are released. Version 1.1.0 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/b82591147dfcbb8a7c0b9d03b0ff7ae5c648ad83..d5923c378c00b537f3421786eb3a50e6f6868386/dynamicanimation).\n\n**API Changes**\n\n- `DynamicAnimation` library is now stable.\n\n### Version 1.1.0-rc01\n\nMarch 26, 2025\n\n`androidx.dynamicanimation:dynamicanimation:1.1.0-rc01` and `androidx.dynamicanimation:dynamicanimation-ktx:1.1.0-rc01` are released. Version 1.1.0-rc01 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/8870a8ee99ec618927a9edb4b6e74b8570381149..b82591147dfcbb8a7c0b9d03b0ff7ae5c648ad83/).\n\n### Version 1.1.0-beta01\n\nMarch 12, 2025\n\n`androidx.dynamicanimation:dynamicanimation:1.1.0-beta01` is released. Version 1.1.0-beta01 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/ce2902e01f920f17637879b6c918ffe987d2f35b..8870a8ee99ec618927a9edb4b6e74b8570381149/dynamicanimation/dynamicanimation).\n\n**API Changes**\n\n- Hide AnimationHandler class visibility. ([I8072e](https://android-review.googlesource.com/#/q/I8072eb333158a2f8a05590e1bb01dd59ddef9183))\n\n**Bug Fixes**\n\n- This library now uses [JSpecify nullness annotations](https://jspecify.dev/), which are type-use. Kotlin developers should use the following compiler argument to enforce correct usage: `-Xjspecify-annotations=strict` (this is the default starting with version 2.1.0 of the Kotlin compiler). ([I70783](https://android-review.googlesource.com/#/q/I707835de5ef50bb485fbb79d26600153ca22f6e2), [b/326456246](https://issuetracker.google.com/issues/326456246))\n\n### Version 1.1.0-alpha03\n\nDecember 4, 2019\n\n`androidx.dynamicanimation:dynamicanimation:1.1.0-alpha03` is released with no notable public changes since `1.1.0-alpha02`. [Version 1.1.0-alpha03 contains these commits](https://android.googlesource.com/platform/frameworks/support/+log/668764cd97f4074bc1f309fa4b55467402332773..ce2902e01f920f17637879b6c918ffe987d2f35b/dynamic-animation).\n\n### Version 1.1.0-alpha02\n\nJuly 2, 2019\n\n`androidx.dynamicanimation:dynamicanimation:1.1.0-alpha02` is released. The commits included in this version can be found [here](https://android.googlesource.com/platform/frameworks/support/+log/21e165dc2f0fe0acc7ced317d75f4e92155a8e35..668764cd97f4074bc1f309fa4b55467402332773/dynamic-animation).\n| **Note:** This version is dependent on the Java 8 programming language. Please read [Use Java 8 language features](/studio/write/java8-support) to learn how to use it in your project.\n\n**Bug fixes**\n\n- Fixed a bug in the handling of pending position when canceled ([aosp/978170](https://android-review.googlesource.com/c/978170))\n\n### Version 1.1.0-alpha01\n\nApril 3, 2019\n\n`androidx.dynamicanimation:dynamicanimation:1.1.0-alpha01` is released. The commits included in this version can be found [here](https://android.googlesource.com/platform/frameworks/support/+log/3478ef7cbc6b27d8c1497d76c3ffff688771380e..21e165dc2f0fe0acc7ced317d75f4e92155a8e35/dynamic-animation).\n\nDynamicanimation-Ktx Version 1.0.0\n----------------------------------\n\n### Version 1.0.0-beta01\n\nMarch 12, 2025\n\n`androidx.dynamicanimation:dynamicanimation-ktx:1.0.0-beta01` is released. Version 1.0.0-beta01 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/ce2902e01f920f17637879b6c918ffe987d2f35b..8870a8ee99ec618927a9edb4b6e74b8570381149/dynamicanimation/dynamicanimation-ktx).\n\n### DynamicAnimation-Ktx Version 1.0.0-alpha03\n\nDecember 4, 2019\n\n`androidx.dynamicanimation:dynamicanimation-ktx:1.0.0-alpha03` is released with no notable public changes since `1.0.0-alpha02`. [Version 1.0.0-alpha03 contains these commits](https://android.googlesource.com/platform/frameworks/support/+log/21e165dc2f0fe0acc7ced317d75f4e92155a8e35..ce2902e01f920f17637879b6c918ffe987d2f35b/dynamic-animation/ktx).\n\n### DynamicAnimation-Ktx Version 1.0.0-alpha02\n\nApril 3, 2019\n\n`androidx.dynamicanimation:dynamicanimation-ktx:1.0.0-alpha02` is released. The commits included in this version can be found [here](https://android.googlesource.com/platform/frameworks/support/+log/5d65a6a77b8fd846a20fa35c246f377fdfda0e3b..21e165dc2f0fe0acc7ced317d75f4e92155a8e35/dynamic-animation/ktx).\n\n**API changes**\n\n- Changed `springAnimationOf`and `flingAnimationOf` to take in a setter and a getter instead of a target and a `FloatPropertyCompat` to instantiate a `SpringAnimation` and a `FlingAnimation` respectively.\n\n### Dynamicanimation-Ktx Version 1.0.0-alpha01\n\nFebruary 7, 2019\n\n`androidx.dynamicanimation:dynamicanimation-ktx:1.0.0-alpha01` is released. This is the first release of dynamic-animation-ktx.\n\n**New features**\n\n- New Kotlin API for creating `SpringAnimations` and `FlingAnimations`"]]