@@ -15,7 +15,7 @@ You can develop applications or services in the low-code approach using either o
...
@@ -15,7 +15,7 @@ You can develop applications or services in the low-code approach using either o
- Create a project that supports low-code development. This method is used as an example in this topic.
- Create a project that supports low-code development. This method is used as an example in this topic.
- In an existing project, create a .visual file for development.
- In an existing project, create a .visual file for development. For details, see [Creating a .visual File That Supports Low-Code Development](#building-the-second-page).
## Creating a Project That Supports Low-Code Development
## Creating a Project That Supports Low-Code Development
...
@@ -52,7 +52,7 @@ Add **Column**, **Text**, and **Button** components to the first page. A column
...
@@ -52,7 +52,7 @@ Add **Column**, **Text**, and **Button** components to the first page. A column
Open the **index.visual** file, right-click the existing template components on the canvas, and choose **Delete** from the shortcut menu to delete them. Below is an illustration of the operations.
Open the **index.visual** file, right-click the existing template components on the canvas, and choose **Delete** from the shortcut menu to delete them. Below is an illustration of the operations.
2. Add a **Column** component and set its styles and attributes.<aname="add_container"></a>
2. Add a **Column** component and set its styles and attributes.<aname="add_container"></a>
...
@@ -70,7 +70,7 @@ Add **Column**, **Text**, and **Button** components to the first page. A column
...
@@ -70,7 +70,7 @@ Add **Column**, **Text**, and **Button** components to the first page. A column
Drag the **Button** component from the **UI Control** area to the canvas and then to a position under the **Text** component. In the **Attributes & Styles** area on the right, click **General** and set **Height** of the **Button** component to **40vp**. Click **Feature** and set **Label** to **Next** and **FontSize** to **25fp**. Below is an illustration of the operations.
Drag the **Button** component from the **UI Control** area to the canvas and then to a position under the **Text** component. In the **Attributes & Styles** area on the right, click **General** and set **Height** of the **Button** component to **40vp**. Click **Feature** and set **Label** to **Next** and **FontSize** to **25fp**. Below is an illustration of the operations.
5. On the toolbar in the upper right corner of the editing window, click **Previewer** to open the Previewer.
5. On the toolbar in the upper right corner of the editing window, click **Previewer** to open the Previewer.
...
@@ -85,7 +85,7 @@ Add **Column**, **Text**, and **Button** components to the first page. A column
...
@@ -85,7 +85,7 @@ Add **Column**, **Text**, and **Button** components to the first page. A column
In the **Project** window, choose **entry**>**src**>**main**>**ets**>**MainAbility**, right-click the **pages** folder, choose **New**>**Visual**, name the page **second**, and click **Finish**. Below, you can see the structure of the **pages** folder.
In the **Project** window, choose **entry**>**src**>**main**>**ets**>**MainAbility**, right-click the **pages** folder, choose **New**>**Visual**, name the page **second**, and click **Finish**. Below, you can see the structure of the **pages** folder.
@@ -13,7 +13,7 @@ You can develop applications or services in the low-code approach using either o
...
@@ -13,7 +13,7 @@ You can develop applications or services in the low-code approach using either o
- Create a project that supports low-code development. This method is used as an example in this topic.
- Create a project that supports low-code development. This method is used as an example in this topic.
- In an existing project, create a Visual file for development.
- In an existing project, create a Visual file for development. For details, see [Creating a .visual File That Supports Low-Code Development](#building-the-second-page).
## Creating a Project That Supports Low-Code Development
## Creating a Project That Supports Low-Code Development
...
@@ -53,15 +53,15 @@ Add **Div**, **Text**, and **Button** components to the first page.
...
@@ -53,15 +53,15 @@ Add **Div**, **Text**, and **Button** components to the first page.
1. Delete the existing template components from the canvas.<aname= delete_origin_content></a>
1. Delete the existing template components from the canvas.<aname= delete_origin_content></a>
Open the index.visual file, right-click the existing template components on the canvas, and choose **Delete** from the shortcut menu to delete them. Below is an illustration of the operations.
Open the index.visual file, right-click the existing template components on the canvas, and choose **Delete** from the shortcut menu to delete them. Below is an illustration of the operations.
2. Add a **Div** component and set its styles and attributes.<aname = add_container></a>
2. Add a **Div** component and set its styles and attributes.<aname = add_container></a>
Drag the **Div** component from the **UI Control** area to the canvas. In the **Attributes & Styles** area on the right, click **General** and set **Height** to **100%** so that the component fills the entire screen. Click **Flex**, set **FlexDirection** to **column** so that the main axis of the component is vertical, and set both **JustifyContent** and **AlignItems** to **center** so that the child components of the **Div** component are centered along the main axis and cross axis. Below is an illustration of the operations.
Drag the **Div** component from the **UI Control** area to the canvas. In the **Attributes & Styles** area on the right, click **General** and set **Height** to **100%** so that the component fills the entire screen. Click **Flex**, set **FlexDirection** to **column** so that the main axis of the component is vertical, and set both **JustifyContent** and **AlignItems** to **center** so that the child components of the **Div** component are centered along the main axis and cross axis. Below is an illustration of the operations.
@@ -88,7 +88,7 @@ Open the index.visual file, right-click the existing template components on the
...
@@ -88,7 +88,7 @@ Open the index.visual file, right-click the existing template components on the
In the **Project** window, choose **entry**>**src**>**main**>**js**>**MainAbility**, right-click the **pages** folder, choose **New**>**Visual**, name the page **second**, and click **Finish**. Below, you can see the structure of the **pages** folder.
In the **Project** window, choose **entry**>**src**>**main**>**js**>**MainAbility**, right-click the **pages** folder, choose **New**>**Visual**, name the page **second**, and click **Finish**. Below, you can see the structure of the **pages** folder.
>  **NOTE**<br>The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
This module is used to set and obtain the current system date, time, and time zone.
>
> **NOTE**<br>The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
## Modules to Import
...
@@ -189,7 +189,7 @@ Obtains the time elapsed since system start, excluding the deep sleep time. This
...
@@ -189,7 +189,7 @@ Obtains the time elapsed since system start, excluding the deep sleep time. This
**Example**
**Example**
```js
```js
systemTime.getCurrentTime().then((data)=>{
systemTime.getRealActiveTime().then((data)=>{
console.log(`systemTime.getRealActiveTime success data : `+JSON.stringify(data));
console.log(`systemTime.getRealActiveTime success data : `+JSON.stringify(data));
}).catch((error)=>{
}).catch((error)=>{
console.error(`failed to systemTime.getRealActiveTime because `+JSON.stringify(error));
console.error(`failed to systemTime.getRealActiveTime because `+JSON.stringify(error));
> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
The **<ImageAnimator>** component enables images to be played frame by frame. The list of images to be played can be configured, and the duration of each image can be configured.
The **\<ImageAnimator>** component enables images to be played frame by frame. The list of images to be played can be configured, and the duration of each image can be configured.
## Required Permissions
## Required Permissions
...
@@ -15,7 +15,7 @@ None
...
@@ -15,7 +15,7 @@ None
## Child Components
## Child Components
None
Not supported
## APIs
## APIs
...
@@ -37,29 +37,29 @@ ImageAnimator()
...
@@ -37,29 +37,29 @@ ImageAnimator()
| iterations | number | 1 | No | By default, the animation is played once. The value **-1** indicates that the animation is played for an unlimited number of times. |
| iterations | number | 1 | No | By default, the animation is played once. The value **-1** indicates that the animation is played for an unlimited number of times. |
- AnimationStatus enums
- AnimationStatus enums
| Name | Description |
| Name | Description |
| -------- | -------- |
| -------- | -------- |
| Initial | The animation is in the initial state. |
| Initial | The animation is in the initial state. |
| Running | The animation is being played. |
| Running | The animation is being played. |
| Paused | The animation is paused. |
| Paused | The animation is paused. |
| Stopped | The animation is stopped. |
| Stopped | The animation is stopped. |
- FillMode enums
- FillMode enums
| Name | Description |
| Name | Description |
| -------- | -------- |
| -------- | -------- |
| None | After the playback is complete, the animation restores to the initial state. |
| None | After the playback is complete, the animation restores to the initial state. |
| Forwards | After the playback is complete, the animation remains in the end state. |
| Forwards | After the playback is complete, the animation remains in the end state. |
## Events
## Events
| Name | Description |
| Name | Description |
| -------- | -------- | -------- |
| -------- | -------- | -------- |
| onStart() => void | Triggered when the animation starts to play. |
| onStart() => void | Triggered when the animation starts to play. |
| onPause() => void | Triggered when the animation playback is paused. |
| onPause() => void | Triggered when the animation playback is paused. |
| onRepeat() => void | Triggered when the animation playback is repeated. |
| onRepeat() => void | Triggered when the animation playback is repeated. |
| onCancel() => void | Triggered when the animation playback is canceled. |
| onCancel() => void | Triggered when the animation playback is canceled. |
| onFinish() => void | Triggered when the animation playback is complete. |
| onFinish() => void | Triggered when the animation playback is complete. |
## Example
## Example
...
@@ -78,6 +78,7 @@ struct ImageAnimatorExample {
...
@@ -78,6 +78,7 @@ struct ImageAnimatorExample {
ImageAnimator()
ImageAnimator()
.images([
.images([
{
{
// The comment folder is at the same level as the pages folder.
| loop | number | No| -1 | Number of times the marquee will scroll. If the value is less than or equal to **0**, the marquee will scroll continuously.|
| loop | number | No| -1 | Number of times the marquee will scroll. If the value is less than or equal to **0**, the marquee will scroll continuously.|
| fromStart | boolean | No| true | Whether the text scrolls from the start.|
| fromStart | boolean | No| true | Whether the text scrolls from the start.|
| src | string | Yes| - | Text to scroll.|
| src | string | Yes| - | Text to scroll.|
## Events
## Events
| Name| Description|
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| onStart(callback: () => void) | Triggered when the marquee starts scrolling.|
| onStart(callback: () => void) | Triggered when the marquee starts scrolling.|
| onBounce(callback: () => void) | Triggered when the marquee has reached the end.|
| onBounce(callback: () => void) | Triggered when the marquee has reached the end.|
| onFinish(callback: () => void) | Triggered when the marquee has finished scrolling.|
| onFinish(callback: () => void) | Triggered when the marquee has finished scrolling.|