未验证 提交 0838f38d 编写于 作者: O openharmony_ci 提交者: Gitee

!2986 修改敏感词

Merge pull request !2986 from LiAn/master
......@@ -220,6 +220,10 @@
- Distributed Call Chain Tracing
- [Overview of Distributed Call Chain Tracing](dfx/hitracechain-overview.md)
- [Development of Distributed Call Chain Tracing](dfx/hitracechain-guidelines.md)
- Internationalization
- [Overview](internationalization/international-overview.md)
- [Internationalization Development (intl)](internationalization/intl-guidelines.md)
- [Internationalization Development (i18n)](internationalization/i18n-guidelines.md)
- Tools
- [DevEco Studio (OpenHarmony) User Guide](quick-start/deveco-studio-user-guide-for-openharmony.md)
- Hands-On Tutorials
......
......@@ -22,15 +22,15 @@ The default duration of delayed suspension is 180000 when the battery level is h
**System capability**: SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| reason | string | Yes| Reason for delayed transition to the suspended state.|
| callback | Callback<void> | Yes| Invoked when a delay is about to time out. Generally, this callback is used to notify the application 6 seconds before the delay times out.|
| Name | Type | Mandatory | Description |
| -------- | -------------------- | --------- | ---------------------------------------- |
| reason | string | Yes | Reason for delayed transition to the suspended state. |
| callback | Callback<void> | Yes | Invoked when a delay is about to time out. Generally, this callback is used to notify the application 6 seconds before the delay times out. |
**Return value**
| Type| Description|
| -------- | -------- |
| [DelaySuspendInfo](#delaysuspendinfo) | Information about the suspension delay.|
| Type | Description |
| ------------------------------------- | --------------------------------------- |
| [DelaySuspendInfo](#delaysuspendinfo) | Information about the suspension delay. |
**Example**
```js
......@@ -50,10 +50,10 @@ Obtains the remaining duration before the application is suspended. This API use
**System capability**: SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| requestId | number | Yes| ID of the suspension delay request.|
| callback | AsyncCallback<number> | Yes| Callback used to return the remaining duration before the application is suspended, in milliseconds.|
| Name | Type | Mandatory | Description |
| --------- | --------------------------- | --------- | ---------------------------------------- |
| requestId | number | Yes | ID of the suspension delay request. |
| callback | AsyncCallback<number> | Yes | Callback used to return the remaining duration before the application is suspended, in milliseconds. |
**Example**
......@@ -78,14 +78,14 @@ Obtains the remaining duration before the application is suspended. This API use
**System capability**: SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| requestId | number | Yes| ID of the suspension delay request.|
| Name | Type | Mandatory | Description |
| --------- | ------ | --------- | ----------------------------------- |
| requestId | number | Yes | ID of the suspension delay request. |
**Return value**
| Type| Description|
| -------- | -------- |
| Promise<number> | Promise used to return the remaining duration before the application is suspended, in milliseconds.|
| Type | Description |
| --------------------- | ---------------------------------------- |
| Promise<number> | Promise used to return the remaining duration before the application is suspended, in milliseconds. |
**Example**
```js
......@@ -107,9 +107,9 @@ Cancels the suspension delay.
**System capability**: SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| requestId | number | Yes| ID of the suspension delay request.|
| Name | Type | Mandatory | Description |
| --------- | ------ | --------- | ----------------------------------- |
| requestId | number | Yes | ID of the suspension delay request. |
**Example**
```js
......@@ -128,12 +128,12 @@ Requests a continuous task from the system. This API uses an asynchronous callba
**System capability**: SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| context | [Context](js-apis-Context.md) | Yes| Application context.|
| bgMode | [BackgroundMode](#backgroundmode8) | Yes| Background mode requested.|
| wantAgent | [WantAgent](js-apis-wantAgent.md) | Yes| Notification parameter, which is used to specify the target page that is redirected to when a continuous task notification is clicked.|
| callback | AsyncCallback<void> | Yes| Callback used to return the result.|
| Name | Type | Mandatory | Description |
| --------- | ---------------------------------- | --------- | ---------------------------------------- |
| context | [Context](js-apis-Context.md) | Yes | Application context. |
| bgMode | [BackgroundMode](#backgroundmode8) | Yes | Background mode requested. |
| wantAgent | [WantAgent](js-apis-wantAgent.md) | Yes | Notification parameter, which is used to specify the target page that is redirected to when a continuous task notification is clicked. |
| callback | AsyncCallback<void> | Yes | Callback used to return the result. |
**Example**
```js
......@@ -180,16 +180,16 @@ Requests a continuous task from the system. This API uses a promise to return th
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| context | [Context](js-apis-Context.md) | Yes| Application context.|
| bgMode | [BackgroundMode](#backgroundmode8) | Yes| Background mode requested.|
| wantAgent | [WantAgent](js-apis-wantAgent.md) | Yes| Notification parameter, which is used to specify the target page when a continuous task notification is clicked.|
| Name | Type | Mandatory | Description |
| --------- | ---------------------------------- | --------- | ---------------------------------------- |
| context | [Context](js-apis-Context.md) | Yes | Application context. |
| bgMode | [BackgroundMode](#backgroundmode8) | Yes | Background mode requested. |
| wantAgent | [WantAgent](js-apis-wantAgent.md) | Yes | Notification parameter, which is used to specify the target page when a continuous task notification is clicked. |
**Return value**
| Type | Description |
| -------------- | ------------------------- |
| Promise\<void> | Promise used to return the result.|
| Type | Description |
| -------------- | ---------------------------------- |
| Promise\<void> | Promise used to return the result. |
**Example**
```js
......@@ -229,10 +229,10 @@ Requests to cancel a continuous task. This API uses an asynchronous callback to
**System capability**: SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| context | [Context](js-apis-Context.md) | Yes| Application context.|
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
| Name | Type | Mandatory | Description |
| -------- | ----------------------------- | --------- | ----------------------------------- |
| context | [Context](js-apis-Context.md) | Yes | Application context. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Example**
```js
......@@ -260,14 +260,14 @@ Requests to cancel a continuous task. This API uses a promise to return the resu
**System capability**: SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| context | [Context](js-apis-Context.md) | Yes| Application context.|
| Name | Type | Mandatory | Description |
| ------- | ----------------------------- | --------- | -------------------- |
| context | [Context](js-apis-Context.md) | Yes | Application context. |
**Return value**
| Type | Description |
| -------------- | ------------------------- |
| Promise\<void> | Promise used to return the result.|
| Type | Description |
| -------------- | ---------------------------------- |
| Promise\<void> | Promise used to return the result. |
**Example**
```js
......@@ -288,24 +288,24 @@ Provides the information about the suspension delay.
**System capability**: SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| requestId | number | Yes| ID of the suspension delay request.|
| actualDelayTime | number | Yes| Actual suspension delay duration of the application, in milliseconds.<br>The default duration is 180000 when the battery level is higher than or equal to the broadcast low battery level and 60000 when the battery level is lower than the broadcast low battery level.|
| Name | Type | Mandatory | Description |
| --------------- | ------ | --------- | ---------------------------------------- |
| requestId | number | Yes | ID of the suspension delay request. |
| actualDelayTime | number | Yes | Actual suspension delay duration of the application, in milliseconds.<br>The default duration is 180000 when the battery level is higher than or equal to the broadcast low battery level and 60000 when the battery level is lower than the broadcast low battery level. |
## BackgroundMode<sup>8+</sup>
**System capability**: SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
| Name | Value| Description|
| ----------------------- | -------- | -------- |
| DATA_TRANSFER | 1 | Data transfer.|
| AUDIO_PLAYBACK | 2 | Audio playback.|
| AUDIO_RECORDING | 3 | Audio recording.|
| LOCATION | 4 | Positioning and navigation.|
| BLUETOOTH_INTERACTION | 5 | Bluetooth-related task.|
| MULTI_DEVICE_CONNECTION | 6 | Multi-device connection.|
| WIFI_INTERACTION | 7 | WLAN-related (reserved).|
| VOIP | 8 | Voice and video call (reserved).|
| TASK_KEEPING | 9 | Computing task (for PC only).|
| Name | Value | Description |
| ----------------------- | ----- | -------------------------------- |
| DATA_TRANSFER | 1 | Data transfer. |
| AUDIO_PLAYBACK | 2 | Audio playback. |
| AUDIO_RECORDING | 3 | Audio recording. |
| LOCATION | 4 | Positioning and navigation. |
| BLUETOOTH_INTERACTION | 5 | Bluetooth-related task. |
| MULTI_DEVICE_CONNECTION | 6 | Multi-device connection. |
| WIFI_INTERACTION | 7 | WLAN-related (reserved). |
| VOIP | 8 | Voice and video call (reserved). |
| TASK_KEEPING | 9 | Computing task. |
......@@ -17,9 +17,9 @@ import sensor from '@system.sensor';
## Error Codes
| Error Code| Description|
| -------- | -------- |
| 900 | The current device does not support the corresponding sensor.|
| Error Code | Description |
| ---------- | ---------------------------------------- |
| 900 | The current device does not support the corresponding sensor. |
## sensor.subscribeAccelerometer
......@@ -33,19 +33,19 @@ Subscribes to data changes of the acceleration sensor. If this API is called mul
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| interval | string | Yes| Execution frequency of the callback for returning the acceleration sensor data.<br>The default value is **normal**. The options are as follows:<br>- **game**: called at an interval of 20 ms, which is applicable to gaming scenarios.<br>- **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios.<br>- **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios.|
| success | Function | Yes| Called when the acceleration sensor data changes.|
| fail | Function | No| Callback upon failure.|
| Name | Type | Mandatory | Description |
| -------- | -------- | --------- | ---------------------------------------- |
| interval | string | Yes | Execution frequency of the callback for returning the acceleration sensor data.<br>The default value is **normal**. The options are as follows:<br>- **game**: called at an interval of 20 ms, which is applicable to gaming scenarios.<br>- **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios.<br>- **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios. |
| success | Function | Yes | Called when the acceleration sensor data changes. |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name| Type| Description|
| -------- | -------- | -------- |
| x | number | Acceleration on the x-axis.|
| y | number | Acceleration on the y-axis.|
| z | number | Acceleration on the z-axis.|
| Name | Type | Description |
| ---- | ------ | --------------------------- |
| x | number | Acceleration on the x-axis. |
| y | number | Acceleration on the y-axis. |
| z | number | Acceleration on the z-axis. |
**Example**
......@@ -92,16 +92,16 @@ Subscribes to data changes of the compass sensor. If this API is called multiple
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| success | Function | Yes| Called when the compass sensor data changes.|
| fail | Function | No| Callback upon failure.|
| Name | Type | Mandatory | Description |
| ------- | -------- | --------- | ---------------------------------------- |
| success | Function | Yes | Called when the compass sensor data changes. |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name| Type| Description|
| -------- | -------- | -------- |
| direction | number | Direction of the device, in degrees.|
| Name | Type | Description |
| --------- | ------ | ------------------------------------ |
| direction | number | Direction of the device, in degrees. |
**Example**
......@@ -143,16 +143,16 @@ Subscribes to data changes of the proximity sensor. If this API is called multip
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| success | Function | Yes| Called when the proximity sensor data changes.|
| fail | Function | No| Callback upon failure.|
| Name | Type | Mandatory | Description |
| ------- | -------- | --------- | ---------------------------------------- |
| success | Function | Yes | Called when the proximity sensor data changes. |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name| Type| Description|
| -------- | -------- | -------- |
| distance | number | Distance between a visible object and the device screen.|
| Name | Type | Description |
| -------- | ------ | ---------------------------------------- |
| distance | number | Distance between a visible object and the device screen. |
**Example**
......@@ -194,16 +194,16 @@ Subscribes to data changes of the ambient light sensor. If this API is called mu
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| success | Function | Yes| Called when the ambient light sensor data changes|
| fail | Function | No| Callback upon failure.|
| Name | Type | Mandatory | Description |
| ------- | -------- | --------- | ---------------------------------------- |
| success | Function | Yes | Called when the ambient light sensor data changes |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name| Type| Description|
| -------- | -------- | -------- |
| intensity | number | Light intensity, in lux.|
| Name | Type | Description |
| --------- | ------ | ------------------------ |
| intensity | number | Light intensity, in lux. |
**Example**
......@@ -247,15 +247,15 @@ Subscribes to data changes of the step counter sensor. If this API is called mul
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| success | Function | Yes| Called when the step counter sensor data changes.|
| fail | Function | No| Callback upon failure.|
| Name | Type | Mandatory | Description |
| ------- | -------- | --------- | ---------------------------------------- |
| success | Function | Yes | Called when the step counter sensor data changes. |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name| Type| Description|
| -------- | -------- | -------- |
| Name | Type | Description |
| ----- | ------ | ---------------------------------------- |
| steps | number | Number of counted steps after the sensor is restarted.<br> |
**Example**
......@@ -301,16 +301,16 @@ Subscribes to data changes of the barometer sensor. If this API is called multip
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| success | Function | Yes| Called when the barometer sensor data changes.|
| fail | Function | No| Callback upon failure.|
| Name | Type | Mandatory | Description |
| ------- | -------- | --------- | ---------------------------------------- |
| success | Function | Yes | Called when the barometer sensor data changes. |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name| Type| Description|
| -------- | -------- | -------- |
| pressure | number | Pressure, in pascal.|
| Name | Type | Description |
| -------- | ------ | -------------------- |
| pressure | number | Pressure, in pascal. |
**Example**
......@@ -356,16 +356,16 @@ Subscribes to data changes of the heart rate sensor. If this API is called multi
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| success | Function | Yes| Called when the heart rate sensor data changes. This callback is invoked every five seconds.|
| fail | Function | No| Callback upon failure.|
| Name | Type | Mandatory | Description |
| ------- | -------- | --------- | ---------------------------------------- |
| success | Function | Yes | Called when the heart rate sensor data changes. This callback is invoked every five seconds. |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name| Type| Description|
| -------- | -------- | -------- |
| heartRate | number | Heart rate.|
| Name | Type | Description |
| --------- | ------ | ----------- |
| heartRate | number | Heart rate. |
**Example**
......@@ -410,16 +410,16 @@ Subscribes to changes of the wearing state of a wearable device. If this API is
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| success | Function | Yes| Called when the wearing state changes.|
| fail | Function | No| Callback upon failure.|
| Name | Type | Mandatory | Description |
| ------- | -------- | --------- | -------------------------------------- |
| success | Function | Yes | Called when the wearing state changes. |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name| Type| Description|
| -------- | -------- | -------- |
| value | boolean | Whether the wearable device is worn.|
| Name | Type | Description |
| ----- | ------- | ------------------------------------ |
| value | boolean | Whether the wearable device is worn. |
**Example**
......@@ -461,17 +461,17 @@ Obtains the wearing state of a wearable device.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| success | Function | No| Callback upon success.|
| fail | Function | No| Callback upon failure.|
| complete | Function | No| Called when the execution is complete.|
| Name | Type | Mandatory | Description |
| -------- | -------- | --------- | -------------------------------------- |
| success | Function | No | Callback upon success. |
| fail | Function | No | Callback upon failure. |
| complete | Function | No | Called when the execution is complete. |
Return values of the success callback
| Name| Type| Description|
| -------- | -------- | -------- |
| value | boolean | Whether the wearable device is worn.|
| Name | Type | Description |
| ----- | ------- | ------------------------------------ |
| value | boolean | Whether the wearable device is worn. |
**Example**
......@@ -498,18 +498,18 @@ If this API is called multiple times for the same application, the last call tak
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| interval | string | Yes| Interval at which the callback is invoked to return the device orientation sensor data.<br>The default value is **normal**. The options are as follows:<br>- **game**: called at an interval of 20 ms, which is applicable to gaming scenarios.<br>- **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios.<br>- **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios.|
| success | Function | Yes| Called when the device orientation sensor data changes.|
| fail | Function | No| Callback upon failure.|
| Name | Type | Mandatory | Description |
| -------- | -------- | --------- | ---------------------------------------- |
| interval | string | Yes | Interval at which the callback is invoked to return the device orientation sensor data.<br>The default value is **normal**. The options are as follows:<br>- **game**: called at an interval of 20 ms, which is applicable to gaming scenarios.<br>- **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios.<br>- **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios. |
| success | Function | Yes | Called when the device orientation sensor data changes. |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name| Type| Description|
| -------- | -------- | -------- |
| alpha | number | Rotation angle around the Z axis when the X/Y axis of the mobile phone coincides with the X/Y axis of the earth.|
| beta | number | Rotation angle around the X axis when the Y/Z axis of the mobile phone coincides with the Y/Z axis of the earth.|
| gamma | number | Rotation angle around the Y axis when the X/Z axis of the mobile phone coincides with the X/Z axis of the earth.|
| Name | Type | Description |
| ----- | ------ | ---------------------------------------- |
| alpha | number | Rotation angle around the Z axis when the X/Y axis of the mobile device coincides with the X/Y axis of the earth. |
| beta | number | Rotation angle around the X axis when the Y/Z axis of the mobile device coincides with the Y/Z axis of the earth. |
| gamma | number | Rotation angle around the Y axis when the X/Z axis of the mobile device coincides with the X/Z axis of the earth. |
**Example**
......@@ -558,19 +558,19 @@ If this API is called multiple times for the same application, the last call tak
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| interval | string | Yes| Interval at which the callback is invoked to return the gyroscope sensor data.<br>The default value is **normal**. The options are as follows:<br>- **game**: called at an interval of 20 ms, which is applicable to gaming scenarios.<br>- **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios.<br>- **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios.|
| success | Function | Yes| Called when the gyroscope sensor data changes.|
| fail | Function | No| Callback upon failure.|
| Name | Type | Mandatory | Description |
| -------- | -------- | --------- | ---------------------------------------- |
| interval | string | Yes | Interval at which the callback is invoked to return the gyroscope sensor data.<br>The default value is **normal**. The options are as follows:<br>- **game**: called at an interval of 20 ms, which is applicable to gaming scenarios.<br>- **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios.<br>- **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios. |
| success | Function | Yes | Called when the gyroscope sensor data changes. |
| fail | Function | No | Callback upon failure. |
Return values of the success callback
| Name| Type| Description|
| -------- | -------- | -------- |
| x | number | Rotation angular velocity of the X axis.|
| y | number | Rotation angular velocity of the Y axis.|
| z | number | Rotation angular velocity of the Z axis.|
| Name | Type | Description |
| ---- | ------ | ---------------------------------------- |
| x | number | Rotation angular velocity of the X axis. |
| y | number | Rotation angular velocity of the Y axis. |
| z | number | Rotation angular velocity of the Z axis. |
**Example**
......
......@@ -8,7 +8,7 @@ The Update module applies to updates throughout the entire system, including bui
There are two types of updates: SD card update and over the air (OTA) update.
- The SD card update depends on the update packages and SD cards.
- The OTA update depends on the server deployed by the phone manufacturer for managing update packages. The OTA server IP address is passed by the caller. The request interface is fixed and developed by the phone manufacturer.
- The OTA update depends on the server deployed by the device manufacturer for managing update packages. The OTA server IP address is passed by the caller. The request interface is fixed and developed by the device manufacturer.
## Modules to Import
......@@ -31,15 +31,15 @@ Obtains the **Updater** object for local update.
**Parameters**
| Name | Type | Mandatory | Description |
| ----------- | --------------------------- | ---- | ---- |
| upgradeFile | string | Yes | Update file.|
| updateType | [UpdateTypes](#updatetypes) | Yes | Update type.|
| ----------- | --------------------------- | --------- | ------------ |
| upgradeFile | string | Yes | Update file. |
| updateType | [UpdateTypes](#updatetypes) | Yes | Update type. |
**Return value**
| Type | Description |
| ------------------- | ---- |
| [Updater](#updater) | **Updater** object.|
| ------------------- | ------------------- |
| [Updater](#updater) | **Updater** object. |
**Example**
......@@ -62,16 +62,16 @@ Obtains the **Updater** object for the device to be updated.
**Parameters**
| Name | Type | Mandatory | Description |
| ----------- | --------------------------- | ---- | ----- |
| ----------- | --------------------------- | --------- | --------------------- |
| upgradeFile | string | Yes | Update file. |
| device | string | Yes | Device to be updated.|
| device | string | Yes | Device to be updated. |
| updateType | [UpdateTypes](#updatetypes) | Yes | Update type. |
**Return value**
| Type | Description |
| ------------------- | ---- |
| [Updater](#updater) | **Updater** object.|
| ------------------- | ------------------- |
| [Updater](#updater) | **Updater** object. |
**Example**
......@@ -94,16 +94,16 @@ Obtains the **Updater** object from another device for the device to be updated.
**Parameters**
| Name | Type | Mandatory | Description |
| ----------- | --------------------------- | ---- | ----- |
| ----------- | --------------------------- | --------- | --------------------- |
| upgradeFile | string | Yes | Update file. |
| device | string | Yes | Device to be updated.|
| device | string | Yes | Device to be updated. |
| updateType | [UpdateTypes](#updatetypes) | Yes | Update type. |
**Return value**
| Type | Description |
| ------------------- | ---- |
| [Updater](#updater) | **Updater** object.|
| ------------------- | ------------------- |
| [Updater](#updater) | **Updater** object. |
**Example**
......@@ -128,8 +128,8 @@ Obtains the new version information. This function uses an asynchronous callback
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| callback | AsyncCallback<[NewVersionInfo](#newversioninfo)> | No | Callback used to return the new version information.|
| -------- | ---------------------------------------- | --------- | ---------------------------------------- |
| callback | AsyncCallback<[NewVersionInfo](#newversioninfo)> | No | Callback used to return the new version information. |
**Example**
......@@ -153,8 +153,8 @@ Obtains the new version information. This function uses a promise to return the
**Return value**
| Type | Description |
| ---------------------------------------- | ---------------- |
| Promise\<[NewVersionInfo](#newversioninfo)> | Promise used to return the new version information.|
| ---------------------------------------- | ---------------------------------------- |
| Promise\<[NewVersionInfo](#newversioninfo)> | Promise used to return the new version information. |
**Example**
......@@ -179,8 +179,8 @@ Checks whether the current version is the latest. This function uses an asynchro
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| callback | AsyncCallback\<[NewVersionInfo](#newversioninfo)> | No | Callback used to return the new version information.|
| -------- | ---------------------------------------- | --------- | ---------------------------------------- |
| callback | AsyncCallback\<[NewVersionInfo](#newversioninfo)> | No | Callback used to return the new version information. |
**Example**
......@@ -204,8 +204,8 @@ Checks whether the current version is the latest. This function uses a promise t
**Return value**
| Type | Description |
| ---------------------------------------- | ---------------- |
| Promise\<[NewVersionInfo](#newversioninfo)> | Promise used to return the new version information.|
| ---------------------------------------- | ---------------------------------------- |
| Promise\<[NewVersionInfo](#newversioninfo)> | Promise used to return the new version information. |
**Example**
......@@ -230,8 +230,8 @@ Verifies whether the update package is valid.
**Parameters**
| Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | --------- |
| upgradeFile | string | Yes | Path of the update package to be verified.|
| ----------- | ------ | --------- | ---------------------------------------- |
| upgradeFile | string | Yes | Path of the update package to be verified. |
| certsFile | string | Yes | Certificate path. |
**Example**
......@@ -254,8 +254,8 @@ Reboots the device and clears the user partition data. This function uses a prom
**Return value**
| Type | Description |
| ---------------- | ------------------- |
| Promise\<number> | Promise used to return the execution result.|
| ---------------- | ---------------------------------------- |
| Promise\<number> | Promise used to return the execution result. |
**Example**
......@@ -278,8 +278,8 @@ Reboots the device and clears the user partition data. This function uses a prom
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | -------- | ---- | ---------------------- |
| callback | AsyncCallback\<number>| Yes | Callback used to return the execution result.|
| -------- | ---------------------- | --------- | ---------------------------------------- |
| callback | AsyncCallback\<number> | Yes | Callback used to return the execution result. |
**Example**
......@@ -300,8 +300,8 @@ Installs the update package. This function uses a promise to return the result.
**Return value**
| Type | Description |
| ---------------- | ------------------- |
| Promise\<number> | Promise used to return the execution result.|
| ---------------- | ---------------------------------------- |
| Promise\<number> | Promise used to return the execution result. |
**Example**
......@@ -324,8 +324,8 @@ Installs the update package. This function uses a promise to return the result.
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | -------- | ---- | ---------------------- |
| callback | AsyncCallback\<number>| Yes | Callback used to return the execution result.|
| -------- | ---------------------- | --------- | ---------------------------------------- |
| callback | AsyncCallback\<number> | Yes | Callback used to return the execution result. |
**Example**
......@@ -384,9 +384,9 @@ Sets the update policy. This function uses an asynchronous callback to return th
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ----------------------------- | ---- | ------ |
| policy | [UpdatePolicy](#updatepolicy) | Yes | Update policy to set.|
| callback | Callback used to return the execution result. | Yes | Callback used to return the execution result.|
| -------- | ---------------------------------------- | --------- | ---------------------------------------- |
| policy | [UpdatePolicy](#updatepolicy) | Yes | Update policy to set. |
| callback | Callback used to return the execution result. | Yes | Callback used to return the execution result. |
**Example**
......@@ -415,14 +415,14 @@ Sets the update policy. This function uses a promise to return the result.
**Parameters**
| Name | Type | Mandatory | Description |
| ------ | ----------------------------- | ---- | ------ |
| policy | [UpdatePolicy](#updatepolicy) | Yes | Update policy to set.|
| ------ | ----------------------------- | --------- | --------------------- |
| policy | [UpdatePolicy](#updatepolicy) | Yes | Update policy to set. |
**Return value**
| Type | Description |
| ---------------- | --------------- |
| Promise\<number> | Promise used to return the execution result.|
| ---------------- | ---------------------------------------- |
| Promise\<number> | Promise used to return the execution result. |
**Example**
......@@ -452,8 +452,8 @@ Obtains the update policy. This function uses an asynchronous callback to return
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------- |
| callback | AsyncCallback\<[UpdatePolicy](#updatepolicy)> | No | Callback used to return the update policy.|
| -------- | ---------------------------------------- | --------- | ---------------------------------------- |
| callback | AsyncCallback\<[UpdatePolicy](#updatepolicy)> | No | Callback used to return the update policy. |
**Example**
......@@ -477,8 +477,8 @@ Obtains the update policy. This function uses a promise to return the result.
**Return value**
| Type | Description |
| --------------------------------------- | ----------------- |
| Promise\<[UpdatePolicy](#updatepolicy)> | Promise used to return the update policy.|
| --------------------------------------- | ---------------------------------------- |
| Promise\<[UpdatePolicy](#updatepolicy)> | Promise used to return the update policy. |
**Example**
......@@ -499,8 +499,8 @@ Enumerates update types.
**System capability**: SystemCapability.Update.UpdateService
| Name | Description |
| ----- | ----- |
| OTA | OTA update.|
| ----- | ------------- |
| OTA | OTA update. |
| patch | Patch update. |
## PackageTypes
......@@ -510,12 +510,12 @@ Enumerates update package types.
**System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description |
| -------------------- | ---- | ------- |
| -------------------- | ------------- | --------------------------------------- |
| PACKAGE_TYPE_NORMAL | 1 | Common update package. |
| PACKAGE_TYPE_BASE | 2 | Basic update package. |
| PACKAGE_TYPE_CUST | 3 | Custom update package. |
| PACKAGE_TYPE_PRELOAD | 4 | Preinstalled update package. |
| PACKAGE_TYPE_COTA | 5 | Parameter configuration update package.|
| PACKAGE_TYPE_COTA | 5 | Parameter configuration update package. |
| PACKAGE_TYPE_VERSION | 6 | Version update package. |
| PACKAGE_TYPE_PATCH | 7 | Patch package. |
......@@ -526,10 +526,10 @@ Enumerates update modes.
**System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description |
| ------------------- | ---- | ---- |
| INSTALL_MODE_NORMAL | 0 | Normal update.|
| INSTALL_MODE_NIGHT | 1 | Update at night.|
| INSTALL_MODE_AUTO | 2 | Automatic update.|
| ------------------- | ------------- | ----------------- |
| INSTALL_MODE_NORMAL | 0 | Normal update. |
| INSTALL_MODE_NIGHT | 1 | Update at night. |
| INSTALL_MODE_AUTO | 2 | Automatic update. |
## NewVersionStatus
......@@ -538,10 +538,10 @@ Enumerates new version check results.
**System capability**: SystemCapability.Update.UpdateService
| Name | Default Value | Description |
| ------------------- | ---- | -------- |
| ------------------- | ------------- | ---------------------------------------- |
| VERSION_STATUS_ERR | -1 | System error while checking for the new version. |
| VERSION_STATUS_NEW | 0 | New version detected. |
| VERSION_STATUS_NONE | 1 | No new version detected.|
| VERSION_STATUS_NONE | 1 | No new version detected. |
| VERSION_STATUS_BUSY | 2 | System busy while checking for the new version. |
## UpdatePolicy
......@@ -551,10 +551,10 @@ Defines the update policy.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------------- | --------------------------- | ---- | ------- |
| ------------------- | --------------------------- | --------- | ------------------------------------ |
| autoDownload | bool | Yes | Automatic update switch. |
| installMode | [InstallMode](#installmode) | Yes | Update mode. |
| autoUpgradeInterval | Array\<number> | Yes | Period of time for automatic update.|
| autoUpgradeInterval | Array\<number> | Yes | Period of time for automatic update. |
## NewVersionInfo
......@@ -563,11 +563,11 @@ Defines the new version information.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| --------------- | ---------------------------------------- | ---- | ---- |
| status | [NewVersionStatus](#newversionstatus) | Yes | Update status.|
| errMsg | string | Yes | Error message.|
| checkResults | Array<[CheckResult](#checkresult)> | Yes | Version check result.|
| descriptionInfo | Array\<[DescriptionInfo](#descriptioninfo)> | Yes | Version description information.|
| --------------- | ---------------------------------------- | --------- | -------------------------------- |
| status | [NewVersionStatus](#newversionstatus) | Yes | Update status. |
| errMsg | string | Yes | Error message. |
| checkResults | Array<[CheckResult](#checkresult)> | Yes | Version check result. |
| descriptionInfo | Array\<[DescriptionInfo](#descriptioninfo)> | Yes | Version description information. |
## CheckResult
......@@ -576,13 +576,13 @@ Defines the version check result.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------- | ----------------------------- | ---- | ------ |
| ------------- | ----------------------------- | --------- | --------------------------------- |
| versionName | string | Yes | Version name. |
| versionCode | number | Yes | Version code. |
| size | number | Yes | Version size. |
| verifyInfo | string | Yes | Version verification information.|
| verifyInfo | string | Yes | Version verification information. |
| packageType | [PackageTypes](#packagetypes) | Yes | Version type. |
| descriptionId | string | Yes | Version description information.|
| descriptionId | string | Yes | Version description information. |
## DescriptionInfo
......@@ -591,6 +591,6 @@ Defines the version description information.
**System capability**: SystemCapability.Update.UpdateService
| Name | Type | Mandatory | Description |
| ------------- | ------ | ---- | ------------- |
| descriptionId | string | Yes | Version ID information.|
| content | string | Yes | Version changelog information.|
| ------------- | ------ | --------- | ------------------------------ |
| descriptionId | string | Yes | Version ID information. |
| content | string | Yes | Version changelog information. |
......@@ -32,7 +32,7 @@ In addition to the attributes in [Universal Attributes](js-components-common-at
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p969714591338"><a name="p969714591338"></a><a name="p969714591338"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p196974598338"><a name="p196974598338"></a><a name="p196974598338"></a>Dynamic modification is not supported. If this attribute is not set, capsule-like buttons are displayed. Different from the capsule button, the four rounded corners of a capsule-like button can be configured using <strong id="b14306174652119"><a name="b14306174652119"></a><a name="b14306174652119"></a>border-radius</strong>. Available button types are as follows:</p>
<a name="ul16971659103317"></a><a name="ul16971659103317"></a><ul id="ul16971659103317"><li><strong id="b2068317502142"><a name="b2068317502142"></a><a name="b2068317502142"></a>capsule</strong>: a capsule button with fillets, background color, and text</li><li><strong id="b13498122171611"><a name="b13498122171611"></a><a name="b13498122171611"></a>circle</strong>: a circle button which can be used to place icons</li><li><strong id="b17405113184910"><a name="b17405113184910"></a><a name="b17405113184910"></a>text</strong>: a text button which displays the text only</li><li><strong id="b1654481619215"><a name="b1654481619215"></a><a name="b1654481619215"></a>arc</strong>: an arc button. This value is applicable to wearables only.</li><li><strong id="b49041951132"><a name="b49041951132"></a><a name="b49041951132"></a>download</strong>: a download button. The download progress bar is added. This value is applicable to smart TVs and smartphones.</li></ul>
<a name="ul16971659103317"></a><a name="ul16971659103317"></a><ul id="ul16971659103317"><li><strong id="b2068317502142"><a name="b2068317502142"></a><a name="b2068317502142"></a>capsule</strong>: a capsule button with fillets, background color, and text</li><li><strong id="b13498122171611"><a name="b13498122171611"></a><a name="b13498122171611"></a>circle</strong>: a circle button which can be used to place icons</li><li><strong id="b17405113184910"><a name="b17405113184910"></a><a name="b17405113184910"></a>text</strong>: a text button which displays the text only</li><li><strong id="b1654481619215"><a name="b1654481619215"></a><a name="b1654481619215"></a>arc</strong>: an arc button. This value is applicable to wearables only.</li><li><strong id="b49041951132"><a name="b49041951132"></a><a name="b49041951132"></a>download</strong>: a download button. The download progress bar is added. </li></ul>
</td>
</tr>
<tr id="row6883454133320"><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p id="p6698195910338"><a name="p6698195910338"></a><a name="p6698195910338"></a>value</p>
......
......@@ -72,7 +72,7 @@ In addition to the attributes in [Universal Attributes](js-components-common-at
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p1455632813277"><a name="p1455632813277"></a><a name="p1455632813277"></a>Data structures used by <strong id="b1997913981710"><a name="b1997913981710"></a><a name="b1997913981710"></a>progress</strong>, <strong id="b991191118176"><a name="b991191118176"></a><a name="b991191118176"></a>loading</strong>, and <strong id="b962820295179"><a name="b962820295179"></a><a name="b962820295179"></a>rainbow</strong> charts.</p>
<p id="p19327195813510"><a name="p19327195813510"></a><a name="p19327195813510"></a><strong id="b196601530164710"><a name="b196601530164710"></a><a name="b196601530164710"></a>DataSegment</strong> is available for <strong id="b1066083012472"><a name="b1066083012472"></a><a name="b1066083012472"></a>progress</strong> and <strong id="b16660143054719"><a name="b16660143054719"></a><a name="b16660143054719"></a>loading</strong> charts.</p>
<p id="p14326258457"><a name="p14326258457"></a><a name="p14326258457"></a><strong id="b1044023344716"><a name="b1044023344716"></a><a name="b1044023344716"></a>Array&lt;<a href="#table2596183616210">DataSegment</a>&gt;</strong> is available for <strong id="b194405335477"><a name="b194405335477"></a><a name="b194405335477"></a>rainbow</strong> charts. A maximum of nine <strong id="b15441133114716"><a name="b15441133114716"></a><a name="b15441133114716"></a>DataSegment</strong> are supported in the array.</p>
<div class="note" id="note74451328478"><a name="note74451328478"></a><a name="note74451328478"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1744552174711"><a name="p1744552174711"></a><a name="p1744552174711"></a>This attribute is only supported on phones and tablets.</p>
<div class="note" id="note74451328478"><a name="note74451328478"></a><a name="note74451328478"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1744552174711"><a name="p1744552174711"></a><a name="p1744552174711"></a></p>
</div></div>
</td>
</tr>
......@@ -85,7 +85,7 @@ In addition to the attributes in [Universal Attributes](js-components-common-at
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1820820719229"><a name="p1820820719229"></a><a name="p1820820719229"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p92085712225"><a name="p92085712225"></a><a name="p92085712225"></a>Whether to enable the effects for <strong id="b7262163754711"><a name="b7262163754711"></a><a name="b7262163754711"></a>progress</strong> and <strong id="b12263437134715"><a name="b12263437134715"></a><a name="b12263437134715"></a>rainbow</strong> charts.</p>
<div class="note" id="note15640931164717"><a name="note15640931164717"></a><a name="note15640931164717"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p2064014318476"><a name="p2064014318476"></a><a name="p2064014318476"></a>This attribute is only supported on phones and tablets.</p>
<div class="note" id="note15640931164717"><a name="note15640931164717"></a><a name="note15640931164717"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p2064014318476"><a name="p2064014318476"></a><a name="p2064014318476"></a></p>
</div></div>
</td>
</tr>
......@@ -98,7 +98,7 @@ In addition to the attributes in [Universal Attributes](js-components-common-at
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p6133256124018"><a name="p6133256124018"></a><a name="p6133256124018"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p181331564408"><a name="p181331564408"></a><a name="p181331564408"></a>Animation duration for expanding a <strong id="b538918433184"><a name="b538918433184"></a><a name="b538918433184"></a>rainbow</strong> chart, in milliseconds.</p>
<div class="note" id="note12117134774716"><a name="note12117134774716"></a><a name="note12117134774716"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p12117124720471"><a name="p12117124720471"></a><a name="p12117124720471"></a>This attribute is only supported on phones and tablets.</p>
<div class="note" id="note12117134774716"><a name="note12117134774716"></a><a name="note12117134774716"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p12117124720471"><a name="p12117124720471"></a><a name="p12117124720471"></a></p>
</div></div>
</td>
</tr>
......
......@@ -225,8 +225,8 @@ Date selector \(**type** is **date**\)
</td>
<td class="cellrowborder" valign="top" width="7.15%" headers="mcps1.1.6.1.4 "><p id="p1181663281714"><a name="p1181663281714"></a><a name="p1181663281714"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="49.410000000000004%" headers="mcps1.1.6.1.5 "><p id="p781663212178"><a name="p781663212178"></a><a name="p781663212178"></a>Whether to display the lunar calendar switch in the date selector. When this switch is displayed, you can switch between the lunar calendar and Gregorian calendar. Turn on the switch to display the lunar calendar, and turn off the switch to hide the lunar calendar. This attribute is available for smartphones.</p>
<div class="note" id="note1688512355211"><a name="note1688512355211"></a><a name="note1688512355211"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p488582345212"><a name="p488582345212"></a><a name="p488582345212"></a>This attribute is only supported on phones and tablets.</p>
<td class="cellrowborder" valign="top" width="49.410000000000004%" headers="mcps1.1.6.1.5 "><p id="p781663212178"><a name="p781663212178"></a><a name="p781663212178"></a>Whether to display the lunar calendar switch in the date selector. When this switch is displayed, you can switch between the lunar calendar and Gregorian calendar. Turn on the switch to display the lunar calendar, and turn off the switch to hide the lunar calendar. </p>
<div class="note" id="note1688512355211"><a name="note1688512355211"></a><a name="note1688512355211"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p488582345212"><a name="p488582345212"></a><a name="p488582345212"></a></p>
</div></div>
</td>
</tr>
......@@ -293,8 +293,8 @@ Date and time selector \(**type** is **datetime**\)
</td>
<td class="cellrowborder" valign="top" width="7.15%" headers="mcps1.1.6.1.4 "><p id="p16203115101819"><a name="p16203115101819"></a><a name="p16203115101819"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="49.410000000000004%" headers="mcps1.1.6.1.5 "><p id="p12203111510184"><a name="p12203111510184"></a><a name="p12203111510184"></a>Whether to display the lunar calendar switch in the date and time selector. When this switch is displayed, you can switch between the lunar calendar and Gregorian calendar. Turn on the switch to display the lunar calendar, and turn off the switch to hide the lunar calendar. This attribute is available for smartphones.</p>
<div class="note" id="note11541837195218"><a name="note11541837195218"></a><a name="note11541837195218"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p454119371529"><a name="p454119371529"></a><a name="p454119371529"></a>This attribute is only supported on phones and tablets.</p>
<td class="cellrowborder" valign="top" width="49.410000000000004%" headers="mcps1.1.6.1.5 "><p id="p12203111510184"><a name="p12203111510184"></a><a name="p12203111510184"></a>Whether to display the lunar calendar switch in the date and time selector. When this switch is displayed, you can switch between the lunar calendar and Gregorian calendar. Turn on the switch to display the lunar calendar, and turn off the switch to hide the lunar calendar. </p>
<div class="note" id="note11541837195218"><a name="note11541837195218"></a><a name="note11541837195218"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p454119371529"><a name="p454119371529"></a><a name="p454119371529"></a>
</div></div>
</td>
</tr>
......@@ -424,7 +424,7 @@ In addition to the styles in [Universal Styles](js-components-common-styles.md)
<td class="cellrowborder" valign="top" width="5.909409059094091%" headers="mcps1.1.6.1.4 "><p id="p10494123164013"><a name="p10494123164013"></a><a name="p10494123164013"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p20494323144012"><a name="p20494323144012"></a><a name="p20494323144012"></a>Font color of the items that gradually disappear. Disappearing items are the top option and bottom option of a column containing five options in total.</p>
<div class="note" id="note682125718522"><a name="note682125718522"></a><a name="note682125718522"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p17821185711521"><a name="p17821185711521"></a><a name="p17821185711521"></a>This attribute is only supported on phones and tablets.</p>
<div class="note" id="note682125718522"><a name="note682125718522"></a><a name="note682125718522"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p17821185711521"><a name="p17821185711521"></a><a name="p17821185711521"></a></p>
</div></div>
</td>
</tr>
......@@ -437,7 +437,7 @@ In addition to the styles in [Universal Styles](js-components-common-styles.md)
<td class="cellrowborder" valign="top" width="5.909409059094091%" headers="mcps1.1.6.1.4 "><p id="p1949522364020"><a name="p1949522364020"></a><a name="p1949522364020"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p id="p1549532364020"><a name="p1549532364020"></a><a name="p1549532364020"></a>Font size of the items that gradually disappear. Disappearing items are the top option and bottom option of a column containing five options in total.</p>
<div class="note" id="note17211975317"><a name="note17211975317"></a><a name="note17211975317"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1821895535"><a name="p1821895535"></a><a name="p1821895535"></a>This attribute is only supported on phones and tablets.</p>
<div class="note" id="note17211975317"><a name="note17211975317"></a><a name="note17211975317"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1821895535"><a name="p1821895535"></a><a name="p1821895535"></a></p>
</div></div>
</td>
</tr>
......
......@@ -178,7 +178,7 @@ When **type** is set to **date**, a date selector is used.
<td class="cellrowborder" valign="top" width="7.15%" headers="mcps1.1.6.1.4 "><p id="p20878141062610"><a name="p20878141062610"></a><a name="p20878141062610"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="49.410000000000004%" headers="mcps1.1.6.1.5 "><p id="p9878910132617"><a name="p9878910132617"></a><a name="p9878910132617"></a>Whether the date selector displays the lunar calendar switch, which is used to switch between the Gregorian calendar and lunar calendar. The value <strong id="b1242195251513"><a name="b1242195251513"></a><a name="b1242195251513"></a>true</strong> means to display the lunar calendar switch for users to switch between the Gregorian calendar and lunar calendar. The value <strong id="b729391317186"><a name="b729391317186"></a><a name="b729391317186"></a>false</strong> means not to display the lunar calendar switch.</p>
<div class="note" id="note799016359510"><a name="note799016359510"></a><a name="note799016359510"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p49901135165115"><a name="p49901135165115"></a><a name="p49901135165115"></a>This attribute is only supported on phones and tablets. When both <strong id="b66411209185"><a name="b66411209185"></a><a name="b66411209185"></a>lunarswitch</strong> and <strong id="b1364102010185"><a name="b1364102010185"></a><a name="b1364102010185"></a>lunar</strong> are set to <strong id="b665102015187"><a name="b665102015187"></a><a name="b665102015187"></a>true</strong>, the switch is selected.</p>
<div class="note" id="note799016359510"><a name="note799016359510"></a><a name="note799016359510"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p49901135165115"><a name="p49901135165115"></a><a name="p49901135165115"></a> When both <strong id="b66411209185"><a name="b66411209185"></a><a name="b66411209185"></a>lunarswitch</strong> and <strong id="b1364102010185"><a name="b1364102010185"></a><a name="b1364102010185"></a>lunar</strong> are set to <strong id="b665102015187"><a name="b665102015187"></a><a name="b665102015187"></a>true</strong>, the switch is selected.</p>
</div></div>
</td>
</tr>
......@@ -329,7 +329,7 @@ When **type** is set to **datetime**, a date and time selector is used.
<td class="cellrowborder" valign="top" width="7.15%" headers="mcps1.1.6.1.4 "><p id="p12312856141615"><a name="p12312856141615"></a><a name="p12312856141615"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="49.410000000000004%" headers="mcps1.1.6.1.5 "><p id="p134738505123"><a name="p134738505123"></a><a name="p134738505123"></a>Whether the date selector displays the lunar calendar switch, which is used to switch between the Gregorian calendar and lunar calendar. The value <strong id="b11888837151819"><a name="b11888837151819"></a><a name="b11888837151819"></a>true</strong> means to display the lunar calendar switch for users to switch between the Gregorian calendar and lunar calendar. The value <strong id="b454518384186"><a name="b454518384186"></a><a name="b454518384186"></a>false</strong> means not to display the lunar calendar switch.</p>
<div class="note" id="note5428114735118"><a name="note5428114735118"></a><a name="note5428114735118"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1342819474512"><a name="p1342819474512"></a><a name="p1342819474512"></a>This attribute is only supported on phones and tablets. When both <strong id="b57802039111819"><a name="b57802039111819"></a><a name="b57802039111819"></a>lunarswitch</strong> and <strong id="b18781153991810"><a name="b18781153991810"></a><a name="b18781153991810"></a>lunar</strong> are set to <strong id="b4781173931813"><a name="b4781173931813"></a><a name="b4781173931813"></a>true</strong>, the switch is selected.</p>
<div class="note" id="note5428114735118"><a name="note5428114735118"></a><a name="note5428114735118"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1342819474512"><a name="p1342819474512"></a><a name="p1342819474512"></a>When both <strong id="b57802039111819"><a name="b57802039111819"></a><a name="b57802039111819"></a>lunarswitch</strong> and <strong id="b18781153991810"><a name="b18781153991810"></a><a name="b18781153991810"></a>lunar</strong> are set to <strong id="b4781173931813"><a name="b4781173931813"></a><a name="b4781173931813"></a>true</strong>, the switch is selected.</p>
</div></div>
</td>
</tr>
......@@ -529,7 +529,7 @@ In addition to the styles in [Universal Styles](js-components-common-styles.md)
<td class="cellrowborder" valign="top" width="8.60913908609139%" headers="mcps1.1.6.1.4 "><p id="p1862185217363"><a name="p1862185217363"></a><a name="p1862185217363"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="52.274772522747725%" headers="mcps1.1.6.1.5 "><p id="p116215526369"><a name="p116215526369"></a><a name="p116215526369"></a>Height of the selector option list.</p>
<div class="note" id="note769381335220"><a name="note769381335220"></a><a name="note769381335220"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p18693101311524"><a name="p18693101311524"></a><a name="p18693101311524"></a>This attribute is only supported on phones and tablets.</p>
<div class="note" id="note769381335220"><a name="note769381335220"></a><a name="note769381335220"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p18693101311524"><a name="p18693101311524"></a><a name="p18693101311524"></a></p>
</div></div>
</td>
</tr>
......
......@@ -58,7 +58,7 @@ In addition to the attributes in [Universal Attributes](js-components-common-at
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p5738613465"><a name="p5738613465"></a><a name="p5738613465"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p27381813364"><a name="p27381813364"></a><a name="p27381813364"></a>Step to increment the rating value.</p>
<div class="note" id="note1249472985312"><a name="note1249472985312"></a><a name="note1249472985312"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p749462910531"><a name="p749462910531"></a><a name="p749462910531"></a>This attribute is only supported on phones and tablets.</p>
<div class="note" id="note1249472985312"><a name="note1249472985312"></a><a name="note1249472985312"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p749462910531"><a name="p749462910531"></a><a name="p749462910531"></a></p>
</div></div>
</td>
</tr>
......
......@@ -76,7 +76,7 @@ In addition to the attributes in [Universal Attributes](js-components-common-at
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p23951632105213"><a name="p23951632105213"></a><a name="p23951632105213"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p83958323527"><a name="p83958323527"></a><a name="p83958323527"></a>Slider style. Available values are as follows:</p>
<a name="ul742810911538"></a><a name="ul742810911538"></a><ul id="ul742810911538"><li><strong id="b6310165918435"><a name="b6310165918435"></a><a name="b6310165918435"></a>outset</strong>: The slider is on the sliding bar.</li><li><strong id="b144297112440"><a name="b144297112440"></a><a name="b144297112440"></a>inset</strong>: The slider is inside the sliding bar.<div class="note" id="note10509152215419"><a name="note10509152215419"></a><a name="note10509152215419"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p14509172218549"><a name="p14509172218549"></a><a name="p14509172218549"></a>This attribute is only supported on phones and tablets.</p>
<a name="ul742810911538"></a><a name="ul742810911538"></a><ul id="ul742810911538"><li><strong id="b6310165918435"><a name="b6310165918435"></a><a name="b6310165918435"></a>outset</strong>: The slider is on the sliding bar.</li><li><strong id="b144297112440"><a name="b144297112440"></a><a name="b144297112440"></a>inset</strong>: The slider is inside the sliding bar.<div class="note" id="note10509152215419"><a name="note10509152215419"></a><a name="note10509152215419"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p14509172218549"><a name="p14509172218549"></a><a name="p14509172218549"></a></p>
</div></div>
</li></ul>
</td>
......@@ -90,7 +90,7 @@ In addition to the attributes in [Universal Attributes](js-components-common-at
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p1139593235218"><a name="p1139593235218"></a><a name="p1139593235218"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p639683265217"><a name="p639683265217"></a><a name="p639683265217"></a>Whether to display slider scales.</p>
<div class="note" id="note8765635135413"><a name="note8765635135413"></a><a name="note8765635135413"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p576523535418"><a name="p576523535418"></a><a name="p576523535418"></a>This attribute is only supported on phones and tablets.</p>
<div class="note" id="note8765635135413"><a name="note8765635135413"></a><a name="note8765635135413"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p576523535418"><a name="p576523535418"></a><a name="p576523535418"></a></p>
</div></div>
</td>
</tr>
......@@ -103,7 +103,7 @@ In addition to the attributes in [Universal Attributes](js-components-common-at
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p123962032185210"><a name="p123962032185210"></a><a name="p123962032185210"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p16396133212520"><a name="p16396133212520"></a><a name="p16396133212520"></a>Whether a pop-up is displayed to show the percentage value on the slider.</p>
<div class="note" id="note0708645135419"><a name="note0708645135419"></a><a name="note0708645135419"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p4708154510548"><a name="p4708154510548"></a><a name="p4708154510548"></a>This attribute is only supported on phones and tablets.</p>
<div class="note" id="note0708645135419"><a name="note0708645135419"></a><a name="note0708645135419"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p4708154510548"><a name="p4708154510548"></a><a name="p4708154510548"></a></p>
</div></div>
</td>
</tr>
......@@ -158,7 +158,7 @@ In addition to the styles in [Universal Styles](js-components-common-styles.md)
<td class="cellrowborder" valign="top" width="15.578442155784424%" headers="mcps1.1.6.1.4 "><p id="p3970121745715"><a name="p3970121745715"></a><a name="p3970121745715"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="31.95680431956805%" headers="mcps1.1.6.1.5 "><p id="p12970817175710"><a name="p12970817175710"></a><a name="p12970817175710"></a>Slider color.</p>
<div class="note" id="note29562075516"><a name="note29562075516"></a><a name="note29562075516"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p7956203555"><a name="p7956203555"></a><a name="p7956203555"></a>This attribute is only supported on phones, tablets, and wearables.</p>
<div class="note" id="note29562075516"><a name="note29562075516"></a><a name="note29562075516"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p7956203555"><a name="p7956203555"></a><a name="p7956203555"></a></p>
</div></div>
</td>
</tr>
......
......@@ -92,7 +92,7 @@ In addition to the attributes in [Universal Attributes](js-components-common-at
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p id="p11802185153615"><a name="p11802185153615"></a><a name="p11802185153615"></a>No</p>
</td>
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p id="p118021351362"><a name="p118021351362"></a><a name="p118021351362"></a>Pull-down friction coefficient. The value ranges from <strong id="b7887020335"><a name="b7887020335"></a><a name="b7887020335"></a>0</strong> to <strong id="b81365257313"><a name="b81365257313"></a><a name="b81365257313"></a>100</strong>. A larger value indicates a more responsive component. For example, if a user pulls the component down 100 px, it will actually move 100 * <strong id="b2130757132018"><a name="b2130757132018"></a><a name="b2130757132018"></a>friction</strong>% px.</p>
<div class="note" id="note204304260349"><a name="note204304260349"></a><a name="note204304260349"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1343012264345"><a name="p1343012264345"></a><a name="p1343012264345"></a>This attribute is only supported on phones, tablets, and wearables.</p>
<div class="note" id="note204304260349"><a name="note204304260349"></a><a name="note204304260349"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1343012264345"><a name="p1343012264345"></a><a name="p1343012264345"></a></p>
</div></div>
</td>
</tr>
......
......@@ -278,8 +278,8 @@ There are two ways to implement conditional rendering: if-elif-else or show. In
<div class="container">
<button class="btn" type="capsule" value="toggleShow" onclick="toggleShow"></button>
<button class="btn" type="capsule" value="toggleDisplay" onclick="toggleDisplay"></button>
<text if="{{visible}}"> Hello-TV </text>
<text elif="{{display}}"> Hello-Wearable </text>
<text if="{{visible}}"> Hello-World1 </text>
<text elif="{{display}}"> Hello-World2 </text>
<text else> Hello-World </text>
</div>
```
......
......@@ -11,7 +11,7 @@ Custom components decorated by @Preview can be previewed in the Previewer of Dev
Example of using @Preview:
```
// Display only Hello Component1 on the PC preview. The content under MyComponent is displayed on the real device.
// Display only Hello Component1 on the preview. The content under MyComponent is displayed on the real device.
@Entry
@Component
struct MyComponent {
......
......@@ -219,7 +219,7 @@ Search for contacts by using an alphabetical indexer.
<div class="container">
<div class="in-container">
<text class="name">{{$item.name}}</text>
<text class="phone">18888888888</text>
<text class="number">18888888888</text>
</div>
</div>
</list-item>
......@@ -251,7 +251,7 @@ Search for contacts by using an alphabetical indexer.
color: #000000;
font-size: 39px;
}
.phone {
.number {
color: black;
font-size: 25px;
}
......
......@@ -72,9 +72,8 @@ export default {
![en-us_image_0000001267647893](figures/en-us_image_0000001267647893.gif)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**:
> - When setting the value range of a common selector, you must use the data binding mode.
>
> - The lunarswitch attribute of the date selector is only supported on phones and tablets.
> When setting the value range of a common selector, you must use the data binding mode.
## Setting the Time Format
......
......@@ -49,7 +49,7 @@ On the created page, we use various items to describe food, such as food names,
}
```
3. Store food image resources in the resources > phone > media directory. Use food names as the image names.
3. Store food image resources in the resources > base > media directory. Use food names as the image names.
4. Create food resource data. Create FoodDataModels.ets in the model folder and declare a food composition array, FoodComposition on the page.
In this example, you can customize more data resources when needed. Use LazyForEach to load data if a large amount of food data is involved.
......
......@@ -7,7 +7,7 @@ Before creating a project, you need to install DevEco Studio.
1. Open DevEco Studio and click Create Project. If there is already a project, choose File > New > New project.
![en-us_image_0000001267607861](figures/en-us_image_0000001267607861.png)
2.
2.
On the page for selecting an ability template, select [Standard]Empty Ability.
......@@ -56,14 +56,14 @@ Before creating a project, you need to install DevEco Studio.
}
```
7. Click Previewer on the right to open the Previewer window. In the Previewer window of the phone type, Hello World is displayed in the middle and in bold.
7. Click Previewer on the right to open the Previewer window. Hello World is displayed in the middle and in bold.
If the Previewer button is unavailable, choose Settings > SDK Manager >OpenHarmony SDK > Tools to check whether the Previewer is installed.
![en-us_image_0000001222807756](figures/en-us_image_0000001222807756.png)
8. Install the application on the phone and run the application. Connect the phone to the computer. After the IDE identifies the phone, click Run'entry'.
8. Install the application and run the application. Connect the device to the computer. After the IDE identifies the device, click Run'entry'.
![en-us_image_0000001267607865](figures/en-us_image_0000001267607865.png)
Before the installation, you must configure an application signature. For details, see [Configuring the OpenHarmony App Signature](../quick-start/configuring-the-openharmony-app-signature.md). After the installation is complete, click the Run icon on the screen to open the application. Hello World is displayed in the center of the screen.
Before the installation, you must configure an application signature. For details, see Configuring the OpenHarmony App Signature. After the installation is complete, click the Run icon on the screen to open the application. Hello World is displayed in the center of the screen.
![en-us_image_0000001267647841](figures/en-us_image_0000001267647841.png)
......@@ -46,13 +46,7 @@ In this section, we will develop an infographic food details page, by building c
![en-us_image_0000001267887861](figures/en-us_image_0000001267887861.png)
3. Access images through resources.
In addition to specifying the image path, you can also use the media resource symbol $r to reference resources based on the resource qualifier rules in the resources folder. Right-click the resources folder, choose New &gt; Resource Directory, set Resource Type to Media (image resource), and set the resource qualifier to Device-Phone (currently, phones are used).
![en-us_image_0000001267887853](figures/en-us_image_0000001267887853.png)
Click OK. The phone.media folder is generated in the resources folder. Place Tomato.png in the folder.
![en-us_image_0000001222807784](figures/en-us_image_0000001222807784.png)
In addition to specifying the image path, you can also use the media resource symbol $r to reference resources based on the resource qualifier rules in the resources folder. Right-click the resources folder, choose New &gt; Resource Directory, set Resource Type to Media (image resource).Place Tomato.png in the media folder.
You can then can reference the application resource in the ` "$r('app.type.name')"` format, that is, `$r('app.media.Tomato')`.
......
......@@ -72,7 +72,7 @@ The procedure below uses these two mechanisms for redirection between the page l
![en-us_image_0000001267607909](figures/en-us_image_0000001267607909.gif)
3. Add the icon for returning from the FoodDetail page to the food list page. Save the Back.png file to the resources > phone > media directory. Create a custom component PageTitle, which contains the back icon and Food Detail text. Call the router.back() API of the router to display the top page of the route stack, that is, the upper-level page.
3. Add the icon for returning from the FoodDetail page to the food list page. Save the Back.png file to the resources > base > media directory. Create a custom component PageTitle, which contains the back icon and Food Detail text. Call the router.back() API of the router to display the top page of the route stack, that is, the upper-level page.
```
// FoodDetail.ets
......
......@@ -220,6 +220,10 @@
- Distributed Call Chain Tracing
- [Overview of Distributed Call Chain Tracing](dfx/hitracechain-overview.md)
- [Development of Distributed Call Chain Tracing](dfx/hitracechain-guidelines.md)
- Internationalization
- [Overview](internationalization/international-overview.md)
- [Internationalization Development (intl)](internationalization/intl-guidelines.md)
- [Internationalization Development (i18n)](internationalization/i18n-guidelines.md)
- Tools
- [DevEco Studio (OpenHarmony) User Guide](quick-start/deveco-studio-user-guide-for-openharmony.md)
- Hands-On Tutorials
......
......@@ -7,7 +7,7 @@ OpenHarmony系统传感器是应用访问底层硬件传感器的一种设备抽
传感器是指用于侦测环境中所发生事件或变化,并将此消息发送至其他电子设备(如中央处理器)的设备,通常由敏感组件和转换组件组成。传感器是实现物联网智能化的重要基石,为实现全场景智慧化战略,支撑“1+8+N”产品需求,需要构筑统一的传感器管理框架,达到为各产品/业务提供低时延、低功耗的感知数据的目的。下面为传感器列表:
| 传感器类型 | 描述 | 说明 | 主要用途 |
| --------------------------------------- | ------------------ | ------------------------------------------------------------ | ---------------------------------------- |
| --------------------------------------- | --------- | ---------------------------------------- | -------------------- |
| SENSOR_TYPE_ACCELEROMETER | 加速度传感器 | 测量三个物理轴(x、y&nbsp;&nbsp;z)上,施加在设备上的加速度(包括重力加速度),单位&nbsp;:&nbsp;m/s2 | 检测运动状态 |
| SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED | 未校准加速度传感器 | 测量三个物理轴(x、y&nbsp;&nbsp;z)上,施加在设备上的未校准的加速度(包括重力加速度),单位&nbsp;:&nbsp;m/s2 | 检测加速度偏差估值 |
| SENSOR_TYPE_LINEAR_ACCELERATION | 线性加速度传感器 | 测量三个物理轴(x、y&nbsp;&nbsp;z)上,施加在设备上的线性加速度(不包括重力加速度),单位&nbsp;:&nbsp;m/s2 | 检测每个单轴方向上的线性加速度 |
......@@ -54,12 +54,12 @@ OpenHarmony传感器包含如下四个模块:Sensor API、Sensor Framework、S
表7 传感器数据权限
| 传感器 | 权限名 | 敏感级别 | 权限描述 |
| ------------------------- | -------------------------------- | ------------ | ----------------------- |
| 加速度传感器,加速度未校准传感器,线性加速度传感器 | ohos.permission.ACCELEROMETER | system_grant | 允许订阅Motion组对应的加速度传感器的数据 |
| 陀螺仪传感器,陀螺仪未校准传感器 | ohos.permission.GYROSCOPE | system_grant | 允许订阅Motion组对应的陀螺仪传感器的数据 |
| 计步器 | ohos.permission.ACTIVITY_MOTION | user_grant | 允许订阅运动状态 |
| 心率计 | ohos.permission.READ_HEALTH_DATA | user_grant | 允许读取健康数据 |
| 传感器 | 权限名 | 敏感级别 | 权限描述 |
| ------------------------- | -------------------------------- | ------------ | ----------------------- |
| 加速度传感器,加速度未校准传感器,线性加速度传感器 | ohos.permission.ACCELEROMETER | system_grant | 允许订阅Motion组对应的加速度传感器的数据 |
| 陀螺仪传感器,陀螺仪未校准传感器 | ohos.permission.GYROSCOPE | system_grant | 允许订阅Motion组对应的陀螺仪传感器的数据 |
| 计步器 | ohos.permission.ACTIVITY_MOTION | user_grant | 允许订阅运动状态 |
| 心率计 | ohos.permission.READ_HEALTH_DATA | user_grant | 允许读取健康数据 |
......
......@@ -22,15 +22,15 @@ requestSuspendDelay(reason: string, callback: Callback&lt;void&gt;): DelaySuspen
**系统能力:** SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask
**参数**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| reason | string | 是 | 延迟挂起申请的原因。 |
| callback | Callback&lt;void&gt; | 是 | 延迟即将超时的回调函数,一般在超时前6秒通过此回调通知应用。 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------------------- | ---- | ------------------------------ |
| reason | string | 是 | 延迟挂起申请的原因。 |
| callback | Callback&lt;void&gt; | 是 | 延迟即将超时的回调函数,一般在超时前6秒通过此回调通知应用。 |
**返回值**
| 类型 | 说明 |
| -------- | -------- |
| [DelaySuspendInfo](#delaysuspendinfo) | 返回延迟挂起信息。 |
| 类型 | 说明 |
| ------------------------------------- | --------- |
| [DelaySuspendInfo](#delaysuspendinfo) | 返回延迟挂起信息。 |
**示例**
```js
......@@ -50,10 +50,10 @@ getRemainingDelayTime(requestId: number, callback: AsyncCallback&lt;number&gt;):
**系统能力:** SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask
**参数**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| requestId | number | 是 | 延迟挂起的请求ID。 |
| callback | AsyncCallback&lt;number&gt; | 是 | 指定的callback回调方法。用于返回应用程序进入挂起状态之前的剩余时间,以毫秒为单位。 |
| 参数名 | 类型 | 必填 | 说明 |
| --------- | --------------------------- | ---- | ---------------------------------------- |
| requestId | number | 是 | 延迟挂起的请求ID。 |
| callback | AsyncCallback&lt;number&gt; | 是 | 指定的callback回调方法。用于返回应用程序进入挂起状态之前的剩余时间,以毫秒为单位。 |
**示例**
......@@ -78,14 +78,14 @@ getRemainingDelayTime(requestId: number): Promise&lt;number&gt;
**系统能力:** SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask
**参数**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| requestId | number | 是 | 延迟挂起的请求ID。 |
| 参数名 | 类型 | 必填 | 说明 |
| --------- | ------ | ---- | ---------- |
| requestId | number | 是 | 延迟挂起的请求ID。 |
**返回值**
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;number&gt; | 指定的Promise回调方法。返回应用程序进入挂起状态之前的剩余时间,以毫秒为单位。 |
| 类型 | 说明 |
| --------------------- | ---------------------------------------- |
| Promise&lt;number&gt; | 指定的Promise回调方法。返回应用程序进入挂起状态之前的剩余时间,以毫秒为单位。 |
**示例**
```js
......@@ -107,9 +107,9 @@ cancelSuspendDelay(requestId: number): void
**系统能力:** SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask
**参数**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| requestId | number | 是 | 延迟挂起的请求ID。 |
| 参数名 | 类型 | 必填 | 说明 |
| --------- | ------ | ---- | ---------- |
| requestId | number | 是 | 延迟挂起的请求ID。 |
**示例**
```js
......@@ -129,9 +129,9 @@ startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: Want
**参数**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| --------- | ---------------------------------- | ---- | ------------------------ |
| context | [Context](js-apis-Context.md) | 是 | 应用运行的上下文。 |
| bgMode | [BackgroundMode](#backgroundmode8) | 是 | 向系统申请的后台模式。|
| bgMode | [BackgroundMode](#backgroundmode8) | 是 | 向系统申请的后台模式。 |
| wantAgent | [WantAgent](js-apis-wantAgent.md) | 是 | 通知参数,用于指定长时任务通知点击后跳转的界面。 |
| callback | AsyncCallback&lt;void&gt; | 是 | callback形式返回启动长时任务的结果。 |
......@@ -181,15 +181,15 @@ startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: Want
**参数**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| --------- | ---------------------------------- | ---- | ----------------------- |
| context | [Context](js-apis-Context.md) | 是 | 应用运行的上下文。 |
| bgMode | [BackgroundMode](#backgroundmode8) | 是 | 向系统申请的后台模式。 |
| wantAgent | [WantAgent](js-apis-wantAgent.md) | 是 | 通知参数,用于指定长时任务通知点击跳转的界面。 |
**返回值**
| 类型 | 说明 |
| -------------- | ------------------------- |
| Promise\<void> | 使用Promise形式返回结果。 |
| 类型 | 说明 |
| -------------- | ---------------- |
| Promise\<void> | 使用Promise形式返回结果。 |
**示例**
```js
......@@ -229,10 +229,10 @@ stopBackgroundRunning(context: Context, callback: AsyncCallback&lt;void&gt;): vo
**系统能力:** SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
**参数**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| context | [Context](js-apis-Context.md) | 是 | 应用运行的上下文。 |
| callback | AsyncCallback&lt;void&gt; | 是 | callback形式返回启动长时任务的结果。 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------------- | ---- | ---------------------- |
| context | [Context](js-apis-Context.md) | 是 | 应用运行的上下文。 |
| callback | AsyncCallback&lt;void&gt; | 是 | callback形式返回启动长时任务的结果。 |
**示例**
```js
......@@ -260,14 +260,14 @@ stopBackgroundRunning(context: Context): Promise&lt;void&gt;
**系统能力:** SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
**参数**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| context | [Context](js-apis-Context.md) | 是 | 应用运行的上下文。 |
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ----------------------------- | ---- | --------- |
| context | [Context](js-apis-Context.md) | 是 | 应用运行的上下文。 |
**返回值**
| 类型 | 说明 |
| -------------- | ------------------------- |
| Promise\<void> | 使用Promise形式返回结果。 |
| 类型 | 说明 |
| -------------- | ---------------- |
| Promise\<void> | 使用Promise形式返回结果。 |
**示例**
```js
......@@ -289,7 +289,7 @@ backgroundTaskManager.stopBackgroundRunning(featureAbility.getContext()).then(()
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| --------------- | ------ | ---- | ---------------------------------------- |
| requestId | number | 是 | 延迟挂起的请求ID。 |
| actualDelayTime | number | 是 | 应用的实际挂起延迟时间,以毫秒为单位。<br/>一般情况下默认值为180000,低电量(依据系统低电量广播)时默认值为60000。 |
......@@ -299,7 +299,7 @@ backgroundTaskManager.stopBackgroundRunning(featureAbility.getContext()).then(()
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
| 参数名 | 参数值 | 描述 |
| ----------------------- | -------- | -------- |
| ----------------------- | ---- | ------------ |
| DATA_TRANSFER | 1 | 数据传输 |
| AUDIO_PLAYBACK | 2 | 音频播放 |
| AUDIO_RECORDING | 3 | 录音 |
......@@ -308,4 +308,4 @@ backgroundTaskManager.stopBackgroundRunning(featureAbility.getContext()).then(()
| MULTI_DEVICE_CONNECTION | 6 | 多设备互联 |
| WIFI_INTERACTION | 7 | WLAN相关(系统保留) |
| VOIP | 8 | 音视频通话(系统保留) |
| TASK_KEEPING | 9 | 计算任务(仅供PC使用) |
\ No newline at end of file
| TASK_KEEPING | 9 | 计算任务 |
\ No newline at end of file
......@@ -21,9 +21,9 @@ showToast(options: ShowToastOptions): void
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| options | [ShowToastOptions](#showtoastoptions) | 是 | 文本弹窗选项。 |
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------------------------------------- | ---- | ------- |
| options | [ShowToastOptions](#showtoastoptions) | 是 | 文本弹窗选项。 |
**示例:**
```
......@@ -43,10 +43,10 @@ showToast(options: ShowToastOptions): void
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------------- | ---- | ---------------------------------------- |
| message | string | 是 | 显示的文本信息。 |
| duration | number | 否 | 默认值1500ms,建议区间:1500ms-10000ms,若小于1500ms则取默认值。 |
| bottom | &lt;length&gt; | 否 | 设置弹窗边框距离屏幕底部的位置,仅手机和平板设备支持。 |
| bottom | &lt;length&gt; | 否 | 设置弹窗边框距离屏幕底部的位置。 |
## prompt.showDialog
......@@ -57,15 +57,15 @@ showDialog(options: ShowDialogOptions): Promise&lt;ShowDialogSuccessResponse&gt;
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| options | [ShowDialogOptions](#showdialogoptions) | 是 | 对话框选项。|
| 参数名 | 类型 | 必填 | 说明 |
| ------- | --------------------------------------- | ---- | ------ |
| options | [ShowDialogOptions](#showdialogoptions) | 是 | 对话框选项。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;[ShowDialogSuccessResponse](#showdialogsuccessresponse)&gt; | 对话框响应结果。|
| 类型 | 说明 |
| ---------------------------------------- | -------- |
| Promise&lt;[ShowDialogSuccessResponse](#showdialogsuccessresponse)&gt; | 对话框响应结果。 |
**示例:**
......@@ -106,10 +106,10 @@ showDialog(options: ShowDialogOptions, callback: AsyncCallback&lt;ShowDialogSucc
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| options | [ShowDialogOptions](#showdialogoptions) | 是 | 页面显示对话框信息描述。|
| callback | AsyncCallback&lt;[ShowDialogSuccessResponse](#showdialogsuccessresponse)&gt; | 是 | 对话框响应结果回调。 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ------------ |
| options | [ShowDialogOptions](#showdialogoptions) | 是 | 页面显示对话框信息描述。 |
| callback | AsyncCallback&lt;[ShowDialogSuccessResponse](#showdialogsuccessresponse)&gt; | 是 | 对话框响应结果回调。 |
**示例:**
```
......@@ -147,7 +147,7 @@ showDialog(options: ShowDialogOptions, callback: AsyncCallback&lt;ShowDialogSucc
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| ------- | ------ | ---- | ---------------------------------------- |
| title | string | 否 | 标题文本。 |
| message | string | 否 | 内容文本。 |
| buttons | Array | 否 | 对话框中按钮的数组,结构为:{text:'button',&nbsp;color:&nbsp;'\#666666'},支持1-3个按钮。其中第一个为positiveButton;第二个为negativeButton;第三个为neutralButton。 |
......@@ -159,7 +159,7 @@ showDialog(options: ShowDialogOptions, callback: AsyncCallback&lt;ShowDialogSucc
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。
| 名称 | 类型 | 说明 |
| -------- | -------- | -------- |
| ----- | ------ | ------------------- |
| index | number | 选中按钮在buttons数组中的索引。 |
......@@ -172,10 +172,10 @@ showActionMenu(options: ActionMenuOptions, callback: AsyncCallback&lt;ActionMenu
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| options | [ActionMenuOptions](#actionmenuoptions) | 是 | 操作菜单选项。 |
| callback | AsyncCallback&lt;[ActionMenuSuccessResponse](#actionmenusuccessresponse)> | 是 | 菜单响应结果回调。 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- |
| options | [ActionMenuOptions](#actionmenuoptions) | 是 | 操作菜单选项。 |
| callback | AsyncCallback&lt;[ActionMenuSuccessResponse](#actionmenusuccessresponse)> | 是 | 菜单响应结果回调。 |
**示例:**
......@@ -215,14 +215,14 @@ showActionMenu(options: ActionMenuOptions): Promise<ActionMenuSuccessResponse>
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| options | [ActionMenuOptions](#actionmenuoptions) | 是 | 操作菜单选项。 |
| 参数名 | 类型 | 必填 | 说明 |
| ------- | --------------------------------------- | ---- | ------- |
| options | [ActionMenuOptions](#actionmenuoptions) | 是 | 操作菜单选项。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;[ActionMenuSuccessResponse](#actionmenusuccessresponse)&gt; | 菜单响应结果。|
| 类型 | 说明 |
| ---------------------------------------- | ------- |
| Promise&lt;[ActionMenuSuccessResponse](#actionmenusuccessresponse)&gt; | 菜单响应结果。 |
**示例:**
```
......@@ -257,7 +257,7 @@ showActionMenu(options: ActionMenuOptions): Promise<ActionMenuSuccessResponse>
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| ------- | ------ | ---- | ---------------------------------------- |
| title | string | 否 | 标题文本。 |
| buttons | Array | 是 | 菜单中菜单项按钮的数组,结构为:{text:'button',&nbsp;color:&nbsp;'\#666666'},支持1-6个按钮。大于6个按钮时弹窗不显示。 |
......@@ -268,6 +268,6 @@ showActionMenu(options: ActionMenuOptions): Promise<ActionMenuSuccessResponse>
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| ----- | ------ | ---- | ------------------------ |
| index | number | 否 | 选中按钮在buttons数组中的索引,从0开始。 |
......@@ -135,7 +135,7 @@ export default {
| ------------------- | -------------- | ---- | ---------------------------------------- |
| message | string | 是 | 显示的文本信息。 |
| duration | number | 否 | 默认值1500ms,建议区间:1500ms-10000ms。若小于1500ms则取默认值,最大取值为10000ms。 |
| bottom<sup>5+</sup> | string\|number | 否 | 设置弹窗边框距离屏幕底部的位置,仅手机和平板设备支持。 |
| bottom<sup>5+</sup> | string\|number | 否 | 设置弹窗边框距离屏幕底部的位置 |
## Button
......
......@@ -18,8 +18,8 @@ import sensor from '@system.sensor';
## 传感器错误码列表
| 错误码 | 说明 |
| -------- | -------- |
| 错误码 | 说明 |
| ---- | -------------- |
| 900 | 当前设备不支持相应的传感器。 |
## sensor.subscribeAccelerometer
......@@ -35,15 +35,15 @@ subscribeAccelerometer(Object): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | ---- | ---------------------------------------- |
| interval | string | 是 | 频率参数,加速度的回调函数执行频率。<br/>默认为normal,可选值有:<br/>-&nbsp;game:极高的回调频率,20ms/次,适用于游戏。<br/>-&nbsp;ui:较高的回调频率,60ms/次,适用于UI更新。<br/>-&nbsp;normal:普通的回调频率,200ms/次,低功耗。 |
| success | Function | 是 | 感应到加速度数据变化后的回调函数。 |
| fail | Function | 否 | 接口调用失败的回调函数。 |
success返回值:
| 参数名 | 类型 | 说明 |
| -------- | -------- | -------- |
| 参数名 | 类型 | 说明 |
| ---- | ------ | ------- |
| x | number | x轴的加速度。 |
| y | number | y轴的加速度。 |
| z | number | z轴的加速度。 |
......@@ -94,14 +94,14 @@ subscribeCompass(Object): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| ------- | -------- | ---- | --------------- |
| success | Function | 是 | 罗盘数据改变后触发的回调函数。 |
| fail | Function | 否 | 接口调用失败的回调函数。 |
success返回值:
| 参数名 | 类型 | 说明 |
| -------- | -------- | -------- |
| 参数名 | 类型 | 说明 |
| --------- | ------ | ---------- |
| direction | number | 设备面对的方向度数。 |
**示例:**
......@@ -145,14 +145,14 @@ subscribeProximity(Object): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| ------- | -------- | ---- | ----------------- |
| success | Function | 是 | 距离感应数据改变后调用的回调函数。 |
| fail | Function | 否 | 接口调用失败的回调函数。 |
success返回值:
| 参数名 | 类型 | 说明 |
| -------- | -------- | -------- |
| 参数名 | 类型 | 说明 |
| -------- | ------ | --------------------- |
| distance | number | 可见物体相对于设备显示屏的接近或远离状态。 |
**示例:**
......@@ -196,14 +196,14 @@ sensor.subscribeLight(Object): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| ------- | -------- | ---- | --------------- |
| success | Function | 是 | 光线感应数据改变后的回调函数。 |
| fail | Function | 否 | 接口调用失败的回调函数。 |
success返回值:
| 参数名 | 类型 | 说明 |
| -------- | -------- | -------- |
| 参数名 | 类型 | 说明 |
| --------- | ------ | ------------ |
| intensity | number | 光线强度,单位为lux。 |
**示例:**
......@@ -249,14 +249,14 @@ subscribeStepCounter(Object): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| ------- | -------- | ---- | ---------------- |
| success | Function | 是 | 计步传感器数据改变后的回调函数。 |
| fail | Function | 否 | 接口调用失败的回调函数。 |
success返回值:
| 参数名 | 类型 | 说明 |
| -------- | -------- | -------- |
| 参数名 | 类型 | 说明 |
| ----- | ------ | --------------------- |
| steps | number | 计步传感器重启后累计记录的步数。<br/> |
**示例:**
......@@ -303,14 +303,14 @@ subcribeBarometer(Object): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| ------- | -------- | ---- | ---------------- |
| success | Function | 是 | 气压传感器数据改变后的回调函数。 |
| fail | Function | 否 | 接口调用失败的回调函数。 |
success返回值:
| 参数名 | 类型 | 说明 |
| -------- | -------- | -------- |
| 参数名 | 类型 | 说明 |
| -------- | ------ | ----------- |
| pressure | number | 气压值,单位:帕斯卡。 |
**示例:**
......@@ -358,14 +358,14 @@ subscribeHeartRate(Object): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| ------- | -------- | ---- | ------------------------- |
| success | Function | 是 | 心率传感器数据改变后的回调函数,默认频率5s/次。 |
| fail | Function | 否 | 接口调用失败的回调函数。 |
success返回值:
| 参数名 | 类型 | 说明 |
| -------- | -------- | -------- |
| 参数名 | 类型 | 说明 |
| --------- | ------ | ---- |
| heartRate | number | 心率值。 |
**示例:**
......@@ -412,14 +412,14 @@ subscribeOnBodyState(Object): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| ------- | -------- | ---- | ------------- |
| success | Function | 是 | 穿戴状态改变后的回调函数。 |
| fail | Function | 否 | 接口调用失败的回调函数。 |
success返回值:
| 参数名 | 类型 | 说明 |
| -------- | -------- | -------- |
| 参数名 | 类型 | 说明 |
| ----- | ------- | ------ |
| value | boolean | 是否已佩戴。 |
**示例:**
......@@ -463,15 +463,15 @@ getOnBodyState(Object): void
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | ---- | ------------ |
| success | Function | 否 | 接口调用成功的回调函数。 |
| fail | Function | 否 | 接口调用失败的回调函数。 |
| complete | Function | 否 | 接口调用结束的回调函数。 |
success返回值:
| 参数名 | 类型 | 说明 |
| -------- | -------- | -------- |
| 参数名 | 类型 | 说明 |
| ----- | ------- | ------ |
| value | boolean | 是否已佩戴。 |
**示例:**
......@@ -500,17 +500,17 @@ subscribeDeviceOrientation(interval: string, success: (data: DeviceOrientationRe
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | ---- | ---------------------------------------- |
| interval | string | 是 | 频率参数,设备方向传感器的回调函数执行频率。<br/>默认为normal,可选值有:<br/>-&nbsp;game:极高的回调频率,20ms/次,适用于游戏。<br/>-&nbsp;ui:较高的回调频率,60ms/次,适用于UI更新。<br/>-&nbsp;normal:普通的回调频率,200ms/次,低功耗。 |
| success | Function | 是 | 感应到设备方向传感器数据变化后的回调函数。 |
| fail | Function | 否 | 接口调用失败的回调函数。 |
success返回值:
| 参数名 | 类型 | 说明 |
| -------- | -------- | -------- |
| alpha | number | 当手机坐标&nbsp;X/Y&nbsp;和地球&nbsp;X/Y&nbsp;重合时,绕着&nbsp;Z&nbsp;轴转动的夹角为&nbsp;alpha。 |
| beta | number | 当手机坐标&nbsp;Y/Z&nbsp;和地球&nbsp;Y/Z&nbsp;重合时,绕着&nbsp;X&nbsp;轴转动的夹角为&nbsp;beta。 |
| gamma | number | 当手机&nbsp;X/Z&nbsp;和地球&nbsp;X/Z&nbsp;重合时,绕着&nbsp;Y&nbsp;轴转动的夹角为&nbsp;gamma。 |
| 参数名 | 类型 | 说明 |
| ----- | ------ | ---------------------------------------- |
| alpha | number | 当设备坐标&nbsp;X/Y&nbsp;和地球&nbsp;X/Y&nbsp;重合时,绕着&nbsp;Z&nbsp;轴转动的夹角为&nbsp;alpha。 |
| beta | number | 当设备坐标&nbsp;Y/Z&nbsp;和地球&nbsp;Y/Z&nbsp;重合时,绕着&nbsp;X&nbsp;轴转动的夹角为&nbsp;beta。 |
| gamma | number | 当设备&nbsp;X/Z&nbsp;和地球&nbsp;X/Z&nbsp;重合时,绕着&nbsp;Y&nbsp;轴转动的夹角为&nbsp;gamma。 |
**示例:**
......@@ -560,15 +560,15 @@ subscribeGyroscope(interval: string, success: (data: GyroscopeResponse), fail?:
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | ---- | ---------------------------------------- |
| interval | string | 是 | 频率参数,陀螺仪的回调函数执行频率。<br/>默认为normal,可选值有:<br/>-&nbsp;game:极高的回调频率,20ms/次,适用于游戏。<br/>-&nbsp;ui:较高的回调频率,60ms/次,适用于UI更新。<br/>-&nbsp;normal:普通的回调频率,200ms/次,低功耗。 |
| success | Function | 是 | 感应到陀螺仪数据变化后的回调函数。 |
| fail | Function | 否 | 接口调用失败的回调函数。 |
success返回值:
| 参数名 | 类型 | 说明 |
| -------- | -------- | -------- |
| 参数名 | 类型 | 说明 |
| ---- | ------ | --------- |
| x | number | x轴的旋转角速度。 |
| y | number | y轴的旋转角速度。 |
| z | number | z轴的旋转角速度。 |
......
# 升级
升级
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......@@ -8,7 +8,7 @@
升级依赖:升级分为SD卡升级和在线升级两种。
- SD卡升级依赖升级包和SD卡安装。
- 在线升级依赖手机厂商部署的用于管理升级包的服务器。服务器由手机厂商部署,IP由调用者传入,请求的request接口是固定的,由手机厂商开发。
- 在线升级依赖设备厂商部署的用于管理升级包的服务器。服务器由设备厂商部署,IP由调用者传入,请求的request接口是固定的,由设备厂商开发。
## 导入模块
......
......@@ -16,13 +16,13 @@
除支持[通用属性](../arkui-js/js-components-common-attributes.md)外,还支持如下属性:
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| ---- | ------ | ---- | ---- | ---------------------------------------- |
| type | string | text | 否 | 设置滑动选择器的类型,该属性不支持动态修改,可选项有:<br/>-&nbsp;text:文本选择器。<br/>-&nbsp;time:时间选择器。<br/>-&nbsp;date:日期选择器。<br/>-&nbsp;datetime:日期时间选择器。<br/>-&nbsp;multi-text:多列文本选择器。 |
文本选择器:type=text
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| --------------- | ------ | ---- | ---- | ---------------------------------------- |
| range | Array | - | 否 | 设置文本选择器的取值范围。<br/>>&nbsp;![icon-note.gif](public_sys-resources/icon-note.gif)&nbsp;**说明:**<br/>>&nbsp;使用时需要使用数据绑定的方式,如range&nbsp;=&nbsp;{{data}},js中声明相应变量:data:["15",&nbsp;"20",&nbsp;"25"]。 |
| selected | string | 0 | 否 | 设置文本选择器的默认选择值,该值需要为range的索引。 |
| indicatorprefix | string | - | 否 | 文本选择器选定值增加的前缀字段。 |
......@@ -31,7 +31,7 @@
时间选择器:type=time
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| ------------- | ------- | ----------------------------------- | ---- | ---------------------------------------- |
| containsecond | boolean | false | 否 | 时间选择器是否包含秒。 |
| selected | string | 当前时间 | 否 | 设置时间选择器的默认取值,格式为&nbsp;HH:mm;<br/>当包含秒时,格式为HH:mm:ss。 |
| hours | number | 24<sup>1-4</sup><br/>-<sup>5+</sup> | 否 | 设置时间选择器采用的时间格式,可选值:<br/>-&nbsp;12:按照12小时制显示,用上午和下午进行区分;<br/>-&nbsp;24:按照24小时制显示。<br/>&nbsp;&nbsp;>&nbsp;![icon-note.gif](public_sys-resources/icon-note.gif)&nbsp;**说明:**<br/>&nbsp;&nbsp;>&nbsp;默认值会依据系统当前所选地区和语言选择当地习惯的小时制(12小时制或24小时制)。<sup>5+</sup> |
......@@ -39,26 +39,26 @@
日期选择器:type=date
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| ------------------ | ------------ | ---------- | ---- | ---------------------------------------- |
| start | &lt;time&gt; | 1970-1-1 | 否 | 设置日期选择器的起始时间,格式为&nbsp;YYYY-MM-DD。 |
| end | &lt;time&gt; | 2100-12-31 | 否 | 设置日期选择器的结束时间,格式为&nbsp;YYYY-MM-DD。 |
| selected | string | 当前日期 | 否 | 设置日期选择器的默认选择值,格式为&nbsp;YYYY-MM-DD。 |
| lunar<sup>5+</sup> | boolean | false | 否 | 设置日期选择器弹窗界面是否为农历展示。 |
| lunarswitch | boolean | false | 否 | 设置日期选择器是否显示农历开关,显示农历开关时,可以在弹窗界面展现农历的开关由于公历和农历切换。在设置显示农历时,开关状态为开,当设置不显示农历时,开关状态为关。手机生效。 |
| lunarswitch | boolean | false | 否 | 设置日期选择器是否显示农历开关,显示农历开关时,可以在弹窗界面展现农历的开关由于公历和农历切换。在设置显示农历时,开关状态为开,当设置不显示农历时,开关状态为关。 |
日期时间选择器:type=datetime,日期的选择范围为本年的日月。
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| ------------------ | ------- | ----------------------------------- | ---- | ---------------------------------------- |
| selected | string | 当前日期时间 | 否 | 设置日期时间选择器的默认取值,格式有两种,为月日时分MM-DD-HH-mm或者年月日时分YYYY-MM-DD-HH-mm,不设置年时,默认使用当前年,该取值表示选择器弹窗时弹窗界面的默认选择值。 |
| hours | number | 24<sup>1-4</sup><br/>-<sup>5+</sup> | 否 | 设置日期时间选择器采用的时间格式,可选值:<br/>-&nbsp;12:按照12小时制显示,用上午和下午进行区分;<br/>-&nbsp;24:按照24小时制显示。<br/>&nbsp;&nbsp;>&nbsp;![icon-note.gif](public_sys-resources/icon-note.gif)&nbsp;**说明:**<br/>&nbsp;&nbsp;>&nbsp;默认值会依据系统当前所选地区和语言选择当地习惯的小时制(12小时制或24小时制)。<sup>5+</sup> |
| lunar<sup>5+</sup> | boolean | false | 否 | 设置日期时间选择器弹窗界面是否为农历展示。 |
| lunarswitch | boolean | false | 否 | 设置日期时间选择器是否显示农历开关,显示农历开关时,可以在弹窗界面展现农历的开关由于公历和农历切换。在设置显示农历时,开关状态为开,当设置不显示农历时,开关状态为关。手机生效。 |
| lunarswitch | boolean | false | 否 | 设置日期时间选择器是否显示农历开关,显示农历开关时,可以在弹窗界面展现农历的开关由于公历和农历切换。在设置显示农历时,开关状态为开,当设置不显示农历时,开关状态为关。 |
多列文本选择器:type=multi-text
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| -------- | ------- | --------- | ---- | ---------------------------------------- |
| columns | number | - | 是 | 设置多列文本选择器的列数。 |
| range | 二维Array | - | 否 | 设置多列文本选择器的选择值,该值为二维数组。长度表示多少列,数组的每项表示每列的数据,如&nbsp;&nbsp;[["a","b"],&nbsp;["c","d"]]。<br/>>&nbsp;![icon-note.gif](public_sys-resources/icon-note.gif)&nbsp;**说明:**<br/>>&nbsp;使用时需要使用数据绑定的方式,如range&nbsp;=&nbsp;{{data}},js中声明相应变量:data:[["a","b"],&nbsp;["c","d"]]。 |
| selected | Array | [0,0,0,…] | 否 | 设置多列文本选择器的默认值,每一列被选中项对应的索引构成的数组,该取值表示选择器弹窗时弹窗界面的默认选择值。 |
......@@ -69,7 +69,7 @@
除支持[通用样式](../arkui-js/js-components-common-styles.md)外,还支持如下样式:
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| -------------------------------- | -------------- | ---------- | ---- | ---------------------------------------- |
| color | &lt;color&gt | \#ffffff | 否 | 候选项字体颜色。 |
| font-size | &lt;length&gt; | 16px | 否 | 候选项字体尺寸,类型length,单位px。 |
| selected-color | &lt;color&gt; | #ff0a69f7 | 否 | 选中项字体颜色。 |
......@@ -86,31 +86,31 @@
type=text:
| 名称 | 参数 | 描述 |
| -------- | -------- | -------- |
| ------ | ---------------------------------------- | --------------- |
| change | {&nbsp;newValue:&nbsp;newValue,&nbsp;newSelected:&nbsp;newSelected&nbsp;} | 文本选择器选定值后触发该事件。 |
type=time:
| 名称 | 参数 | 描述 |
| -------- | -------- | -------- |
| ------ | ---------------------------------------- | ------------------------------- |
| change | {&nbsp;hour:&nbsp;hour,&nbsp;minute:&nbsp;minute,&nbsp;[second:second]} | 时间选择器选定值后触发该事件。<br/>包含秒时,返回时分秒。 |
type=date:
| 名称 | 参数 | 描述 |
| -------- | -------- | -------- |
| ------ | ---------------------------------------- | --------------- |
| change | {&nbsp;year:year,&nbsp;month:month,&nbsp;day:day&nbsp;} | 日期选择器选择值后触发该事件。 |
type=datetime:
| 名称 | 参数 | 描述 |
| -------- | -------- | -------- |
| ------ | ---------------------------------------- | ----------------- |
| change | {&nbsp;year:year,&nbsp;month:month,&nbsp;day:day,&nbsp;&nbsp;hour:hour,&nbsp;minute:minute&nbsp;} | 日期时间选择器选择值后触发该事件。 |
type=multi-text:
| 名称 | 参数 | 描述 |
| -------- | -------- | -------- |
| ------------ | ---------------------------------------- | ---------------------------------------- |
| columnchange | {&nbsp;column:column,&nbsp;newValue:newValue,&nbsp;newSelected:newSelected&nbsp;} | 多列文本选择器某一列的值改变时触发该事件,column:第几列修改,newValue:选中的值,newSelected:选中值对应的索引。 |
......
......@@ -21,7 +21,7 @@
除支持[通用属性](../arkui-js/js-components-common-attributes.md)外,还支持如下属性:↵
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| ---- | ------ | ---- | ---- | ---------------------------------------- |
| type | string | - | 否 | 该属性值不支持动态修改。可选择项有:<br/>-&nbsp;text:文本选择器。<br/>-&nbsp;date:日期选择器。<br/>-&nbsp;time:时间选择器。<br/>-&nbsp;datetime:日期时间选择器。<br/>-&nbsp;multi-text:多列文本选择器。 |
......@@ -30,7 +30,7 @@
滑动选择器类型设置为text时表示普通选择器。
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| -------- | ------ | ---- | ---- | ---------------------------------------- |
| range | Array | - | 否 | 设置普通选择器的取值范围,如["15",&nbsp;"20",&nbsp;"25"]。<br/>>&nbsp;![icon-note.gif](public_sys-resources/icon-note.gif)&nbsp;**说明:**<br/>>&nbsp;使用时需要使用数据绑定的方式,如range&nbsp;=&nbsp;{{data}},js中声明相应变量:data:["15",&nbsp;"20",&nbsp;"25"]。 |
| selected | string | 0 | 否 | 设置普通选择器弹窗的默认取值,取值需要是&nbsp;range&nbsp;的索引值,该取值表示选择器弹窗界面的默认选择值。 |
| value | string | - | 否 | 设置普通选择器的值。 |
......@@ -41,13 +41,13 @@
滑动选择器类型设置为date时表示日期选择器。
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| ------------------ | ------------ | ---------- | ---- | ---------------------------------------- |
| start | &lt;time&gt; | 1970-1-1 | 否 | 设置日期选择器的起始时间,格式为&nbsp;YYYY-MM-DD。 |
| end | &lt;time&gt; | 2100-12-31 | 否 | 设置日期选择器的结束时间,格式为&nbsp;YYYY-MM-DD。 |
| selected | string | 当前日期 | 否 | 设置日期选择器弹窗的默认取值,格式为&nbsp;YYYY-MM-DD,该取值表示选择器弹窗界面的默认选择值。 |
| value | string | - | 是 | 设置日期选择器的值。 |
| lunar<sup>5+</sup> | boolean | false | 否 | 设置日期选择器弹窗界面是否为农历展示。 |
| lunarswitch | boolean | false | 否 | 设置日期选择器是否显示农历开关。当值为true时,显示农历开关,点击农历开关可切换公历和农历。当值为false时,不显示农历开关。<br/>>&nbsp;![icon-note.gif](public_sys-resources/icon-note.gif)&nbsp;**说明:**<br/>>&nbsp;仅手机和平板设备支持。&nbsp;当lunarswitch=true且lunar=true时,开关按钮处于被选中状态。 |
| lunarswitch | boolean | false | 否 | 设置日期选择器是否显示农历开关。当值为true时,显示农历开关,点击农历开关可切换公历和农历。当值为false时,不显示农历开关。<br/>>&nbsp;![icon-note.gif](public_sys-resources/icon-note.gif)&nbsp;**说明:**<br/>> 当lunarswitch=true且lunar=true时,开关按钮处于被选中状态。 |
### 时间选择器
......@@ -55,7 +55,7 @@
滑动选择器类型设置为time时表示时间选择器。
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| ------------- | ------- | ----------------------------------- | ---- | ---------------------------------------- |
| containsecond | boolean | false | 否 | 设置时间选择器是否包含秒。 |
| selected | string | 当前时间 | 否 | 设置时间选择器弹窗的默认取值,格式为&nbsp;HH:mm;当包含秒时,格式为HH:mm:ss,<br/>该取值表示选择器弹窗界面的默认选择值。 |
| value | string | - | 否 | 设置时间选择器的值。 |
......@@ -67,12 +67,12 @@
滑动选择器类型设置为datetime时表示日期时间选择器,日期的选择范围为本年的日月。
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| ------------------ | ------- | ----------------------------------- | ---- | ---------------------------------------- |
| selected | string | 当前日期时间 | 否 | 设置日期时间选择器弹窗的默认取值,有两种可选格式。<br/>-&nbsp;月日时分:MM-DD-HH-mm<br/>-&nbsp;年月日时分:YYYY-MM-DD-HH-mm<br/>不设置年时,默认使用当前年,该取值表示选择器弹窗界面的默认选择值。 |
| value | string | - | 是 | 设置日期时间选择器的值。 |
| hours | number | 24<sup>1-4</sup><br/>-<sup>5+</sup> | 否 | 设置日期时间选择器采用的时间格式,可选值:<br/>-&nbsp;12:按照12小时制显示,用上午和下午进行区分;<br/>-&nbsp;24:按照24小时制显示。<br/>&nbsp;&nbsp;>&nbsp;![icon-note.gif](public_sys-resources/icon-note.gif)&nbsp;**说明:**<br/>&nbsp;&nbsp;>&nbsp;默认值会依据系统当前所选地区和语言选择当地习惯的小时制(12小时制或24小时制)。<sup>5+</sup> |
| lunar<sup>5+</sup> | boolean | false | 否 | 设置日期时间选择器弹窗界面是否为农历展示。 |
| lunarswitch | boolean | false | 否 | 设置日期选择器是否显示农历开关。当值为true时,显示农历开关,点击农历开关可切换公历和农历。当值为false时,不显示农历开关。<br/>>&nbsp;![icon-note.gif](public_sys-resources/icon-note.gif)&nbsp;**说明:**<br/>>&nbsp;仅手机和平板设备支持。&nbsp;当lunarswitch=true且lunar=true时,开关按钮处于被选中状态。 |
| lunarswitch | boolean | false | 否 | 设置日期选择器是否显示农历开关。当值为true时,显示农历开关,点击农历开关可切换公历和农历。当值为false时,不显示农历开关。<br/>>&nbsp;![icon-note.gif](public_sys-resources/icon-note.gif)&nbsp;**说明:**<br/>>&nbsp;当lunarswitch=true且lunar=true时,开关按钮处于被选中状态。 |
### 多列文本选择器
......@@ -80,7 +80,7 @@
滑动选择器类型设置为multi-text时表示多列文本选择器。
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| -------- | ------- | --------- | ---- | ---------------------------------------- |
| columns | number | - | 是 | 设置多列文本选择器的列数。 |
| range | 二维Array | - | 否 | 设置多列文本选择器的选择项,其中range&nbsp;为二维数组。长度表示多少列,数组的每项表示每列的数据,如&nbsp;&nbsp;[["a","b"],&nbsp;["c","d"]]。<br/>>&nbsp;![icon-note.gif](public_sys-resources/icon-note.gif)&nbsp;**说明:**<br/>>&nbsp;使用时需要使用数据绑定的方式,如range&nbsp;=&nbsp;{{data}},js中声明相应变量:data:[["a","b"],&nbsp;["c","d"]]。 |
| selected | Array | [0,0,0,…] | 否 | 设置多列文本选择器弹窗的默认值,每一列被选中项对应的索引构成的数组,该取值表示选择器弹窗界面的默认选择值。 |
......@@ -92,7 +92,7 @@
除支持[通用样式](../arkui-js/js-components-common-styles.md)外,还支持如下样式:
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| -------------------------- | -------------------------- | ---------- | ---- | ---------------------------------------- |
| text-color | &lt;color&gt; | - | 否 | 选择器的文本颜色。 |
| font-size | &lt;length&gt; | - | 否 | 选择器的文本尺寸。 |
| allow-scale | boolean | true | 否 | 选择器的文本尺寸是否跟随系统设置字体缩放尺寸进行放大缩小。<br/>>&nbsp;![icon-note.gif](public_sys-resources/icon-note.gif)&nbsp;**说明:**<br/>>&nbsp;如果在config描述文件中针对ability配置了fontSize的config-changes标签,则应用不会重启而直接生效。 |
......@@ -113,7 +113,7 @@
### 普通选择器
| 名称 | 参数 | 描述 |
| -------- | -------- | -------- |
| ------ | ---------------------------------------- | ---------------------------------------- |
| change | {&nbsp;newValue:&nbsp;newValue,&nbsp;newSelected:&nbsp;newSelected&nbsp;} | 普通选择器选择值后点击弹窗中的确定按钮时触发该事件(newSelected为索引)。 |
| cancel | - | 用户点击弹窗中的取消按钮时触发该事件。 |
......@@ -121,7 +121,7 @@
### 日期选择器
| 名称 | 参数 | 描述 |
| -------- | -------- | -------- |
| ------ | ---------------------------------------- | ---------------------------------------- |
| change | {&nbsp;year:&nbsp;year,&nbsp;month:&nbsp;month,&nbsp;day:&nbsp;day&nbsp;} | 日期选择器选择值后点击弹窗中的确认按钮时触发该事件。<br/>>&nbsp;![icon-note.gif](public_sys-resources/icon-note.gif)&nbsp;**说明:**<br/>>&nbsp;month值范围为:&nbsp;0(1月)~11(12月)。<sup>5+</sup> |
| cancel | - | 用户点击弹窗中的取消按钮时触发该事件。 |
......@@ -129,7 +129,7 @@
### 日期时间选择器
| 名称 | 参数 | 描述 |
| -------- | -------- | -------- |
| ------ | ---------------------------------------- | ---------------------------- |
| change | {&nbsp;year:&nbsp;year,&nbsp;month:&nbsp;month,&nbsp;day:&nbsp;day,&nbsp;&nbsp;hour:&nbsp;hour,&nbsp;minute:&nbsp;minute} | 日期时间选择器选择值后点击弹窗中的确认按钮时触发该事件。 |
| cancel | - | 用户点击弹窗中的取消按钮时触发该事件。 |
......@@ -137,7 +137,7 @@
### 时间选择器
| 名称 | 参数 | 描述 |
| -------- | -------- | -------- |
| ------ | ---------------------------------------- | ---------------------------------------- |
| change | {&nbsp;hour:&nbsp;hour,&nbsp;minute:&nbsp;minute,&nbsp;[second:&nbsp;second]&nbsp;} | 时间选择器选择值后点击弹窗中的确认按钮时触发该事件,当使用时分秒时,还包含秒数据。 |
| cancel | - | 用户点击弹窗中的取消按钮时触发该事件。 |
......@@ -145,7 +145,7 @@
### 多列文本选择器
| 名称 | 参数 | 描述 |
| -------- | -------- | -------- |
| ------------ | ---------------------------------------- | ---------------------------------------- |
| change | {&nbsp;newValue:&nbsp;[newValue1,&nbsp;newValue2,&nbsp;newValue3,&nbsp;…],&nbsp;newSelected:[newSelected1,&nbsp;newSelected2,&nbsp;newSelected3,&nbsp;…]&nbsp;} | 多列文本选择器选择值后点击弹窗中的确认按钮时触发该事件,其中:<br/>-&nbsp;newValue:被选中项对应的值构成的数组。<br/>-&nbsp;newSelected:被选中项对应的索引构成的数组,两者的长度和range的长度一致。 |
| columnchange | {&nbsp;column:&nbsp;column,&nbsp;newValue:&nbsp;newValue,&nbsp;newSelected:&nbsp;newSelected&nbsp;} | 多列文本选择器中某一列的值改变时触发该事件,其中:<br/>-&nbsp;column:第几列修改。<br/>-&nbsp;newValue:选中的值。<br/>-&nbsp;newSelected:选中值对应的索引。 |
| cancel | - | 用户点击弹窗中的取消按钮时触发该事件。 |
......@@ -156,7 +156,7 @@
除支持[通用方法](../arkui-js/js-components-common-methods.md)外,支持如下方法:
| 名称 | 参数 | 描述 |
| -------- | -------- | -------- |
| ---- | ---- | --------------- |
| show | - | 显示&nbsp;picker。 |
......
......@@ -7,7 +7,7 @@
| 名称 | 类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- |
| ---------------------------------------- | ---------------------------------------- | ------------ | ---------------------------------------- |
| width | &lt;length&gt;&nbsp;\|&nbsp;&lt;percentage&gt; | - | 设置组件自身的宽度。<br/>缺省时使用元素自身内容需要的宽度。<br/> |
| height | &lt;length&gt;&nbsp;\|&nbsp;&lt;percentage&gt; | - | 设置组件自身的高度。<br/>缺省时使用元素自身内容需要的高度。<br/> |
| min-width<sup>5+</sup> | &lt;length&gt;&nbsp;\|&nbsp;&lt;percentage&gt;<sup>6+</sup> | 0 | 设置元素的最小宽度。 |
......@@ -39,7 +39,7 @@
| box-shadow<sup>5+</sup> | string | 0 | 语法:box-shadow:&nbsp;h-shadow&nbsp;v-shadow&nbsp;blur&nbsp;spread&nbsp;color<br/>通过这个样式可以设置当前组件的阴影样式,包括水平位置(必填)、垂直位置(必填)、模糊半径(可选,默认值为0)、阴影延展距离(可选,默认值为0)、阴影颜色(可选,默认值为黑色)。<br/>示例:<br/>-&nbsp;box-shadow&nbsp;:10px&nbsp;20px&nbsp;5px&nbsp;10px&nbsp;\#888888<br/>-&nbsp;box-shadow&nbsp;:100px&nbsp;100px&nbsp;30px&nbsp;red<br/>-&nbsp;box-shadow&nbsp;:-100px&nbsp;-100px&nbsp;0px&nbsp;40px |
| filter<sup>5+</sup> | string | - | 语法:filter:&nbsp;blur(px)<br/>通过这个样式可以设置当前组件布局范围的内容模糊,参数用于指定模糊半径,如果没有设置值,则默认是0(不模糊),不支持百分比。<br/>示例:<br/>-&nbsp;filter:&nbsp;blur(10px) |
| backdrop-filter<sup>5+</sup> | string | - | 语法:backdrop-filter:&nbsp;blur(px)<br/>通过这个样式可以设置当前组件布局范围的背景模糊,参数用于指定模糊半径,如果没有设置值,则默认是0(不模糊),不支持百分比。<br/>示例:<br/>-&nbsp;backdrop-filter:&nbsp;blur(10px) |
| window-filter<sup>5+</sup> | string | - | 语法:window-filter:&nbsp;blur(percent),&nbsp;style<sup>5+</sup><br/>通过这个样式可以设置当前组件布局范围的窗口模糊程度和模糊样式,如果没有设置值,则默认是0%(不模糊),多块模糊区域时不支持设置不同的模糊值和模糊样式。style可选值:small_light(默认值),&nbsp;medium_light,&nbsp;large_light,&nbsp;xlarge_light,&nbsp;small_dark,&nbsp;medium_dark,&nbsp;large_dark,&nbsp;xlarge_dark。<br/>示例:<br/>-&nbsp;window-filter:&nbsp;blur(50%)<br/>-&nbsp;window-filter:&nbsp;blur(10%),&nbsp;large_light<br/>>&nbsp;![icon-note.gif](public_sys-resources/icon-note.gif)&nbsp;**说明:**<br/>>&nbsp;仅手机和平板设备支持。 |
| window-filter<sup>5+</sup> | string | - | 语法:window-filter:&nbsp;blur(percent),&nbsp;style<sup>5+</sup><br/>通过这个样式可以设置当前组件布局范围的窗口模糊程度和模糊样式,如果没有设置值,则默认是0%(不模糊),多块模糊区域时不支持设置不同的模糊值和模糊样式。style可选值:small_light(默认值),&nbsp;medium_light,&nbsp;large_light,&nbsp;xlarge_light,&nbsp;small_dark,&nbsp;medium_dark,&nbsp;large_dark,&nbsp;xlarge_dark。<br/>示例:<br/>-&nbsp;window-filter:&nbsp;blur(50%)<br/>-&nbsp;window-filter:&nbsp;blur(10%),&nbsp;large_light |
| opacity | number | 1 | 元素的透明度,取值范围为0到1,1表示为不透明,0表示为完全透明。 |
| display | string | flex | 确定一个元素所产生的框的类型,可选值为:<br/>-&nbsp;flex:弹性布局。<br/>-&nbsp;none:不渲染此元素。 |
| visibility | string | visible | 是否显示元素所产生的框。不可见的框会占用布局(将'display'属性设置为'none'来完全去除框),可选值为:<br/>-&nbsp;visible:元素正常显示。<br/>-&nbsp;hidden:隐藏元素,但是其他元素的布局不改变,相当于此元素变成透明。<br/>>&nbsp;![icon-note.gif](public_sys-resources/icon-note.gif)&nbsp;**说明:**<br/>>&nbsp;visibility和display样式都设置时,仅display生效。 |
......
......@@ -25,7 +25,7 @@
除支持[通用属性](../arkui-js/js-components-common-attributes.md)外,还支持如下属性:
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| ---- | ------ | ------- | ---- | ---------------------------------------- |
| type | string | default | 否 | list-item-group类型,同一list支持多种type的list-item-group,相同type的list-item-group需要确保渲染后的视图布局也完全相同,当type固定时,使用show属性代替if属性,确保视图布局不变。 |
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
......@@ -38,7 +38,7 @@
除支持[通用样式](../arkui-js/js-components-common-styles.md)外,还支持如下样式:
| 名称 | 类型 | 默认值 | 必填 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| --------------- | ------ | ---------- | ---- | ---------------------------------------- |
| flex-direction | string | row | 否 | flex容器主轴方向。可选项有:<br/>-&nbsp;column:垂直方向从上到下<br/>-&nbsp;row:水平方向从左到右 |
| justify-content | string | flex-start | 否 | flex容器当前行的主轴对齐格式。可选项有:<br/>-&nbsp;flex-start:项目位于容器的开头。<br/>-&nbsp;flex-end:项目位于容器的结尾。<br/>-&nbsp;center:项目位于容器的中心。<br/>-&nbsp;space-between:项目位于各行之间留有空白的容器内。<br/>-&nbsp;space-around:项目位于各行之前、之间、之后都留有空白的容器内。<br/>-&nbsp;space-evenly<sup>5+</sup>:&nbsp;&nbsp;均匀排列每个元素,每个元素之间的间隔相等。 |
......@@ -48,7 +48,7 @@
除支持[通用事件](../arkui-js/js-components-common-events.md)外,还支持如下事件:
| 名称 | 参数 | 描述 |
| -------- | -------- | -------- |
| ------------- | ---------------------------------- | ---------------------------------------- |
| groupclick | {&nbsp;groupid:&nbsp;string&nbsp;} | group点击事件。<br/>groupid:被点击的group的id。 |
| groupcollapse | {&nbsp;groupid:&nbsp;string&nbsp;} | group收拢事件。<br/>groupid:收拢的group的id。<br/>当不输入参数或者groupid为空时收拢所有分组。 |
| groupexpand | {&nbsp;groupid:&nbsp;string&nbsp;} | group展开事件。<br/>groupid:展开的group的id。<br/>当不输入参数或者groupid为空时展开所有分组。 |
......
......@@ -19,7 +19,7 @@
表1 options参数说明
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| ---------- | ------------------------------- | ---- | ------ | -------------- |
| ---------- | ------------------------------- | ---- | ---- | ------- |
| src | string | 是 | - | 网页资源地址。 |
| controller | [WebController](#webcontroller) | 否 | - | 控制器。 |
......@@ -32,7 +32,7 @@
## 属性
| 名称 | 参数类型 | 默认值 | 描述 |
| ----------------- | ------------------------------------------------------------ | -------------- | ------------------------------------------------------------ |
| ----------------- | ---------------------------------------- | -------------- | ---------------------------------------- |
| domStorageAccess | boolean | false | 设置是否开启文档对象模型存储接口(DOM Storage API)权限,默认未开启。 |
| fileAccess | boolean | true | 设置是否开启通过[$rawfile(filepath/filename)](../../ui/ts-application-resource-access.md#资源引用)访问应用中rawfile路径的文件, 默认启用。 |
| imageAccess | boolean | true | 设置是否允许自动加载图片资源,默认允许。 |
......@@ -48,7 +48,7 @@
- <span id="MixedMode">MixedMode枚举说明</span>
| 名称 | 描述 |
| ---------- | ----------------------------------------------------------- |
| ---------- | ---------------------------------- |
| All | 允许加载HTTP和HTTPS混合内容。所有不安全的内容都可以被加载。 |
| Compatible | 混合内容兼容性模式,部分不安全的内容可能被加载。 |
| None | 不允许加载HTTP和HTTPS混合内容。 |
......@@ -58,7 +58,7 @@
不支持通用事件。
| 名称 | 功能描述 |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
| ---------------------------------------- | ---------------------------------------- |
| onAlert(callback: (event?: { url: string; message: string; result: [JsResult](#jsresult对象说明) }) => boolean) | <p>网页触发alert()告警弹窗时触发回调。<br />当回调返回false时,触发默认弹窗。当回调返回true时,系统应用可以调用系统弹窗能力(只有确认场景),并且根据用户的确认操作调用JsResult通知Web组件。<br />url:当前显示弹窗所在网页的URL。<br />message:弹窗中显示的信息。<br />JsResult:通知Web组件用户操作行为。</p> |
| onBeforeUnload(callback: (event?: { url: string; message: string; result: [JsResult](#jsresult对象说明) }) => boolean) | <p>刷新或关闭场景下,在即将离开当前页面时触发此回调。<br />当回调返回false时,触发默认弹窗。当回调返回true时,系统应用可以调用系统弹窗能力(包括确认和取消),并且需要根据用户的确认或取消操作调用JsResult通知Web组件最终是否离开当前页面。<br />url:当前显示弹窗所在网页的URL。<br />message:弹窗中显示的信息。<br />JsResult:通知Web组件用户操作行为。</p> |
| onConfirm(callback: (event?: { url: string; message: string; result: [JsResult](#jsresult对象说明) }) => boolean) | <p>网页调用confirm()告警时触发此回调。<br />当回调返回false时,触发默认弹窗。当回调返回true时,系统应用可以调用系统弹窗能力(包括确认和取消),并且需要根据用户的确认或取消操作调用JsResult通知Web组件。<br />url:当前显示弹窗所在网页的URL。<br />message:弹窗中显示的信息。<br />JsResult:通知Web组件用户操作行为。</p> |
......@@ -76,7 +76,7 @@
- 接口
| 接口名称 | 功能描述 |
| ------------------------------- | ------------------------------ |
| ------------------------------- | ---------------------- |
| getLineNumber(): number | 获取ConsoleMessage的行数。 |
| getMessage(): string | 获取ConsoleMessage的日志信息。 |
| getMessageLevel(): MessageLevel | 获取ConsoleMessage的信息级别。 |
......@@ -99,7 +99,7 @@ Web组件返回的弹窗确认或弹窗取消功能对象。
- 接口
| 接口名称 | 功能描述 |
| --------------------- | ------------------------------------ |
| --------------------- | ----------------------- |
| handleCancel(): void | <p>通知Web组件用户取消弹窗操作。</p> |
| handleConfirm(): void | <p>通知Web组件用户确认弹窗操作。</p> |
......@@ -117,7 +117,7 @@ Web组件返回的弹窗确认或弹窗取消功能对象。
- 接口
| 接口名称 | 功能描述 |
| ------------------------------------------------------ | ---------------------------------------- |
| ---------------------------------------- | -------------------- |
| getRequestHeader(): Array\<[Header](#header对象说明)\> | 获取资源请求头信息。 |
| getRequestUrl(): string | 获取资源请求的URL信息。 |
| isMainFrame(): boolean | 判断资源请求是否为主frame。 |
......@@ -130,10 +130,10 @@ Web组件返回的请求/响应头对象。
- 参数
| 参数名称 | 参数类型 |参数描述 |
| ----------- | ----------- |---------------------- |
| headerKey | string |请求/响应头的key。 |
| headerValue | string |请求/响应头的value。|
| 参数名称 | 参数类型 | 参数描述 |
| ----------- | ------ | ------------- |
| headerKey | string | 请求/响应头的key。 |
| headerValue | string | 请求/响应头的value。 |
### WebResourceResponse对象说明
......@@ -141,7 +141,7 @@ Web组件返回的请求/响应头对象。
- 接口
| 接口名称 | 功能描述 |
| ------------------------------------ | -------------------------------- |
| ---------------------------------------- | ------------------ |
| getReasonMessage(): string | 获取资源响应的状态码描述。 |
| getResponseCode(): number | 获取资源响应的状态码。 |
| getResponseData(): string | 获取资源响应数据。 |
......@@ -186,7 +186,7 @@ accessStep(step: number): boolean
- 返回值
| 参数类型 | 说明 |
| ---- | ------ |
| ------- | --------- |
| boolean | 页面是否前进或后退 |
### backward
......@@ -204,7 +204,7 @@ deleteJavaScriptRegister(name: string): void
- 参数
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| ------ | -------- | ---- | ------ | ------------------------------------------------------------ |
| ---- | ------ | ---- | ---- | ---------------------------------------- |
| name | string | 是 | - | 注册对象的名称,可在网页侧JavaScript中通过此名称调用应用侧JavaScript对象。 |
### forward
......@@ -222,14 +222,14 @@ getHitTest(): HitTestType
- HitTestType枚举说明
| 名称 | 描述 |
| ------------- | ----------------------------------------- |
| ------------- | ------------------------ |
| EditText | 可编辑的区域。 |
| Email | 电子邮件地址。 |
| HttpAnchor | 超链接。其src为http。 |
| HttpAnchorImg | 带有超链接的图片,其中超链接的src为http。 |
| Img | HTML::img标签。 |
| Map | 地理地址。 |
| Phone | 电话号码。 |
| Phonenumber | 电话号码。 |
| Unknown | 未知内容。 |
### loadData
......@@ -245,7 +245,7 @@ baseUrl为空时,通过”data“协议加载指定的一段字符串。
- options参数说明
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| ---------- | -------- | ---- | ------ | ------------------------------------------------------------ |
| ---------- | ------ | ---- | ---- | ---------------------------------------- |
| data | string | 是 | - | 按照”Base64“或者”URL"编码后的一段字符串。 |
| mimeType | string | 是 | - | 媒体类型(MIME)。 |
| encoding | string | 是 | - | 编码类型,具体为“Base64"或者”URL编码。 |
......@@ -265,7 +265,7 @@ loadUrl(options:{ url: string, headers?: Array\<Header\> }): void
- options参数说明
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| ------- | ------------------------------------- | ---- | ------ | --------------------- |
| ------- | ------------------------------ | ---- | ---- | -------------- |
| url | string | 是 | - | 需要加载的 URL。 |
| headers | Array\<[Header](#header对象说明)\> | 否 | [] | URL的附加HTTP请求头。 |
......@@ -296,7 +296,7 @@ registerJavaScriptProxy(options: { object: object, name: string, methodList: Arr
- options 参数说明
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| ---------- | --------------- | ---- | ------ | ------------------------------------------------------------ |
| ---------- | --------------- | ---- | ---- | ---------------------------------------- |
| object | object | 是 | - | 参与注册的应用侧JavaScript对象。只能声明方法,不能声明属性 。其中方法的参数和返回类型只能为string,number,boolean |
| name | string | 是 | - | 注册对象的名称,与window中调用的对象名一致。注册后window对象可以通过此名字访问应用侧JavaScript对象。 |
| methodList | Array\<string\> | 是 | - | 参与注册的应用侧JavaScript对象的方法。 |
......@@ -310,7 +310,7 @@ runJavaScript(options: { script: string, callback?: (result: string) => void }):
- options参数说明
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | ------------------------ | ---- | ------ | ------------------------------------------------------------ |
| -------- | ------------------------ | ---- | ---- | ---------------------------------------- |
| script | string | 是 | - | JavaScript脚本。 |
| callback | (result: string) => void | 否 | - | 回调执行JavaScript脚本结果。JavaScript脚本若执行失败或无返回值时,返回null。 |
......
......@@ -262,8 +262,8 @@ tid属性主要用来加速for循环的重渲染,旨在列表中的数据有
<div class="container">
<button class="btn" type="capsule" value="toggleShow" onclick="toggleShow"></button>
<button class="btn" type="capsule" value="toggleDisplay" onclick="toggleDisplay"></button>
<text if="{{visible}}"> Hello-TV </text>
<text elif="{{display}}"> Hello-Wearable </text>
<text if="{{visible}}"> Hello-world1 </text>
<text elif="{{display}}"> Hello-world2 </text>
<text else> Hello-World </text>
</div>
```
......
......@@ -11,7 +11,7 @@
```
// Display only Hello Component1 on the PC preview. The content under MyComponent is displayed on the real device.
// Display only Hello Component1 on the preview. The content under MyComponent is displayed on the real device.
@Entry
@Component
struct MyComponent {
......
......@@ -101,9 +101,8 @@ export default {
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> - 智能穿戴仅支Input类型设置为button、radio、checkbox。
>
> - 仅当Input类型为checkbox和radio时,当前组件是否选中的属性checked才生效,默认值为false。
> 仅当Input类型为checkbox和radio时,当前组件是否选中的属性checked才生效,默认值为false。
## 事件绑定
......
......@@ -214,7 +214,7 @@ export default {
<div class="container">
<div class="in-container">
<text class="name">{{$item.name}}</text>
<text class="phone">18888888888</text>
<text class="number">18888888888</text>
</div>
</div>
</list-item>
......@@ -247,7 +247,7 @@ export default {
color: #000000;
font-size: 39px;
}
.phone {
.number {
color: black;
font-size: 25px;
}
......
......@@ -70,9 +70,8 @@ export default {
![zh-cn_image_0000001189098638](figures/zh-cn_image_0000001189098638.gif)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> - 普通选择器设置取值范围时,需要使用数据绑定的方式。
>
> - 日期选择器的lunarswitch属性只支持手机和平板设备
> 普通选择器设置取值范围时,需要使用数据绑定的方式
## 设置时间展现格式
......
......@@ -91,7 +91,7 @@ Slider组件通过color、selected-color、block-color样式分别为滑动条
![zh-cn_image_0000001179438692](figures/zh-cn_image_0000001179438692.gif)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> mode属性为滑动条样式,仅在手机和平板上生效,可选值为:
> mode属性为滑动条样式,可选值为:
>
> - outset:滑块在滑杆上;
>
......
......@@ -10,7 +10,7 @@ Text是文本组件,用于呈现一段文本信息。具体用法请参考[Tex
```
<!-- xxx.hml -->
<div class="container" style="text-align: center;justify-content: center; align-items: center;">
<text> Hello World </text>
<text>Hello World</text>
</div>
```
......@@ -33,42 +33,41 @@ Text是文本组件,用于呈现一段文本信息。具体用法请参考[Tex
- 添加文本样式
设置color、font-size、allow-scale、word-spacing、text-valign属性分别为文本添加颜色、大小、缩放、文本之间的间距和文本在垂直方向的对齐方式。
```
<!-- xxx.hml -->
<div class="container" style="background-color:#F1F3F5;flex-direction: column;justify-content: center; align-items: center;">
```
<!-- xxx.hml -->
<div class="container" style="background-color:#F1F3F5;flex-direction: column;justify-content: center; align-items: center;">
<text style="color: blueviolet; font-size: 40px; allow-scale:true">
This is a passage
</text>
<text style="color: blueviolet; font-size: 40px; margin-top: 20px; allow-scale:true;word-spacing: 20px;" >
This is a passage
</text>
</div>
```
</div>
```
```
/* xxx.css */
.container {
```
/* xxx.css */
.container {
width: 100%;
height: 100%;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #F1F3F5;
}
```
}
```
![zh-cn_image_0000001220778205](figures/zh-cn_image_0000001220778205.png)
- 添加划线
​ 设置text-decoration和text-decoration-colo属性为文本添加划线和划线颜色,text-decoration枚举值请参考 Text自有样式。
- 添加划线
设置text-decoration和text-decoration-colo属性为文本添加划线和划线颜色,text-decoration枚举值请参考 Text自有样式。
```
<!-- xxx.hml -->
<div class="container" style="background-color:#F1F3F5;">
<text style="text-decoration:underline">
......@@ -78,36 +77,40 @@ Text是文本组件,用于呈现一段文本信息。具体用法请参考[Tex
This is a passage
</text>
</div>
```
/* xxx.css */
.container {
```
```
/* xxx.css */
.container {
width: 100%;
height: 100%;
flex-direction: column;
align-items: center;
justify-content: center;
}
text{
}
text{
font-size: 50px;
}
```
}
```
![zh-cn_image_0000001220856725](figures/zh-cn_image_0000001220856725.png)
- 隐藏文本内容
当文本内容过多而显示不全时,添加text-overflow属性将隐藏内容以省略号的形式展现
当文本内容过多而显示不全时,添加text-overflow属性将隐藏内容以省略号的形式展现
```
<!-- xxx.hml -->
<div class="container">
```
<!-- xxx.hml -->
<div class="container">
<text class="text">
This is a passage
</text>
</div>
```
</div>
```
```
/* xxx.css */
.container {
width: 100%;
......@@ -122,23 +125,22 @@ text{
max-lines: 1;
text-overflow:ellipsis;
}
```
**说明:**
- text-overflow样式需要与max-lines样式配套使用,设置了最大行数的情况下生效。
- max-lines属性设置文本最多可以展示的行数。
> **说明:**
> - text-overflow样式需要与max-lines样式配套使用,设置了最大行数的情况下生效。
> - max-lines属性设置文本最多可以展示的行数。
​ ![zh-cn_image_0000001163656706](figures/zh-cn_image_0000001163656706.png)
​ ![zh-cn_image_0000001163656706](figures/zh-cn_image_0000001163656706.png)
- 设置文本折行
设置word-break属性对文本内容做断行处理,word-break枚举值请参考Text自有样式。
设置word-break属性对文本内容做断行处理,word-break枚举值请参考Text自有样式。
```
<!-- xxx.hml -->
<div class="container">
```
<!-- xxx.hml -->
<div class="container">
<div class="content">
<text class="text1">
Welcome to the world
......@@ -147,10 +149,10 @@ text{
Welcome to the world
</text>
</div>
</div
```
</div>
```
```
/* xxx.css */
.container {
background-color: #F1F3F5;
......@@ -179,14 +181,13 @@ text{
word-break: break-all;
font-size: 40px;
}
```
​ ![zh-cn_image_0000001209033195](figures/zh-cn_image_0000001209033195.png)
​ ![zh-cn_image_0000001209033195](figures/zh-cn_image_0000001209033195.png)
- Text组件支持[Span](../reference/arkui-js/js-components-basic-span.md)子组件
```
<!-- xxx.hml -->
<div class="container" style="justify-content: center; align-items: center;flex-direction: column;background-color: #F1F3F5; width: 100%;height: 100%;">
......@@ -202,10 +203,7 @@ text{
</div>
```
![zh-cn_image_0000001163372568](figures/zh-cn_image_0000001163372568.png)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> - 当使用Span子组件组成文本段落时,如果Span属性样式异常(例如:font-weight设置为1000),将导致文本段落显示异常。
>
......
......@@ -47,7 +47,7 @@
}
```
3. 存入食物图片资源。在resources &gt; phone &gt; media目录下存入食物图片资源,图片名称为食物名称。
3. 存入食物图片资源。在resources &gt;base&gt; media目录下存入食物图片资源,图片名称为食物名称。
4. 创建食物资源数据。在model文件夹下创建FoodDataModels.ets,在该页面中声明食物成分数组FoodComposition。
实际开发中,开发者可以自定义更多的数据资源,当食物资源很多时,建议使用数据懒加载LazyForEach。
......
......@@ -14,12 +14,12 @@
![zh-cn_image_0000001168059158](figures/zh-cn_image_0000001168059158.png)
4. 进入配置工程界面,将工程名字改为HealthyDiet,Project Type选择Application,Compile API选择8,UI Syntax选择eTS。DevEco Studio会默认将工程保存在C盘,如果要更改工程保存位置,点击Save Location的文件夹图标,自行指定工程创建位置。配置完成后点击Finish。
3. 进入配置工程界面,将工程名字改为HealthyDiet,Project Type选择Application,Compile API选择8,UI Syntax选择eTS。DevEco Studio会默认将工程保存在C盘,如果要更改工程保存位置,点击Save Location的文件夹图标,自行指定工程创建位置。配置完成后点击Finish。
![zh-cn_image_0000001167746622](figures/zh-cn_image_0000001167746622.png)
5. 工程创建完成后,打开app.ets。
4. 工程创建完成后,打开app.ets。
app.ets提供了应用生命周期的接口:onCreate和onDestroy,分别在应用创建之初和应用被销毁时调用。在app.ets里可以声明全局变量,并且声明的数据和方法是整个应用共享的。
```
......@@ -33,7 +33,7 @@
}
```
6. 在工程导航栏里,打开index.ets。该页面展示了当前的UI描述,声明式UI框架会自动生成一个组件化的struct,这个struct遵循Builder接口声明,在build方法里面声明当前的布局和组件。
5. 在工程导航栏里,打开index.ets。该页面展示了当前的UI描述,声明式UI框架会自动生成一个组件化的struct,这个struct遵循Builder接口声明,在build方法里面声明当前的布局和组件。
```
@Entry
@Component
......@@ -50,14 +50,16 @@
}
```
7. 点击右侧的Previewer按钮,打开预览窗口。可以看到在手机设备类型的预览窗口中“Hello World”居中加粗显示。
6. 点击右侧的Previewer按钮,打开预览窗口。可以看到预览窗口中“Hello World”居中加粗显示。
如果没有Previewer按钮,点击settings &gt; SDK Manager &gt; OpenHarmony SDK&gt; Tools 查看是否安装了Previewer。
![zh-cn_image_0000001214595111](figures/zh-cn_image_0000001214595111.png)
8. 应用安装到手机上运行应用。将手机连接电脑,等IDE识别到物理设备后,点击Run 'entry'按钮。
7. 应用安装到设备上运行应用。
将设备连接电脑,等IDE识别到物理设备后,点击Run 'entry'按钮。
![zh-cn_image_0000001148858818](figures/zh-cn_image_0000001148858818.png)
在安装之前,需要[配置应用签名](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ohos-debugging-and-running-0000001263040487#section17660437768)。安装成功后,点击屏幕上的Run图标打开应用,可以看到居中加粗显示的“Hello World”。
在安装之前,需要配置应用签名。安装成功后,点击屏幕上的Run图标打开应用,可以看到居中加粗显示的“Hello World”。
![zh-cn_image_0000001158896538](figures/zh-cn_image_0000001158896538.png)
......@@ -43,15 +43,9 @@
![zh-cn_image_0000001168410342](figures/zh-cn_image_0000001168410342.png)
3. 通过资源访问图片。
除指定图片路径外,也可以使用引用媒体资源符$r引用资源,需要遵循resources文件夹的资源限定词的规则。右键resources文件夹,点击New&gt;Resource Directory,选择Resource Type为Media(图片资源),选择资源限定词为Device-Phone(目前开发设备为手机)
除指定图片路径外,也可以使用引用媒体资源符$r引用资源,需要遵循resources文件夹的资源限定词的规则。右键resources文件夹,点击New&gt;Resource Directory,选择Resource Type为Media(图片资源)。
![zh-cn_image_0000001168570318](figures/zh-cn_image_0000001168570318.png)
点击OK后,resources文件夹下生成phone文件夹,phone文件夹下生成media文件夹,将Tomato.png放入media文件夹内。
![zh-cn_image_0000001214330169](figures/zh-cn_image_0000001214330169.png)
就可以通过`$r('app.type.name')`的形式引用应用资源,即`$r('app.media.Tomato')`
将Tomato.png放入media文件夹内。就可以通过`$r('app.type.name')`的形式引用应用资源,即`$r('app.media.Tomato')`
```
@Entry
......
......@@ -69,7 +69,7 @@
![zh-cn_image_0000001169918548](figures/zh-cn_image_0000001169918548.gif)
3. 在FoodDetail页面增加回到食物列表页面的图标。在resources &gt; phone &gt; media文件夹下存入回退图标Back.png。新建自定义组件PageTitle,包含后退的图标和Food Detail的文本,调用路由的router.back()接口,弹出路由栈最上面的页面,即返回上一级页面。
3. 在FoodDetail页面增加回到食物列表页面的图标。在resources &gt; base &gt; media文件夹下存入回退图标Back.png。新建自定义组件PageTitle,包含后退的图标和Food Detail的文本,调用路由的router.back()接口,弹出路由栈最上面的页面,即返回上一级页面。
```
// FoodDetail.ets
import router from '@system.router'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册