> This animation is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
> This animation is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
| Name | Description |
| Name | Description |
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
## AnimationOptions
## AnimationOptions
- Attributes
- Attributes
| Name | Type | Default Value | Description |
| Name | Type | Default Value | Description |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| duration | number | 1000 | Animation duration, in ms. |
| duration | number | 1000 | Animation duration, in ms. |
| tempo | number | 1.0 | Animation playback speed. A larger value indicates faster animation playback, and a smaller value indicates slower animation playback. The value **0** means that there is no animation. |
| tempo | number | 1.0 | Animation playback speed. A larger value indicates faster animation playback, and a smaller value indicates slower animation playback. The value **0** means that there is no animation. |
> This method is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
> This method is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
...
@@ -16,7 +16,7 @@ None
...
@@ -16,7 +16,7 @@ None
Use the following attributes to bind gesture recognition to a component. When a gesture is recognized, the event callback is invoked to notify the component.
Use the following attributes to bind gesture recognition to a component. When a gesture is recognized, the event callback is invoked to notify the component.
| Name | Type | Default Value | Description |
| Name | Type | Default Value | Description |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| gesture | gesture: GestureType,<br/>mask?: GestureMask | gesture: -,<br/>mask: GestureMask.Normal | Gesture to recognize.<br/>**gesture** specifies the type of the gesture to bind, and **mask** specifies the event response setting. |
| gesture | gesture: GestureType,<br/>mask?: GestureMask | gesture: -,<br/>mask: GestureMask.Normal | Gesture to recognize.<br/>**gesture** specifies the type of the gesture to bind, and **mask** specifies the event response setting. |
| priorityGesture | gesture: GestureType,<br/>mask?: GestureMask | gesture: -,<br/>mask: GestureMask.Normal | Gesture to preferentially recognize.<br/>**gesture** specifies the type of the gesture to bind, and **mask** specifies the event response setting.<br/>> ![icon-note.gif](public_sys-resources/icon-note.gif)**NOTE**<br/>> - By default, the child component takes precedence over the parent component in gesture recognition. When **priorityGesture** is configured for the parent component, the parent component takes precedence over the child component in gesture recognition. |
| priorityGesture | gesture: GestureType,<br/>mask?: GestureMask | gesture: -,<br/>mask: GestureMask.Normal | Gesture to preferentially recognize.<br/>**gesture** specifies the type of the gesture to bind, and **mask** specifies the event response setting.<br/>> ![icon-note.gif](public_sys-resources/icon-note.gif)**NOTE**<br/>> - By default, the child component takes precedence over the parent component in gesture recognition. When **priorityGesture** is configured for the parent component, the parent component takes precedence over the child component in gesture recognition. |
...
@@ -24,14 +24,14 @@ Use the following attributes to bind gesture recognition to a component. When a
...
@@ -24,14 +24,14 @@ Use the following attributes to bind gesture recognition to a component. When a
- GestureMask enums
- GestureMask enums
| Name | Description |
| Name | Description |
| -------- | -------- |
| -------- | -------- |
| Normal | The gestures of child components are not masked and are recognized based on the default gesture recognition sequence. |
| Normal | The gestures of child components are not masked and are recognized based on the default gesture recognition sequence. |
| IgnoreInternal | The gestures of child components are masked. Only the gestures of the current component are recognized.<br/>> ![icon-note.gif](public_sys-resources/icon-note.gif)**NOTE**<br/>> However, the built-in gestures of the child components are not masked. For example, when the child component is a **<List>** component, the built-in sliding gestures can still be triggered. |
| IgnoreInternal | The gestures of child components are masked. Only the gestures of the current component are recognized.<br/>> ![icon-note.gif](public_sys-resources/icon-note.gif)**NOTE**<br/>> However, the built-in gestures of the child components are not masked. For example, when the child component is a **<List>** component, the built-in sliding gestures can still be triggered. |
- Gesture types
- Gesture types
| Name | Description |
| Name | Description |
| -------- | -------- |
| -------- | -------- |
| TapGesture | Tap gesture, which can be a single-tap or multi-tap gesture. |
| TapGesture | Tap gesture, which can be a single-tap or multi-tap gesture. |
| LongPressGesture | Long press gesture. |
| LongPressGesture | Long press gesture. |
...
@@ -46,12 +46,12 @@ Use the following attributes to bind gesture recognition to a component. When a
...
@@ -46,12 +46,12 @@ Use the following attributes to bind gesture recognition to a component. When a
The component uses the **gesture** method to bind the gesture object and uses the events provided in this object to respond to the gesture operation. For example, the **onAction** event of the **TapGesture** object can be used to respond to a click event. For details about the event definition, see the section of each gesture object.
The component uses the **gesture** method to bind the gesture object and uses the events provided in this object to respond to the gesture operation. For example, the **onAction** event of the **TapGesture** object can be used to respond to a click event. For details about the event definition, see the section of each gesture object.
- TapGesture events
- TapGesture events
| Name | Description |
| Name | Description |
| -------- | -------- |
| -------- | -------- |
| onAction((event?: GestureEvent) => void) | Callback invoked when a tap gesture is recognized. |
| onAction((event?: GestureEvent) => void) | Callback invoked when a tap gesture is recognized. |
- GestureEvent attributes
- GestureEvent attributes
| Name | Type | Description |
| Name | Type | Description |
| -------- | -------- | -------- |
| -------- | -------- | -------- |
| timestamp | number | Timestamp of the event. |
| timestamp | number | Timestamp of the event. |
| target<sup>8+</sup> | EventTarget | Object that triggers the gesture event. |
| target<sup>8+</sup> | EventTarget | Object that triggers the gesture event. |
...
@@ -60,7 +60,7 @@ The component uses the **gesture** method to bind the gesture object and uses th
...
@@ -60,7 +60,7 @@ The component uses the **gesture** method to bind the gesture object and uses th
| count | number | Yes | - | Number of steps. Must be a positive integer. |
| count | number | Yes | - | Number of steps. Must be a positive integer. |
| end | boolean | Yes | true | Step change at the start or end point of each interval. Defaults to **true**, indicating that the step change occurs at the end point. |
| end | boolean | Yes | true | Step change at the start or end point of each interval. Defaults to **true**, indicating that the step change occurs at the end point. |
...
@@ -54,53 +44,45 @@ Constructs a step curve object.
...
@@ -54,53 +44,45 @@ Constructs a step curve object.
letcurve1=Curves.init()// Create a default linear interpolation curve.
letcurve1=Curves.init()// Create a default linear interpolation curve.
letcurve2=Curves.init(Curve.EaseIn)// Create an interpolation curve which is slow and then fast by default.
letcurve2=Curves.init(Curve.EaseIn)// Create an interpolation curve which is slow and then fast by default.
...
@@ -108,26 +90,22 @@ let curve3 = Curves.spring(100, 1, 228, 30) // Create a spring interpolation cur
...
@@ -108,26 +90,22 @@ let curve3 = Curves.spring(100, 1, 228, 30) // Create a spring interpolation cur
letcurve3=Curves.cubicBezier(0.1,0.0,0.1,1.0)// Create a third-order Bezier curve.
letcurve3=Curves.cubicBezier(0.1,0.0,0.1,1.0)// Create a third-order Bezier curve.
```
```
Curve objects can be created only by the preceding APIs.
Curve objects can be created only by the preceding APIs.
| API | Description |
| API | Description |
| -------- | -------- |
| -------- | -------- |
| interpolate(time: number): number | Calculation function of the interpolation curve. Passing a normalized time parameter to this function returns the current interpolation.<br/>**time**: indicates the current normalized time. The value ranges from 0 to 1.<br/>The curve interpolation corresponding to the normalized time point is returned. |
| interpolate(time: number): number | Calculation function of the interpolation curve. Passing a normalized time parameter to this function returns the current interpolation.<br/>**time**: indicates the current normalized time. The value ranges from 0 to 1.<br/>The curve interpolation corresponding to the normalized time point is returned. |
- Example
- Example
```
```ts
importCurvesfrom'@ohos.curves'
importCurvesfrom'@ohos.curves'
letcurve=Curves.init(Curve.EaseIn)// Create an interpolation curve which is slow and then fast by default.
letcurve=Curves.init(Curve.EaseIn)// Create an interpolation curve which is slow and then fast by default.
letvalue:number=curve.interpolate(0.5)// Calculate the interpolation for half of the time.
letvalue:number=curve.interpolate(0.5)// Calculate the interpolation for half of the time.
@@ -9,7 +9,7 @@ The **\<Video>** component provides a video player.
...
@@ -9,7 +9,7 @@ The **\<Video>** component provides a video player.
To use online videos, you need to add the **ohos.permission.INTERNET** permission to the corresponding **abilities** in the **config.json** or **module.json** file, whichever is appropriate.
To use online videos, you need to add the **ohos.permission.INTERNET** permission to the corresponding **abilities** in the **config.json** or **module.json** file, whichever is appropriate.
```
```json
"abilities":[
"abilities":[
{
{
...
...
...
@@ -19,17 +19,15 @@ To use online videos, you need to add the **ohos.permission.INTERNET** permissio
...
@@ -19,17 +19,15 @@ To use online videos, you need to add the **ohos.permission.INTERNET** permissio
| src | string \|[Resource](../../ui/ts-types.md) | No| - | Path of the video source, which can be a local path or a URL.<br>The video resources can be stored in the **video** or **rawfile** folder under **resources**.<br>The path can include a **dataability://** prefix, which is used to access the video path provided by a Data ability. For details about the path, see [Data Ability Development](../../ability/fa-dataability.md).|
| src | string \|[Resource](../../ui/ts-types.md) | No| - | Path of the video source, which can be a local path or a URL.<br>The video resources can be stored in the **video** or **rawfile** folder under **resources**.<br>The path can include a **dataability://** prefix, which is used to access the video path provided by a Data ability. For details about the path, see [Data Ability Development](../../ability/fa-dataability.md).|