diff --git a/en/application-dev/reference/arkui-ts/figures/animation.PNG b/en/application-dev/reference/arkui-ts/figures/animation.PNG new file mode 100644 index 0000000000000000000000000000000000000000..92f92e0001a90840d03ebd00e0b0ef736c2a94c8 Binary files /dev/null and b/en/application-dev/reference/arkui-ts/figures/animation.PNG differ diff --git a/en/application-dev/reference/arkui-ts/figures/animation.gif b/en/application-dev/reference/arkui-ts/figures/animation.gif new file mode 100644 index 0000000000000000000000000000000000000000..6cfbc07fc5122be3ecd69e6b33b6f00c0f676a0f Binary files /dev/null and b/en/application-dev/reference/arkui-ts/figures/animation.gif differ diff --git a/en/application-dev/reference/arkui-ts/figures/animation1.PNG b/en/application-dev/reference/arkui-ts/figures/animation1.PNG new file mode 100644 index 0000000000000000000000000000000000000000..98cc1fa8c0537071549fa8185fa14f7ad103e7f8 Binary files /dev/null and b/en/application-dev/reference/arkui-ts/figures/animation1.PNG differ diff --git a/en/application-dev/reference/arkui-ts/figures/button.gif b/en/application-dev/reference/arkui-ts/figures/button.gif new file mode 100644 index 0000000000000000000000000000000000000000..04ab6ed97635118a7ffd3fb9d6be666f2ac40691 Binary files /dev/null and b/en/application-dev/reference/arkui-ts/figures/button.gif differ diff --git a/en/application-dev/reference/arkui-ts/figures/clipAndMask.PNG b/en/application-dev/reference/arkui-ts/figures/clipAndMask.PNG new file mode 100644 index 0000000000000000000000000000000000000000..6f522bf5a01241f67ad8c493a04f3d9d71aa9be5 Binary files /dev/null and b/en/application-dev/reference/arkui-ts/figures/clipAndMask.PNG differ diff --git a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001211898494.gif b/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001211898494.gif deleted file mode 100644 index 3c81f8cfffb0c4d064335c9ebc0e8c918d10035a..0000000000000000000000000000000000000000 Binary files a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001211898494.gif and /dev/null differ diff --git a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001212218452.png b/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001212218452.png deleted file mode 100644 index 2243912034c109d0ffa57837aa28f4fab4ed55d7..0000000000000000000000000000000000000000 Binary files a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001212218452.png and /dev/null differ diff --git a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001212378394.png b/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001212378394.png deleted file mode 100644 index 884eb29ed12c00641fec55f358a41f15f581c335..0000000000000000000000000000000000000000 Binary files a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001212378394.png and /dev/null differ diff --git a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001212378444.gif b/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001212378444.gif deleted file mode 100644 index 69cc497191325216c394de0ce00328a7c5c5fc8c..0000000000000000000000000000000000000000 Binary files a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001212378444.gif and /dev/null differ diff --git a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001256978345.gif b/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001256978345.gif deleted file mode 100644 index 864e3a39a57b7a45f63a07fe50545629db3527c4..0000000000000000000000000000000000000000 Binary files a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001256978345.gif and /dev/null differ diff --git a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001257138341.gif b/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001257138341.gif deleted file mode 100644 index bb1dd72311c866d5bf31a706d75fc1e107a5a946..0000000000000000000000000000000000000000 Binary files a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001257138341.gif and /dev/null differ diff --git a/en/application-dev/reference/arkui-ts/figures/flex.PNG b/en/application-dev/reference/arkui-ts/figures/flex.PNG new file mode 100644 index 0000000000000000000000000000000000000000..9975e8261fd548d2b11607ed3603410dd4a1577e Binary files /dev/null and b/en/application-dev/reference/arkui-ts/figures/flex.PNG differ diff --git a/en/application-dev/reference/arkui-ts/figures/shared.gif b/en/application-dev/reference/arkui-ts/figures/shared.gif new file mode 100644 index 0000000000000000000000000000000000000000..d43a6a38d9516945efc3ed80f4f1592c94645952 Binary files /dev/null and b/en/application-dev/reference/arkui-ts/figures/shared.gif differ diff --git a/en/application-dev/reference/arkui-ts/ts-animatorproperty.md b/en/application-dev/reference/arkui-ts/ts-animatorproperty.md index b390dc8ead870e17ad37c02632295e1f2e414bfc..36d37c6d5fe1e091128d60ee0ff9f337bd13c818 100644 --- a/en/application-dev/reference/arkui-ts/ts-animatorproperty.md +++ b/en/application-dev/reference/arkui-ts/ts-animatorproperty.md @@ -1,23 +1,21 @@ # Property Animator -You can create a property animator to animate certain universal attributes of a component, including **width**, **height**, backgroundColor, **opacity**, **scale**, **rotate**, and **translate**. +You can create a property animator to animate certain universal attributes of a component, including **width**, **height**, **backgroundColor**, **opacity**, **scale**, **rotate**, and **translate**. > **NOTE** > > This event is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. -animation(value: {duration?: number, tempo?: number, curve?: string | Curve | ICurve, delay?:number, iterations: number, playMode?: PlayMode, onFinish?: () => void}) -Applies a property animator to the component to animate its attributes over time. +animation(value: {duration?: number, tempo?: number, curve?: string | Curve | ICurve, delay?:number, iterations: number, playMode?: PlayMode, onFinish?: () => void}) **Parameters** - | Name | Type | Mandatory | Description | | ---------- | ------------------------------------------| ---- | ------------------------------------------------------------ | | duration | number | No | Animation duration, in ms.
Default value: **1000**| | tempo | number | No | Animation playback speed. A greater value indicates a higher animation playback speed.
The value **0** indicates that no animation is applied.
Default value: **1**| -| curve | string \| [Curve](ts-appendix-enums.md#curve) \| ICurve9+ | No | Animation curve.
Default value: **Curve.Linear** | +| curve | string \| [Curve](ts-appendix-enums.md#curve) \| ICurve9+ | No | Animation curve.
Default value: **Curve.Linear** | | delay | number | No | Delay of animation playback, in ms. The value **0** indicates that the playback is not delayed.
Default value: **0** | | iterations | number | No | Number of times that the animation is played. The value **-1** indicates that the animation is played for an unlimited number of times.
Default value: **1**| | playMode | [PlayMode](ts-appendix-enums.md#playmode) | No | Animation playback mode. By default, the animation is played from the beginning after the playback is complete.
Default value: **PlayMode.Normal**| @@ -31,34 +29,49 @@ Applies a property animator to the component to animate its attributes over time @Entry @Component struct AttrAnimationExample { - @State widthSize: number = 200; - @State heightSize: number = 100; - @State flag: boolean = true; + @State widthSize: number = 250 + @State heightSize: number = 100 + @State rotateAngle: number = 0 + @State flag: boolean = true build() { Column() { - Button('click me') - .onClick((event: ClickEvent) => { + Button('change width and height') + .onClick(() => { if (this.flag) { this.widthSize = 100 this.heightSize = 50 } else { - this.widthSize = 200 + this.widthSize = 250 this.heightSize = 100 } this.flag = !this.flag }) - .width(this.widthSize).height(this.heightSize).backgroundColor(0x317aff) + .margin(30) + .width(this.widthSize) + .height(this.heightSize) .animation({ - duration: 2000, // Animation duration - curve: Curve.EaseOut, // Animation curve - delay: 500, // Animation delay - iterations: 1, // Number of playback times - playMode: PlayMode.Normal // Animation playback mode - }) // Animation configuration for the width and height attributes of the