diff --git a/docker/LICENSE b/docker/LICENSE deleted file mode 100755 index 261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64..0000000000000000000000000000000000000000 --- a/docker/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/docker/build.sh b/docker/build.sh deleted file mode 100755 index e1a7618251929cd060b0e33c4763e4bb5e5f9057..0000000000000000000000000000000000000000 --- a/docker/build.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2020 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -docker build -t openharmony-docker:1.0.0 . diff --git a/en/application-dev/ability/figures/page-ability-lifecycle.png b/en/application-dev/ability/figures/page-ability-lifecycle.png index edb49acd0647f3af7355ceda987c5ca812866128..b35954967bb9c733725da2f0700481932619ae45 100644 Binary files a/en/application-dev/ability/figures/page-ability-lifecycle.png and b/en/application-dev/ability/figures/page-ability-lifecycle.png differ diff --git a/en/application-dev/ability/stage-serviceextension.md b/en/application-dev/ability/stage-serviceextension.md index 0bda2156cdaa3b79c694f399453208ed9a0d13cf..5154a97d6a65bc787596f54466e7983a60a8bb11 100644 --- a/en/application-dev/ability/stage-serviceextension.md +++ b/en/application-dev/ability/stage-serviceextension.md @@ -39,33 +39,36 @@ OpenHarmony does not support creation of a Service Extension ability for third-p ``` -2. Customize a class that inherits from **ServiceExtensionAbility** in the .ts file in the directory where the Service Extension ability is defined and override the lifecycle callbacks of the base class. The code sample is as follows: +2. Customize a class that inherits from **ServiceExtensionAbility** in the .ts file in the directory where the Service Extension ability is defined (**entry\src\main\ets\ServiceExtAbility\ServiceExtAbility.ts** by default) and override the lifecycle callbacks of the base class. The code sample is as follows: ```js + import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' import rpc from '@ohos.rpc' + class StubTest extends rpc.RemoteObject { - constructor(des) { + constructor(des) { super(des); - } - onRemoteRequest(code, data, reply, option) { - } + } + onRemoteRequest(code, data, reply, option) { + } } - - class ServiceExt extends ServiceExtensionAbility { - console.log('onCreate, want:' + want.abilityName); - } - onRequest(want, startId) { - console.log('onRequest, want:' + want.abilityName); - } - onConnect(want) { - console.log('onConnect , want:' + want.abilityName); - return new StubTest("test"); - } - onDisconnect(want) { - console.log('onDisconnect, want:' + want.abilityName); - } - onDestroy() { - console.log('onDestroy'); - } + + class ServiceExtAbility extends ServiceExtensionAbility { + onCreate(want) { + console.log('onCreate, want:' + want.abilityName); + } + onRequest(want, startId) { + console.log('onRequest, want:' + want.abilityName); + } + onConnect(want) { + console.log('onConnect , want:' + want.abilityName); + return new StubTest("test"); + } + onDisconnect(want) { + console.log('onDisconnect, want:' + want.abilityName); + } + onDestroy() { + console.log('onDestroy'); + } } - ``` + ``` \ No newline at end of file diff --git a/en/application-dev/device/vibrator-guidelines.md b/en/application-dev/device/vibrator-guidelines.md index ab4c8234ba4147008ea9515d20e23506eddd3f13..4f49e7996188a7bc668e23fc2a21a1a29ec6e562 100644 --- a/en/application-dev/device/vibrator-guidelines.md +++ b/en/application-dev/device/vibrator-guidelines.md @@ -65,9 +65,9 @@ For details about the APIs, see [Vibrator](../reference/apis/js-apis-vibrator.md import vibrator from "@ohos.vibrator" vibrator.vibrate(1000).then((error) => { if (error) { // The call fails, and error.code and error.message are printed. - Console.log("Promise return failed.error.code " + error.code + "error.message " + error.message); + console.log("Promise return failed.error.code " + error.code + "error.message " + error.message); } else { // The call is successful, and the device starts to vibrate. - Console.log("Promise returned to indicate a successful vibration.") + console.log("Promise returned to indicate a successful vibration.") } }) ``` @@ -78,9 +78,9 @@ For details about the APIs, see [Vibrator](../reference/apis/js-apis-vibrator.md import vibrator from "@ohos.vibrator" vibrator.stop(vibrator.VibratorStopMode.VIBRATOR_STOP_MODE_PRESET).then((error) => { if (error) { // The call fails, and error.code and error.message are printed. - Console.log("Promise return failed.error.code " + error.code + "error.message " + error.message); + console.log("Promise return failed.error.code " + error.code + "error.message " + error.message); } else { // The call is successful, and the device stops vibrating. - Console.log("Promise returned to indicate a successful stop."); + console.log("Promise returned to indicate successful."); } }) ``` diff --git a/en/application-dev/media/image.md b/en/application-dev/media/image.md index a262b3e219970b107ee5debdbc1254907f9d3e22..5be7a47cf20f0269c670593bf412bee5dd92162f 100644 --- a/en/application-dev/media/image.md +++ b/en/application-dev/media/image.md @@ -267,7 +267,7 @@ imageSourceApi.getImageInfo(imageInfo => { }) // Update incremental data. -imageSourceIncrementalSApi.updateData(array, false, 0, 10,(error,data )=> {}) +imageSourceIncrementalSApi.updateData(array, false, 0, 10,(error, data)=> {}) ``` diff --git a/en/application-dev/reference/apis/js-apis-ability-context.md b/en/application-dev/reference/apis/js-apis-ability-context.md index 3b5d0bba1bb5954d3365d97cde619f5931c0f7a3..cd4e27214b3617970071bcfb8e4e5b1c76bc2a2c 100644 --- a/en/application-dev/reference/apis/js-apis-ability-context.md +++ b/en/application-dev/reference/apis/js-apis-ability-context.md @@ -888,7 +888,7 @@ Disconnects a connection. This API uses an asynchronous callback to return the r startAbilityByCall(want: Want): Promise<Caller>; -Obtains the caller interface of the specified ability, and if the specified ability is not started, starts the ability in the background. +Starts an ability in the foreground or background and obtains the caller interface for communication with the ability. **System capability**: SystemCapability.Ability.AbilityRuntime.Core @@ -896,7 +896,7 @@ Obtains the caller interface of the specified ability, and if the specified abil | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-Want.md) | Yes| Information about the target ability, including the ability name, bundle name, and device ID. If the device ID is left blank or the default value is used, it indicates the local device.| +| want | [Want](js-apis-application-Want.md) | Yes| Information about the ability to start, including **abilityName**, **moduleName**, **bundleName**, **deviceId** (optional), and **parameters** (optional). If **deviceId** is left blank or null, the local ability is started. If **parameters** is left blank or null, the ability is started in the background.| **Return value** @@ -907,22 +907,40 @@ Obtains the caller interface of the specified ability, and if the specified abil **Example** ```js - import Ability from '@ohos.application.Ability'; - var caller; - export default class MainAbility extends Ability { - onWindowStageCreate(windowStage) { - this.context.startAbilityByCall({ - bundleName: "com.example.myservice", - abilityName: "MainAbility", - deviceId: "" - }).then((obj) => { - caller = obj; - console.log('Caller GetCaller Get ' + caller); - }).catch((e) => { - console.log('Caller GetCaller error ' + e); - }); + let caller = undefined; + + // Start an ability in the background without passing parameters. + var wantBackground = { + bundleName: "com.example.myservice", + moduleName: "entry", + abilityName: "MainAbility", + deviceId: "" + }; + this.context.startAbilityByCall(wantBackground) + .then((obj) => { + caller = obj; + console.log('GetCaller success'); + }).catch((error) => { + console.log(`GetCaller failed with ${error}`); + }); + + // Start an ability in the foreground with ohos.aafwk.param.callAbilityToForeground in parameters set to true. + var wantForeground = { + bundleName: "com.example.myservice", + moduleName: "entry", + abilityName: "MainAbility", + deviceId: "", + parameters: { + "ohos.aafwk.param.callAbilityToForeground": true } - } + }; + this.context.startAbilityByCall(wantForeground) + .then((obj) => { + caller = obj; + console.log('GetCaller success'); + }).catch((error) => { + console.log(`GetCaller failed with ${error}`); + }); ``` ## AbilityContext.startAbilityWithAccount diff --git a/en/application-dev/reference/apis/js-apis-call.md b/en/application-dev/reference/apis/js-apis-call.md index 381796969cdc260896b9ea4857d0461eebf7d519..79ad744268f719cf6c9c24310e27e91c00ae9630 100644 --- a/en/application-dev/reference/apis/js-apis-call.md +++ b/en/application-dev/reference/apis/js-apis-call.md @@ -1327,7 +1327,7 @@ This is a system API. | Name | Type | Mandatory| Description | | -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ | | slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2 | -| callback | AsyncCallback<[CallWaitingStatus](#callwaitingstatus7)\> | Yes | Callback used to return the result.

- **0**: Call waiting is disabled.
- **1**: Call waiting is enabled.| +| callback | AsyncCallback<[CallWaitingStatus](#callwaitingstatus7)\> | Yes | Callback used to return the result.

- **0**: Call waiting is disabled.
- **1**: Call waiting is enabled.| **Example** @@ -2743,13 +2743,13 @@ Defines the dialup options. **System capability**: SystemCapability.Telephony.CallManager -| Name | Type | Mandatory| Description | -| ---------- | ---------------------------------- | ---- | ------------------------------------------------------------ | -| extras | boolean | No | Indication of a video call.
- **true**: video call
- **false** (default): voice call| -| accountId | number | No | Account ID. This API is supported since API version 8. It is a system API. | -| videoState | [VideoStateType](#videostatetype7) | No | Video state type. This API is supported since API version 8. It is a system API. | -| dialScene | [DialScene](#dialscene8) | No | Dialup scenario. This API is supported since API version 8. It is a system API. | -| dialType | [DialType](#dialtype8) | No | Dialup type. This API is supported since API version 8. It is a system API. | +| Name | Type | Mandatory| Description | +| ------------------------ | ---------------------------------- | ---- | ------------------------------------------------------------ | +| extras | boolean | No | Indication of a video call.
- **true**: video call
- **false** (default): voice call| +| accountId 8+ | number | No | Account ID. This is a system API. | +| videoState 8+ | [VideoStateType](#videostatetype7) | No | Video state type. This is a system API. | +| dialScene 8+ | [DialScene](#dialscene8) | No | Dialup scenario. This is a system API. | +| dialType 8+ | [DialType](#dialtype8) | No | Dialup type. This is a system API. | ## CallState diff --git a/en/application-dev/reference/apis/js-apis-device-manager.md b/en/application-dev/reference/apis/js-apis-device-manager.md index 8c27495f208ad620ed6e104fb19c958350805c1e..659a6b126357cb32865e9bc1d21eecd5228bdfd5 100644 --- a/en/application-dev/reference/apis/js-apis-device-manager.md +++ b/en/application-dev/reference/apis/js-apis-device-manager.md @@ -9,7 +9,7 @@ System applications can call the APIs to do the following: - Authenticate or deauthenticate a device. - Query the trusted device list. - Query local device information, including the device name, type, and ID. - +- Publish device information for discovery purposes. > **NOTE** > > - The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. @@ -31,23 +31,24 @@ Creates a **DeviceManager** instance. **System capability**: SystemCapability.DistributedHardware.DeviceManager -- **Parameters** - | Name | Type | Mandatory | Description | - | ---------- | ---------------------------------------- | ---- | ------------------------------------ | - | bundleName | string | Yes | Bundle name of an application. | - | callback | AsyncCallback<[DeviceManager](#devicemanager)> | Yes | Callback used to return the **DeviceManager** instance created.| +**Parameters** +| Name | Type | Mandatory | Description | +| ---------- | ---------------------------------------- | ---- | ------------------------------------ | +| bundleName | string | Yes | Bundle name of an application. | +| callback | AsyncCallback<[DeviceManager](#devicemanager)> | Yes | Callback used to return the **DeviceManager** instance created.| -- Example - ``` - deviceManager.createDeviceManager("ohos.samples.jshelloworld", (err, data) => { - if (err) { - console.info("createDeviceManager err:" + JSON.stringify(err)); - return; - } - console.info("createDeviceManager success"); - let dmInstance = data; - }); - ``` +**Example** + +``` +deviceManager.createDeviceManager("ohos.samples.jshelloworld", (err, data) => { + if (err) { + console.info("createDeviceManager err:" + JSON.stringify(err)); + return; + } + console.info("createDeviceManager success"); + let dmInstance = data; +}); +``` ## DeviceInfo @@ -61,7 +62,7 @@ Defines device information. | deviceName | string | Yes | Device name. | | deviceType | [DeviceType](#devicetype) | Yes | Device type. | | networkId8+ | string | Yes | Network ID of the device. | - +| range9+ | number | Yes | Distance between the device (discovered device) and the device that initiates device discovery. | ## DeviceType @@ -184,6 +185,18 @@ Defines authentication information. | token | number | Yes | Authentication token. | | extraInfo | {[key:string] : any} | No | Extended field.| +## PublishInfo + +Defines published device information. + +**System capability**: SystemCapability.DistributedHardware.DeviceManager + +| Name | Type | Mandatory | Description | +| ------------- | --------------------------------- | ---- | ----------------- | +| publishId | number | Yes | ID used to identify a publication period.| +| mode | [DiscoverMode ](#discovermode) | Yes | Device discovery mode. | +| freq | [ExchangeFreq](#exchangefreq) | Yes | Frequency of device discovery. | +| ranging | boolean | Yes | Whether the device supports distance reporting. | ## DeviceManager @@ -198,10 +211,11 @@ Releases this **DeviceManager** instance when it is no longer used. **System capability**: SystemCapability.DistributedHardware.DeviceManager -- Example - ```js - dmInstance.release(); - ``` +**Example** + +```js +dmInstance.release(); +``` ### getTrustedDeviceListSync @@ -212,15 +226,17 @@ Obtains all trusted devices synchronously. **System capability**: SystemCapability.DistributedHardware.DeviceManager -- Return value - | Name | Description | - | -------------------------------------- | --------- | - | Array<[DeviceInfo](#deviceinfo)> | List of trusted devices obtained.| +**Return value** -- Example - ```js - var deviceInfoList = dmInstance.getTrustedDeviceListSync(); - ``` +| Name | Description | +| -------------------------------------- | --------- | +| Array<[DeviceInfo](#deviceinfo)> | List of trusted devices obtained.| + +**Example** + +```js +var deviceInfoList = dmInstance.getTrustedDeviceListSync(); +``` ### getTrustedDeviceList8+ @@ -231,12 +247,12 @@ Obtains all trusted devices. This API uses an asynchronous callback to return th **System capability**: SystemCapability.DistributedHardware.DeviceManager -- **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ---------------------------------------- | ---- | --------------------- | - | callback | AsyncCallback<Array<[DeviceInfo](#deviceinfo)>> | Yes | Callback used to return the list of trusted devices.| +**Parameters** +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | --------------------- | +| callback | AsyncCallback<Array<[DeviceInfo](#deviceinfo)>> | Yes | Callback used to return the list of trusted devices.| -- Example +**Example** ```js dmInstance.getTrustedDeviceList((err, data) => { console.log("getTrustedDeviceList err: " + JSON.stringify(err)); @@ -253,12 +269,12 @@ Obtains all trusted devices. This API uses a promise to return the result. **System capability**: SystemCapability.DistributedHardware.DeviceManager -- Return value - | Type | Description | - | ---------------------------------------- | --------------------- | - | Promise<Array<[DeviceInfo](#deviceinfo)>> | Promise used to return the list of trusted devices.| +**Return value** +| Type | Description | +| ---------------------------------------- | --------------------- | +| Promise<Array<[DeviceInfo](#deviceinfo)>> | Promise used to return the list of trusted devices.| -- Example +**Example** ```js dmInstance.getTrustedDeviceList().then((data) => { console.log('get trusted device info: ' + JSON.stringify(data)); @@ -275,12 +291,12 @@ Obtains local device information synchronously. **System capability**: SystemCapability.DistributedHardware.DeviceManager -- Return value - | Name | Description | - | -------------------------------------- | --------- | - | Array<[DeviceInfo](#deviceinfo)> | List of local devices obtained.| +**Return value** +| Name | Description | +| -------------------------------------- | --------- | +| Array<[DeviceInfo](#deviceinfo)> | List of local devices obtained.| -- Example +**Example** ```js var deviceInfo = dmInstance.getLocalDeviceInfoSync(); ``` @@ -294,12 +310,12 @@ Obtains local device information. This API uses an asynchronous callback to retu **System capability**: SystemCapability.DistributedHardware.DeviceManager -- **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ---------------------------------------- | ---- | --------- | - | callback | AsyncCallback<[DeviceInfo](#deviceinfo)> | Yes | Callback used to return the local device information.| +**Parameters** +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | --------- | +| callback | AsyncCallback<[DeviceInfo](#deviceinfo)> | Yes | Callback used to return the local device information.| -- Example +**Example** ```js dmInstance.getLocalDeviceInfo((err, data) => { console.log("getLocalDeviceInfo err: " + JSON.stringify(err)); @@ -316,12 +332,12 @@ Obtains local device information. This API uses a promise to return the result. **System capability**: SystemCapability.DistributedHardware.DeviceManager -- Return value - | Type | Description | - | ---------------------------------------- | --------------------- | - | Promise<[DeviceInfo](#deviceinfo)> | Promise used to return the local device information.| +**Return value** +| Type | Description | +| ---------------------------------------- | --------------------- | +| Promise<[DeviceInfo](#deviceinfo)> | Promise used to return the local device information.| -- Example +**Example** ```js dmInstance.getLocalDeviceInfo().then((data) => { console.log('get local device info: ' + JSON.stringify(data)); @@ -338,12 +354,12 @@ Starts to discover peripheral devices. **System capability**: SystemCapability.DistributedHardware.DeviceManager -- **Parameters** - | Name | Type | Mandatory | Description | - | ------------- | ------------------------------- | ---- | ----- | - | subscribeInfo | [SubscribeInfo](#subscribeinfo) | Yes | Subscription information.| +**Parameters** +| Name | Type | Mandatory | Description | +| ------------- | ------------------------------- | ---- | ----- | +| subscribeInfo | [SubscribeInfo](#subscribeinfo) | Yes | Subscription information.| -- Example +**Example** ```js // Automatically generate a unique subscription ID. var subscribeId = Math.floor(Math.random() * 10000 + 1000); @@ -359,6 +375,45 @@ Starts to discover peripheral devices. dmInstance.startDeviceDiscovery(subscribeInfo); // The deviceFound callback is invoked to notify the application when a device is discovered. ``` +### startDeviceDiscovery9+ + +startDeviceDiscovery(subscribeInfo: SubscribeInfo, filterOptions: string): void + +Starts to discover peripheral devices and filters discovered devices. + +**System capability**: SystemCapability.DistributedHardware.DeviceManager + +**Parameters** +| Name | Type | Mandatory | Description | +| ------------- | ------------------------------- | ---- | ----- | +| subscribeInfo | [SubscribeInfo](#subscribeinfo) | Yes | Subscription information.| +| filterOptions | string | No | Options for filtering discovered devices.| + +**Example** + ```js + // Automatically generate a unique subscription ID. + var subscribeId = Math.floor(Math.random() * 10000 + 1000); + var subscribeInfo = { + "subscribeId": subscribeId, + "mode": 0xAA, // Active discovery + "medium": 0, // Automatic. Multiple media can be used for device discovery. + "freq": 2, // High frequency + "isSameAccount": false, + "isWakeRemote": false, + "capability": 1 + }; + var filterOptions = { + "filter_op": "OR", // Optional. The default value is OR. + "filters": [ + { + "type": "range", + "value": 50 // Filter discovered devices based on the distance (in cm). + } + ] + }; + dmInstance.startDeviceDiscovery(subscribeInfo, JSON.stringify(filterOptions)); // The deviceFound callback is invoked to notify the application when a device is discovered. + ``` + ### stopDeviceDiscovery stopDeviceDiscovery(subscribeId: number): void @@ -367,17 +422,63 @@ Stops device discovery. **System capability**: SystemCapability.DistributedHardware.DeviceManager -- **Parameters** - | Name | Type | Mandatory | Description | - | ----------- | ------ | ---- | ----- | - | subscribeId | number | Yes | Subscription ID.| +**Parameters** +| Name | Type | Mandatory | Description | +| ----------- | ------ | ---- | ----- | +| subscribeId | number | Yes | Subscription ID.| -- Example +**Example** ```js // The subscribeId input must be the same as that automatically generated in startDeviceDiscovery. dmInstance.stopDeviceDiscovery(subscribeId); ``` +### publishDeviceDiscovery9+ + +publishDeviceDiscovery(publishInfo: PublishInfo): void + +Publishes device information for discovery purposes. + +**System capability**: SystemCapability.DistributedHardware.DeviceManager + +**Parameters** +| Name | Type | Mandatory| Description | +| ------------- | ------------------------------- | ---- | ----- | +| publishInfo | [PublishInfo](#publishinfo) | Yes | Device information to publish.| + +**Example** + ```js + // Automatically generate a unique subscription ID. + var publishId = Math.floor(Math.random() * 10000 + 1000); + var publishInfo = { + "publishId": publishId, + "mode": 0xAA, // Active discovery + "freq": 2, // High frequency + "ranging": 1 // The device supports reporting the distance to the discovery initiator. + }; + dmInstance.publishDeviceDiscovery(publishInfo); // A callback is invoked to notify the application when the device information is published. + ``` + +### unPublishDeviceDiscovery + +unPublishDeviceDiscovery(publishId: number): void + +Stops publishing device information. + +**System capability**: SystemCapability.DistributedHardware.DeviceManager + +**Parameters** + +| Name | Type| Mandatory| Description | +| ----------- | -------- | ---- | ----- | +| publishId | number | Yes | Publish ID.| + +**Example** + ```js + // The publishId input must be the same as that automatically generated in publishDeviceDiscovery. + dmInstance.unPublishDeviceDiscovery(publishId); + ``` + ### authenticateDevice authenticateDevice(deviceInfo: DeviceInfo, authParam: AuthParam, callback: AsyncCallback<{deviceId: string, pinToken ?: number}>): void @@ -386,14 +487,14 @@ Authenticates a device. **System capability**: SystemCapability.DistributedHardware.DeviceManager -- **Parameters** - | Name | Type | Mandatory | Description | - | ---------- | ---------------------------------------- | ---- | ------- | - | deviceInfo | [DeviceInfo](#deviceinfo) | Yes | Device information. | - | authParam | [AuthParam](#authparam) | Yes | Authentication parameter. | - | callback | AsyncCallback<{ deviceId: string, pinToken ?: number }> | Yes | Callback used to return the authentication result.| +**Parameters** +| Name | Type | Mandatory | Description | +| ---------- | ---------------------------------------- | ---- | ------- | +| deviceInfo | [DeviceInfo](#deviceinfo) | Yes | Device information. | +| authParam | [AuthParam](#authparam) | Yes | Authentication parameter. | +| callback | AsyncCallback<{ deviceId: string, pinToken ?: number }> | Yes | Callback used to return the authentication result.| -- Example +**Example** ```js // Information about the device to authenticate. The information can be obtained from the device discovery result. var deviceInfo ={ @@ -423,12 +524,13 @@ Deauthenticates a device. **System capability**: SystemCapability.DistributedHardware.DeviceManager -- **Parameters** - | Name | Type | Mandatory | Description | - | ---------- | ------------------------- | ---- | ----- | - | deviceInfo | [DeviceInfo](#deviceinfo) | Yes | Device information.| +**Parameters** + +| Name | Type | Mandatory | Description | +| ---------- | ------------------------- | ---- | ----- | +| deviceInfo | [DeviceInfo](#deviceinfo) | Yes | Device information.| -- Example +**Example** ```js dmInstance.unAuthenticateDevice(deviceInfo); ``` @@ -442,13 +544,13 @@ Verifies authentication information. **System capability**: SystemCapability.DistributedHardware.DeviceManager -- **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ---------------------------------------- | ---- | ------- | - | authInfo | [AuthInfo](#authinfo) | Yes | Authentication information. | - | authInfo | AsyncCallback<{ deviceId: string, level: number }> | Yes | Callback used to return the verification result.| +**Parameters** +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | ------- | +| authInfo | [AuthInfo](#authinfo) | Yes | Authentication information. | +| authInfo | AsyncCallback<{ deviceId: string, level: number }> | Yes | Callback used to return the verification result.| -- Example +**Example** ```js let authInfo = { "authType": 1, @@ -473,13 +575,13 @@ Subscribes to changes in the device state. **System capability**: SystemCapability.DistributedHardware.DeviceManager -- **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ---------------------------------------- | ---- | ------------------------------ | - | type | string | Yes | Event type. The value **'deviceStateChange'** indicates a device state change event.| - | callback | Callback<{ action: [DeviceStateChangeAction](#devicestatechangeaction), device: [DeviceInfo](#deviceinfo) }> | Yes | Callback invoked to return the device information and state. | +**Parameters** +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | ------------------------------ | +| type | string | Yes | Event type. The value **'deviceStateChange'** indicates a device state change event.| +| callback | Callback<{ action: [DeviceStateChangeAction](#devicestatechangeaction), device: [DeviceInfo](#deviceinfo) }> | Yes | Callback invoked to return the device information and state. | -- Example +**Example** ```js dmInstance.on('deviceStateChange', (data) => { console.info("deviceStateChange on:" + JSON.stringify(data)); @@ -496,19 +598,20 @@ Unsubscribes from changes in the device state. **System capability**: SystemCapability.DistributedHardware.DeviceManager -- **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ---------------------------------------- | ---- | --------------------------- | - | type | string | Yes | Event type. The value **'deviceStateChange'** indicates a device state change event. | - | callback | Callback<{ action: [DeviceStateChangeAction](#devicestatechangeaction), device: [DeviceInfo](#deviceinfo) }> | Yes | Callback invoked to return the device information and state.| +**Parameters** +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | --------------------------- | +| type | string | Yes | Event type. The value **'deviceStateChange'** indicates a device state change event. | +| callback | Callback<{ action: [DeviceStateChangeAction](#devicestatechangeaction), device: [DeviceInfo](#deviceinfo) }> | Yes | Callback invoked to return the device information and state.| -- Example - ```js - dmInstance.off('deviceStateChange', (data) => { - console.info('deviceStateChange' + JSON.stringify(data)); - } - ); - ``` +**Example** + +```js +dmInstance.off('deviceStateChange', (data) => { + console.info('deviceStateChange' + JSON.stringify(data)); + } +); +``` ### on('deviceFound') @@ -519,13 +622,13 @@ Subscribes to device discovery events. **System capability**: SystemCapability.DistributedHardware.DeviceManager -- **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ---------------------------------------- | ---- | -------------------------- | - | type | string | Yes | Event type. The value **'deviceFound'** indicates an event reported when a device is discovered.| - | callback | Callback<{ subscribeId: number, device: DeviceInfo }> | Yes | Callback used for device discovery. | +**Parameters** +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | -------------------------- | +| type | string | Yes | Event type. The value **'deviceFound'** indicates an event reported when a device is discovered.| +| callback | Callback<{ subscribeId: number, device: DeviceInfo }> | Yes | Callback used for device discovery. | -- Example +**Example** ```js dmInstance.on('deviceFound', (data) => { console.info("deviceFound:" + JSON.stringify(data)); @@ -541,13 +644,13 @@ Unsubscribes from device discovery events. **System capability**: SystemCapability.DistributedHardware.DeviceManager -- **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ---------------------------------------- | ---- | --------------------------- | - | type | string | Yes | Event type. The value **'deviceFound'** indicates an event reported when a device is discovered. | - | callback | Callback<{ subscribeId: number, device: [DeviceInfo](#deviceinfo) }> | Yes | Callback used for device discovery, which is invoked to return the device information and state.| +**Parameters** +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | --------------------------- | +| type | string | Yes | Event type. The value **'deviceFound'** indicates an event reported when a device is discovered. | +| callback | Callback<{ subscribeId: number, device: [DeviceInfo](#deviceinfo) }> | Yes | Callback invoked to return the device information and state.| -- Example +**Example** ```js dmInstance.off('deviceFound', (data) => { console.info('deviceFound' + JSON.stringify(data)); @@ -563,13 +666,13 @@ Subscribes to device discovery failures. **System capability**: SystemCapability.DistributedHardware.DeviceManager -- **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ---------------------------------------- | ---- | ------------------------------ | - | type | string | Yes | Event type. The event **'discoverFail'** indicates an event reported when device discovery fails.| - | callback | Callback<{ subscribeId: number, reason: number }> | Yes | Callback used for the device discovery failure. | +**Parameters** +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | ------------------------------ | +| type | string | Yes | Event type. The event **'discoverFail'** indicates an event reported when device discovery fails.| +| callback | Callback<{ subscribeId: number, reason: number }> | Yes | Callback used for the device discovery failure. | -- Example +**Example** ```js dmInstance.on('discoverFail', (data) => { this.log("discoverFail on:" + JSON.stringify(data)); @@ -585,13 +688,13 @@ Unsubscribes from device discovery failures. **System capability**: SystemCapability.DistributedHardware.DeviceManager -- **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ---------------------------------------- | ---- | ----------------- | - | type | string | Yes | Event type. The event **'discoverFail'** indicates an event reported when device discovery fails. | - | callback | Callback<{ subscribeId: number, reason: number }> | Yes | Callback used for the device discovery failure.| +**Parameters** +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | ----------------- | +| type | string | Yes | Event type. The event **'discoverFail'** indicates an event reported when device discovery fails. | +| callback | Callback<{ subscribeId: number, reason: number }> | Yes | Callback used for the device discovery failure.| -- Example +**Example** ```js dmInstance.off('deviceFound', (data) => { console.info('deviceFound' + JSON.stringify(data)); @@ -599,6 +702,93 @@ Unsubscribes from device discovery failures. ); ``` +### on('publishSuccess') + +on(type: 'publishSuccess', callback: Callback<{ publishId: number }>): void + +Subscribes to device information publication success events. + +**System capability**: SystemCapability.DistributedHardware.DeviceManager + +**Parameters** +| Name | Type | Mandatory| Description | +| -------- | ---------------------------------------- | ---- | -------------------------- | +| type | string | Yes | Event type. The value **'publishSuccess'** indicates an event reported when device information is published.| +| callback | Callback<{ publishId: number }> | Yes | Callback invoked to return the publish ID. | + +**Example** +```js +dmInstance.on('publishSuccess', (data) => { + console.info("publishSuccess:" + JSON.stringify(data)); + } +); +``` + +### off('publishSuccess') + +off(type: 'publishSuccess', callback?: Callback<{ publishId: number }>): void + +Unsubscribes from device information publication success events. + +**System capability**: SystemCapability.DistributedHardware.DeviceManager + +**Parameters** +| Name | Type | Mandatory| Description | +| -------- | ---------------------------------------- | ---- | --------------------------- | +| type | string | Yes | Event type. The value **'publishSuccess'** indicates an event reported when device information is published. | +| callback | Callback<{ publishId: number }> | Yes | Callback used to return the publish ID.| + +**Example** + ```js + dmInstance.off('publishSuccess', (data) => { + console.info('publishSuccess' + JSON.stringify(data)); + } + ); + ``` + +### on('publishFail') + +on(type: 'publishFail', callback: Callback<{ publishId: number, reason: number }>): void + +Subscribes to device information publication failures. + +**System capability**: SystemCapability.DistributedHardware.DeviceManager + +**Parameters** +| Name | Type | Mandatory| Description | +| -------- | ----------------------------------------------------- | ---- | ------------------------------ | +| type | string | Yes | Event type. The event **'publishFail'** indicates an event reported when publishing device information fails.| +| callback | Callback<{ publishId: number, reason: number }> | Yes | Callback used for the publication failure. | + +**Example** + ```js + dmInstance.on('publishFail', (data) => { + this.log("publishFail on:" + JSON.stringify(data)); + } + ); + ``` + +### off('publishFail') + +off(type: 'publishFail', callback?: Callback<{ publishId: number, reason: number }>): void + +Unsubscribes from device information publication failures. + +**System capability**: SystemCapability.DistributedHardware.DeviceManager + +**Parameters** +| Name | Type | Mandatory| Description | +| -------- | ----------------------------------------------------- | ---- | ----------------- | +| type | string | Yes | Event type. The event **'publishFail'** indicates an event reported when publishing device information fails. | +| callback | Callback<{ publishId: number, reason: number }> | Yes | Callback used for the device discovery failure.| + +**Example** + ```js + dmInstance.off('publishFail', (data) => { + console.info('publishFail' + JSON.stringify(data)); + } + ); + ``` ### on('serviceDie') @@ -608,13 +798,13 @@ Subscribes to dead events of the **DeviceManager** service. **System capability**: SystemCapability.DistributedHardware.DeviceManager -- **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ----------------------- | ---- | ---------------------------------------- | - | type | string | Yes | Event type. The value **'serviceDie'** indicates an event reported when the **DeviceManager** service is terminated unexpectedly.| - | callback | () => void | Yes | Callback invoked when a dead event of the **DeviceManager** service occurs. | +**Parameters** +| Name | Type | Mandatory | Description | +| -------- | ----------------------- | ---- | ---------------------------------------- | +| type | string | Yes | Event type. The value **'serviceDie'** indicates an event reported when the **DeviceManager** service is terminated unexpectedly.| +| callback | () => void | Yes | Callback invoked when a dead event of the **DeviceManager** service occurs. | -- Example +**Example** ```js dmInstance.on("serviceDie", () => { console.info("serviceDie on"); @@ -631,13 +821,13 @@ Unsubscribes from dead events of the **DeviceManager** service. **System capability**: SystemCapability.DistributedHardware.DeviceManager -- **Parameters** - | Name | Type | Mandatory | Description | - | -------- | ----------------------- | ---- | ---------------------------------------- | - | type | string | Yes | Event type. The value **'serviceDie'** indicates an event reported when the **DeviceManager** service is terminated unexpectedly.| - | callback | () => void | No | Callback used to return the dead event of the **DeviceManager** service. | +**Parameters** +| Name | Type | Mandatory | Description | +| -------- | ----------------------- | ---- | ---------------------------------------- | +| type | string | Yes | Event type. The value **'serviceDie'** indicates an event reported when the **DeviceManager** service is terminated unexpectedly.| +| callback | () => void | No | Callback used to return the dead event of the **DeviceManager** service. | -- Example +**Example** ```js dmInstance.off("serviceDie", () => { console.info("serviceDie off"); diff --git a/en/application-dev/reference/apis/js-apis-distributedMissionManager.md b/en/application-dev/reference/apis/js-apis-distributedMissionManager.md new file mode 100644 index 0000000000000000000000000000000000000000..4c7d2ea1d3d66e5d65118f376ed2a9300dd06cd3 --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-distributedMissionManager.md @@ -0,0 +1,345 @@ +# Distributed Mission Management + +The **distributedMissionManager** module implements system mission management across devices. You can use the APIs provided by this module to register or deregister a mission status listener, and start or stop synchronizing the remote mission list. + +> **NOTE** +> +> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. +> +> The APIs provided by this module are system APIs. + +## Modules to Import + +```js +import distributedMissionManager from '@ohos.distributedMissionManager' +``` + + +## distributedMissionManager.registerMissionListener + +registerMissionListener(parameter: MissionDeviceInfo, options: MissionCallback, callback: AsyncCallback<void>): void; + +Registers a mission status listener. This API uses an asynchronous callback to return the result. + +**Required permissions**: ohos.permission.MANAGE_MISSIONS + +**System capability**: SystemCapability.Ability.AbilityRuntime.Mission + +**Parameters** + +| Name | Type | Mandatory | Description | +| --------- | --------------------------------------- | ---- | --------- | +| parameter | [MissionDeviceInfo](#missiondeviceinfo) | Yes | Information about the device to listen for.| +| options | [MissionCallback](#missioncallback) | Yes | Callback to register. | +| callback | AsyncCallback<void> | Yes | Callback used to return the result.| + +**Example** + + ```ts + function NotifyMissionsChanged(deviceId) { + console.log('NotifyMissionsChanged deviceId ' + JSON.stringify(deviceId)); + } + function NotifySnapshot(deviceId, missionId) { + console.log('NotifySnapshot deviceId ' + JSON.stringify(deviceId)); + console.log('NotifySnapshot missionId ' + JSON.stringify(missionId)); + } + function NotifyNetDisconnect(deviceId, state) { + console.log('NotifyNetDisconnect deviceId ' + JSON.stringify(deviceId)); + console.log('NotifyNetDisconnect state ' + JSON.stringify(state)); + } + var parameter = { + deviceId: remoteDeviceId + }; + var options = { + notifyMissionsChanged: NotifyMissionsChanged, + notifySnapshot: NotifySnapshot, + notifyNetDisconnect: NotifyNetDisconnect + } + distributedMissionManager.registerMissionListener(parameter, options, (error) => { + console.log("error.code = " + error.code) + }) + ``` +## distributedMissionManager.registerMissionListener + +registerMissionListener(parameter: MissionDeviceInfo, options: MissionCallback): Promise<void> + +Registers a mission status listener. This API uses a promise to return the result. + +**Required permissions**: ohos.permission.MANAGE_MISSIONS + +**System capability**: SystemCapability.Ability.AbilityRuntime.Mission + +**Parameters** + +| Name | Type | Mandatory | Description | +| --------- | ---------------------------------------- | ---- | -------- | +| parameter | [MissionDeviceInfo](#missiondeviceinfo) | Yes | Information about the device to listen for. | +| options | MissionCallback | Yes | Callback to register.| + +**Return value** + +| Type | Description | +| ------------------- | ---------------- | +| Promise<void> | Promise used to return the result.| + +**Example** + + ```ts + function NotifyMissionsChanged(deviceId) { + console.log('NotifyMissionsChanged deviceId ' + JSON.stringify(deviceId)); + } + function NotifySnapshot(deviceId, missionId) { + console.log('NotifySnapshot deviceId ' + JSON.stringify(deviceId)); + console.log('NotifySnapshot missionId ' + JSON.stringify(missionId)); + } + function NotifyNetDisconnect(deviceId, state) { + console.log('NotifyNetDisconnect deviceId ' + JSON.stringify(deviceId)); + console.log('NotifyNetDisconnect state ' + JSON.stringify(state)); + } + var parameter = { + deviceId: remoteDeviceId + }; + var options = { + notifyMissionsChanged: NotifyMissionsChanged, + notifySnapshot: NotifySnapshot, + notifyNetDisconnect: NotifyNetDisconnect + } + distributedMissionManager.registerMissionListener(parameter, options) + .then(data => { + console.info('success data is ' + data); + }).catch(error => { + console.info('error error is ' + error); + }) + ``` + + +## distributedMissionManager.unregisterMissionListener + +unregisterMissionListener(parameter: MissionDeviceInfo, callback: AsyncCallback<void>): void; + +Deregisters a mission status listener. This API uses an asynchronous callback to return the result. + +**Required permissions**: ohos.permission.MANAGE_MISSIONS + +**System capability**: SystemCapability.Ability.AbilityRuntime.Mission + +**Parameters** + +| Name | Type | Mandatory | Description | +| --------- | --------------------------------------- | ---- | --------- | +| parameter | [MissionDeviceInfo](#missiondeviceinfo) | Yes | Information about the device to listen for. | +| callback | AsyncCallback<void> | Yes | Callback used to return the result.| + +**Example** + + ```ts + var parameter = { + deviceId: remoteDeviceId + }; + distributedMissionManager.unregisterMissionListener(parameter, (error) => { + console.log("error.code = " + error.code) + }) + ``` + + +## distributedMissionManager.unregisterMissionListener + +unregisterMissionListener(parameter: MissionDeviceInfo): Promise<void> + +Deregisters a mission status listener. This API uses a promise to return the result. + +**Required permissions**: ohos.permission.MANAGE_MISSIONS + +**System capability**: SystemCapability.Ability.AbilityRuntime.Mission + +**Parameters** + +| Name | Type | Mandatory | Description | +| --------- | --------------------------------------- | ---- | ----- | +| parameter | [MissionDeviceInfo](#missiondeviceinfo) | Yes | Information about the device to listen for.| + +**Return value** + +| Type | Description | +| ------------------- | ---------------- | +| Promise<void> | Promise used to return the result.| + +**Example** + + ```ts + var parameter = { + deviceId: remoteDeviceId + }; + distributedMissionManager.unregisterMissionListener(parameter) + .then(data => { + console.info('success data is ' + data); + }).catch(error => { + console.info('error error is ' + error); + }) + ``` + +## distributedMissionManager.startSyncRemoteMissions + +startSyncRemoteMissions(parameter: MissionParameter, callback: AsyncCallback<void>): void; + +Starts to synchronize the remote mission list. This API uses an asynchronous callback to return the result. + +**Required permissions**: ohos.permission.MANAGE_MISSIONS + +**System capability**: SystemCapability.Ability.AbilityRuntime.Mission + +**Parameters** + +| Name | Type | Mandatory | Description | +| --------- | ------------------------------------- | ---- | --------- | +| parameter | [MissionParameter](#missionparameter) | Yes | Parameters required for synchronization. | +| callback | AsyncCallback<void> | Yes | Callback used to return the result.| + +**Example** + + ```ts + var parameter = { + deviceId: remoteDeviceId, + fixConflict: false, + tag: 0 + }; + distributedMissionManager.startSyncRemoteMissions(parameter, (error) => { + console.log("error.code = " + error.code) + }) + ``` + +## distributedMissionManager.startSyncRemoteMissions + +startSyncRemoteMissions(parameter: MissionParameter): Promise<void> + +Starts to synchronize the remote mission list. This API uses a promise to return the result. + +**Required permissions**: ohos.permission.MANAGE_MISSIONS + +**System capability**: SystemCapability.Ability.AbilityRuntime.Mission + +**Parameters** + +| Name | Type | Mandatory | Description | +| --------- | ------------------------------------- | ---- | ----- | +| parameter | [MissionParameter](#missionparameter) | Yes | Parameters required for synchronization.| + +**Return value** + +| Type | Description | +| ------------------- | ---------------- | +| Promise<void> | Promise used to return the result.| + +**Example** + + ```ts + var parameter = { + deviceId: remoteDeviceId, + fixConflict: false, + tag: 0 + }; + distributedMissionManager.startSyncRemoteMissions(parameter) + .then(data => { + console.info('success data is ' + data); + }).catch(error => { + console.info('error error is ' + error); + }) + ``` + +## distributedMissionManager.stopSyncRemoteMissions + +stopSyncRemoteMissions(parameter: MissionDeviceInfo, callback: AsyncCallback<void>): void; + +Stops synchronizing the remote mission list. This API uses an asynchronous callback to return the result. + +**Required permissions**: ohos.permission.MANAGE_MISSIONS + +**System capability**: SystemCapability.Ability.AbilityRuntime.Mission + +**Parameters** + +| Name | Type | Mandatory | Description | +| --------- | --------------------------------------- | ---- | --------- | +| parameter | [MissionDeviceInfo](#missiondeviceinfo) | Yes | Parameters required for synchronization. | +| callback | AsyncCallback<void> | Yes | Callback used to return the result.| + +**Example** + + ```ts + var parameter = { + deviceId: remoteDeviceId + }; + distributedMissionManager.stopSyncRemoteMissions(parameter, (error) => { + console.log("error.code = " + error.code) + }) + ``` + +## distributedMissionManager.stopSyncRemoteMissions + +stopSyncRemoteMissions(parameter: MissionDeviceInfo): Promise<void> + +Stops synchronizing the remote mission list. This API uses a promise to return the result. + +**Required permissions**: ohos.permission.MANAGE_MISSIONS + +**System capability**: SystemCapability.Ability.AbilityRuntime.Mission + +**Parameters** + +| Name | Type | Mandatory | Description | +| --------- | --------------------------------------- | ---- | ----- | +| parameter | [MissionDeviceInfo](#missiondeviceinfo) | Yes | Parameters required for synchronization.| + +**Return value** + +| Type | Description | +| ------------------- | ---------------- | +| Promise<void> | Promise used to return the result.| + +**Example** + + ```ts + var parameter = { + deviceId: remoteDeviceId + }; + distributedMissionManager.stopSyncRemoteMissions(parameter) + .then(data => { + console.info('success data is ' + data); + }).catch(error => { + console.info('error error is ' + error); + }) + ``` + +## MissionCallback + +Defines the callbacks that can be registered as a mission status listener. + +**System capability**: SystemCapability.Ability.AbilityRuntime.Mission + +| Name | Type | Readable | Writable | Description | +| --------------------- | -------- | ---- | ---- | ------------------ | +| notifyMissionsChanged | function | Yes | No | Callback used to notify the mission change event and return the device ID. | +| notifySnapshot | function | Yes | No | Callback used to notify the snapshot change event and return the device ID and mission ID.| +| notifyNetDisconnect | function | Yes | No | Callback used to notify the disconnection event and return the device ID and network status.| + +## MissionParameter + +Defines the parameters required for mission synchronization. + +**System capability**: SystemCapability.Ability.AbilityRuntime.Mission + +| Name | Type | Readable | Writable | Description | +| ----------- | ------- | ---- | ---- | ----------- | +| deviceId | string | Yes | Yes | Device ID. | +| fixConflict | boolean | Yes | Yes | Whether a version conflict occurs.| +| tag | number | Yes | Yes | Tag of the mission. | + +## MissionDeviceInfo + +Defines the parameters required for registering a listener. + +**System capability**: SystemCapability.Ability.AbilityRuntime.Mission + +| Name | Type | Readable | Writable | Description | +| -------- | ------ | ---- | ---- | ------- | +| deviceId | string | Yes | Yes | Device ID.| diff --git a/en/application-dev/reference/apis/js-apis-media.md b/en/application-dev/reference/apis/js-apis-media.md index dff8251fcc345a2e8fb24b4fcafee582357951b0..66af65d60b482342733fcc149c8b7b4078eeb851 100644 --- a/en/application-dev/reference/apis/js-apis-media.md +++ b/en/application-dev/reference/apis/js-apis-media.md @@ -61,7 +61,7 @@ Creates a **VideoPlayer** instance in asynchronous mode. This API uses a callbac let videoPlayer media.createVideoPlayer((error, video) => { - if (typeof(video) != 'undefined') { + if (video != null) { videoPlayer = video; console.info('video createVideoPlayer success'); } else { @@ -90,7 +90,7 @@ Creates a **VideoPlayer** instance in asynchronous mode. This API uses a promise let videoPlayer media.createVideoPlayer().then((video) => { - if (typeof(video) != 'undefined') { + if (video != null) { videoPlayer = video; console.info('video createVideoPlayer success'); } else { @@ -143,7 +143,7 @@ Only one **AudioRecorder** instance can be created per device. let videoRecorder media.createVideoRecorder((error, video) => { - if (typeof(video) != 'undefined') { + if (video != null) { videoRecorder = video; console.info('video createVideoRecorder success'); } else { @@ -173,7 +173,7 @@ Only one **AudioRecorder** instance can be created per device. let videoRecorder media.createVideoRecorder().then((video) => { - if (typeof(video) != 'undefined') { + if (video != null) { videoRecorder = video; console.info('video createVideoRecorder success'); } else { @@ -370,7 +370,7 @@ Seeks to the specified playback position. ```js audioPlayer.on('timeUpdate', (seekDoneTime) => { // Set the 'timeUpdate' event callback. - if (typeof (seekDoneTime) == 'undefined') { + if (seekDoneTime == null) { console.info('audio seek fail'); return; } @@ -443,7 +443,7 @@ function printfDescription(obj) { } audioPlayer.getTrackDescription((error, arrlist) => { - if (typeof (arrlist) != 'undefined') { + if (arrlist != null) { for (let i = 0; i < arrlist.length; i++) { printfDescription(arrlist[i]); } @@ -479,7 +479,7 @@ function printfDescription(obj) { } audioPlayer.getTrackDescription().then((arrlist) => { - if (typeof (arrlist) != 'undefined') { + if (arrlist != null) { arrayDescription = arrlist; } else { console.log('audio getTrackDescription fail'); @@ -505,7 +505,7 @@ Subscribes to the audio buffering update event. | Name | Type | Mandatory| Description | | -------- | -------- | ---- | ------------------------------------------------------------ | -| type | string | Yes | Event type, which is **'bufferingUpdate'** in this case. | +| type | string | Yes | Event type, which is **'bufferingUpdate'** in this case. | | callback | function | Yes | Callback invoked when the event is triggered.
When [BufferingInfoType](#bufferinginfotype8) is set to **BUFFERING_PERCENT** or **CACHED_DURATION**, **value** is valid. Otherwise, **value** is fixed at **0**.| **Example** @@ -554,7 +554,7 @@ audioPlayer.on('reset', () => { // Set the 'reset' event callback. audioPlayer = undefined; }); audioPlayer.on('timeUpdate', (seekDoneTime) => { // Set the 'timeUpdate' event callback. - if (typeof(seekDoneTime) == "undefined") { + if (seekDoneTime == null) { console.info('audio seek fail'); return; } @@ -602,14 +602,14 @@ Subscribes to the **'timeUpdate'** event. | Name | Type | Mandatory| Description | | -------- | ----------------- | ---- | ------------------------------------------------------------ | -| type | string | Yes | Event type, which is **'timeUpdate'** in this case.
The **'timeUpdate'** event is triggered when the [seek()](#audioplayer_seek) API is called. | +| type | string | Yes | Event type, which is **'timeUpdate'** in this case.
The **'timeUpdate'** event is triggered when the [seek()](#audioplayer_seek) API is called.| | callback | Callback\ | Yes | Callback invoked when the event is triggered. The input parameter of the callback is the time when the seek operation is successful. | **Example** ```js audioPlayer.on('timeUpdate', (seekDoneTime) => { // Set the 'timeUpdate' event callback. - if (typeof (seekDoneTime) == 'undefined') { + if (seekDoneTime == null) { console.info('audio seek fail'); return; } @@ -630,7 +630,7 @@ Subscribes to audio playback error events. After an error event is reported, you | Name | Type | Mandatory| Description | | -------- | ------------- | ---- | ------------------------------------------------------------ | -| type | string | Yes | Event type, which is **'error'** in this case.
The **'error'** event is triggered when an error occurs during audio playback. | +| type | string | Yes | Event type, which is **'error'** in this case.
The **'error'** event is triggered when an error occurs during audio playback.| | callback | ErrorCallback | Yes | Callback invoked when the event is triggered. | **Example** @@ -727,7 +727,7 @@ Sets **SurfaceId**. This API uses a callback to return the result. ```js videoPlayer.setDisplaySurface(surfaceId, (err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('setDisplaySurface success!'); } else { console.info('setDisplaySurface fail!'); @@ -785,7 +785,7 @@ Prepares for video playback. This API uses a callback to return the result. ```js videoPlayer.prepare((err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('prepare success!'); } else { console.info('prepare fail!'); @@ -835,7 +835,7 @@ Starts to play video resources. This API uses a callback to return the result. ```js videoPlayer.play((err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('play success!'); } else { console.info('play fail!'); @@ -885,7 +885,7 @@ Pauses video playback. This API uses a callback to return the result. ```js videoPlayer.pause((err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('pause success!'); } else { console.info('pause fail!'); @@ -935,7 +935,7 @@ Stops video playback. This API uses a callback to return the result. ```js videoPlayer.stop((err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('stop success!'); } else { console.info('stop fail!'); @@ -985,7 +985,7 @@ Switches the video resource to be played. This API uses a callback to return the ```js videoPlayer.reset((err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('reset success!'); } else { console.info('reset fail!'); @@ -1037,7 +1037,7 @@ Seeks to the specified playback position. The next key frame at the specified po ```js let seekTime = 5000; videoPlayer.seek(seekTime, (err, result) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('seek success!'); } else { console.info('seek fail!'); @@ -1068,7 +1068,7 @@ import media from '@ohos.multimedia.media' let seekTime = 5000; let seekMode = media.SeekMode.SEEK_NEXT_SYNC; videoPlayer.seek(seekTime, seekMode, (err, result) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('seek success!'); } else { console.info('seek fail!'); @@ -1134,7 +1134,7 @@ Sets the volume. This API uses a callback to return the result. ```js let vol = 0.5; videoPlayer.setVolume(vol, (err, result) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('setVolume success!'); } else { console.info('setVolume fail!'); @@ -1191,7 +1191,7 @@ Releases the video playback resource. This API uses a callback to return the res ```js videoPlayer.release((err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('release success!'); } else { console.info('release fail!'); @@ -1249,7 +1249,7 @@ function printfDescription(obj) { } videoPlayer.getTrackDescription((error, arrlist) => { - if (typeof (arrlist) != 'undefined') { + if (arrlist) != null) { for (let i = 0; i < arrlist.length; i++) { printfDescription(arrlist[i]); } @@ -1286,7 +1286,7 @@ function printfDescription(obj) { let arrayDescription; videoPlayer.getTrackDescription().then((arrlist) => { - if (typeof (arrlist) != 'undefined') { + if (arrlist != null) { arrayDescription = arrlist; } else { console.log('video getTrackDescription fail'); @@ -1321,7 +1321,7 @@ import media from '@ohos.multimedia.media' let speed = media.PlaybackSpeed.SPEED_FORWARD_2_00_X; videoPlayer.setSpeed(speed, (err, result) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('setSpeed success!'); } else { console.info('setSpeed fail!'); @@ -1382,7 +1382,7 @@ Selects a bit rate from available ones, which can be obtained by calling [availa ```js let bitrate = 1024000; videoPlayer.selectBitrate(bitrate, (err, result) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('selectBitrate success!'); } else { console.info('selectBitrate fail!'); @@ -1433,7 +1433,7 @@ Subscribes to the video playback completion event. | Name | Type | Mandatory| Description | | -------- | -------- | ---- | ----------------------------------------------------------- | -| type | string | Yes | Event type, which is **'playbackCompleted'** in this case. | +| type | string | Yes | Event type, which is **'playbackCompleted'** in this case.| | callback | function | Yes | Callback invoked when the event is triggered. | **Example** @@ -1456,7 +1456,7 @@ Subscribes to the video buffering update event. | Name | Type | Mandatory| Description | | -------- | -------- | ---- | ------------------------------------------------------------ | -| type | string | Yes | Event type, which is **'bufferingUpdate'** in this case. | +| type | string | Yes | Event type, which is **'bufferingUpdate'** in this case. | | callback | function | Yes | Callback invoked when the event is triggered.
When [BufferingInfoType](#bufferinginfotype8) is set to **BUFFERING_PERCENT** or **CACHED_DURATION**, **value** is valid. Otherwise, **value** is fixed at **0**.| **Example** @@ -1480,7 +1480,7 @@ Subscribes to the frame rendering start event. | Name | Type | Mandatory| Description | | -------- | --------------- | ---- | ------------------------------------------------------------ | -| type | string | Yes | Event type, which is **'startRenderFrame'** in this case. | +| type | string | Yes | Event type, which is **'startRenderFrame'** in this case.| | callback | Callback\ | Yes | Callback invoked when the event is triggered. | **Example** @@ -1503,7 +1503,7 @@ Subscribes to the video width and height change event. | Name | Type | Mandatory| Description | | -------- | -------- | ---- | ------------------------------------------------------------ | -| type | string | Yes | Event type, which is **'videoSizeChanged'** in this case. | +| type | string | Yes | Event type, which is **'videoSizeChanged'** in this case.| | callback | function | Yes | Callback invoked when the event is triggered. **width** indicates the video width, and **height** indicates the video height. | **Example** @@ -1527,7 +1527,7 @@ Subscribes to video playback error events. After an error event is reported, you | Name | Type | Mandatory| Description | | -------- | ------------- | ---- | ------------------------------------------------------------ | -| type | string | Yes | Event type, which is **'error'** in this case.
The **'error'** event is triggered when an error occurs during video playback. | +| type | string | Yes | Event type, which is **'error'** in this case.
The **'error'** event is triggered when an error occurs during video playback.| | callback | ErrorCallback | Yes | Callback invoked when the event is triggered. | **Example** @@ -1640,7 +1640,7 @@ function printfItemDescription(obj, key) { } audioPlayer.getTrackDescription((error, arrlist) => { - if (typeof (arrlist) != 'undefined') { + if (arrlist != null) { for (let i = 0; i < arrlist.length; i++) { printfItemDescription(arrlist[i], MD_KEY_TRACK_TYPE); // Print the MD_KEY_TRACK_TYPE value of each track. } @@ -1866,7 +1866,7 @@ Subscribes to audio recording error events. After an error event is reported, yo | Name | Type | Mandatory| Description | | -------- | ------------- | ---- | ------------------------------------------------------------ | -| type | string | Yes | Event type, which is **'error'** in this case.
The **'error'** event is triggered when an error occurs during audio recording. | +| type | string | Yes | Event type, which is **'error'** in this case.
The **'error'** event is triggered when an error occurs during audio recording.| | callback | ErrorCallback | Yes | Callback invoked when the event is triggered. | **Example** @@ -1996,7 +1996,7 @@ let eventEmitter = new events.EventEmitter(); eventEmitter.on('prepare', () => { videoRecorder.prepare(videoConfig, (err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('prepare success'); } else { console.info('prepare failed and error is ' + err.message); @@ -2005,7 +2005,7 @@ eventEmitter.on('prepare', () => { }); media.createVideoRecorder((err, recorder) => { - if (typeof (err) == 'undefined' && typeof (recorder) != 'undefined') { + if (err == null && recorder != null) { videoRecorder = recorder; console.info('createVideoRecorder success'); eventEmitter.emit('prepare'); // Trigger the 'prepare' event. @@ -2065,7 +2065,7 @@ let videoConfig = { // promise let videoRecorder = null; media.createVideoRecorder().then((recorder) => { - if (typeof (recorder) != 'undefined') { + if (recorder != null) { videoRecorder = recorder; console.info('createVideoRecorder success'); } else { @@ -2106,7 +2106,7 @@ This API can be called only after [prepare()](#videorecorder_prepare1) is called // asyncallback let surfaceID = null; // Surface ID passed to the external system. videoRecorder.getInputSurface((err, surfaceId) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('getInputSurface success'); surfaceID = surfaceId; } else { @@ -2167,7 +2167,7 @@ This API can be called only after [prepare()](#videorecorder_prepare1) and [getI ```js // asyncallback videoRecorder.start((err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('start videorecorder success'); } else { console.info('start videorecorder failed and error is ' + err.message); @@ -2223,7 +2223,7 @@ This API can be called only after [start()](#videorecorder_start1) is called. Yo ```js // asyncallback videoRecorder.pause((err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('pause videorecorder success'); } else { console.info('pause videorecorder failed and error is ' + err.message); @@ -2277,7 +2277,7 @@ Resumes video recording in asynchronous mode. This API uses a callback to return ```js // asyncallback videoRecorder.resume((err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('resume videorecorder success'); } else { console.info('resume videorecorder failed and error is ' + err.message); @@ -2331,7 +2331,7 @@ To start another recording, you must call [prepare()](#videorecorder_prepare1) a ```js // asyncallback videoRecorder.stop((err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('stop videorecorder success'); } else { console.info('stop videorecorder failed and error is ' + err.message); @@ -2385,7 +2385,7 @@ Releases the video recording resource in asynchronous mode. This API uses a call ```js // asyncallback videoRecorder.release((err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('release videorecorder success'); } else { console.info('release videorecorder failed and error is ' + err.message); @@ -2439,7 +2439,7 @@ To start another recording, you must call [prepare()](#videorecorder_prepare1) a ```js // asyncallback videoRecorder.reset((err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('reset videorecorder success'); } else { console.info('reset videorecorder failed and error is ' + err.message); @@ -2486,13 +2486,13 @@ Subscribes to video recording error events. After an error event is reported, yo | Name | Type | Mandatory| Description | | -------- | ------------- | ---- | ------------------------------------------------------------ | -| type | string | Yes | Event type, which is **'error'** in this case.
The **'error'** event is triggered when an error occurs during video recording. | +| type | string | Yes | Event type, which is **'error'** in this case.
The **'error'** event is triggered when an error occurs during video recording.| | callback | ErrorCallback | Yes | Callback invoked when the event is triggered. | **Example** ```js -videoRecorder.on('error', (error) => { // Set the 'error event' callback. +videoRecorder.on('error', (error) => { // Set the 'error' event callback. console.info(`audio error called, errName is ${error.name}`); // Print the error name. console.info(`audio error called, errCode is ${error.code}`); // Print the error code. console.info(`audio error called, errMessage is ${error.message}`); // Print the detailed description of the error type. diff --git a/en/application-dev/reference/apis/js-apis-medialibrary.md b/en/application-dev/reference/apis/js-apis-medialibrary.md index b59e88a401cebca64a2be96b29de92dd375e893d..b66eeec85c124ac083b27859849a86e1a5f1d4c2 100644 --- a/en/application-dev/reference/apis/js-apis-medialibrary.md +++ b/en/application-dev/reference/apis/js-apis-medialibrary.md @@ -2280,7 +2280,7 @@ Describes options for fetching media files. | ----------------------- | ------------------- | ---- | ---- | ---- | ------------------------------------------------------------ | | selections | string | Yes | Yes | Yes | Conditions for fetching files. The enumerated values in [FileKey](#filekey8) are used as the column names of the conditions. Example:
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? OR ' +mediaLibrary.FileKey.MEDIA_TYPE + '= ?', | | selectionArgs | Array<string> | Yes | Yes | Yes | Value of the condition, which corresponds to the value of the condition column in **selections**.
Example:
selectionArgs: [mediaLibrary.MediaType.IMAGE.toString(), mediaLibrary.MediaType.VIDEO.toString()], | -| order | string | Yes | Yes | No | Sorting mode of the search results, which can be ascending or descending. The enumerated values in [FileKey](#filekey8) are used as the columns for sorting the search results. Example:
Ascending: order: mediaLibrary.FileKey.DATE_ADDED + " AESC"
Descending: order: mediaLibrary.FileKey.DATE_ADDED + " DESC"| +| order | string | Yes | Yes | No | Sorting mode of the search results, which can be ascending or descending. The enumerated values in [FileKey](#filekey8) are used as the columns for sorting the search results. Example:
Ascending: order: mediaLibrary.FileKey.DATE_ADDED + " ASC"
Descending: order: mediaLibrary.FileKey.DATE_ADDED + " DESC" | | uri8+ | string | Yes | Yes | No | File URI. | | networkId8+ | string | Yes | Yes | No | Network ID of the registered device. | | extendArgs8+ | string | Yes | Yes | No | Extended parameters for fetching the files. Currently, no extended parameters are available. | diff --git a/en/application-dev/reference/apis/js-apis-pointer.md b/en/application-dev/reference/apis/js-apis-pointer.md new file mode 100644 index 0000000000000000000000000000000000000000..97429f0dee1df4f12487cce5d361182ba660fe87 --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-pointer.md @@ -0,0 +1,114 @@ +# Mouse Pointer + +The mouse pointer module provides APIs related to pointer attribute management. + +> **NOTE** +> +> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. + +## Modules to Import + +```js +import pointer from '@ohos.multimodalInput.pointer'; +``` + +## pointer.setPointerVisibele + +setPointerVisible(visible: boolean, callback: AsyncCallback<void>): void + +Sets the visible status of the mouse pointer. This API uses an asynchronous callback to return the result. + +**System capability**: SystemCapability.MultimodalInput.Input.Pointer + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------- | ------------------------- | ---- | ------------------------------------------------------------------- | +| visible | boolean | Yes | Whether the mouse pointer is visible. The value **true** indicates that the mouse pointer is visible, and the value **false** indicates the opposite.| +| callback | AysncCallback<void> | Yes | Callback used to return the result. | + +**Example** + +```js +pointer.setPointerVisible(true, (err, data) => { + if (err) { + console.log(`set pointer visible failed. err=${JSON.stringify(err)}`); + return; + } + console.log(`set pointer visible success.`); +); +``` + +## pointer.setPointerVisible + +setPointerVisible(visible: boolean): Promise<void> + +Sets the visible status of the mouse pointer. This API uses a promise to return the result. + +**System capability**: SystemCapability.MultimodalInput.Input.Pointer + +**Parameters** + +| Name | Type | Mandatory| Description | +| ------- | ------- | ---- | ------------------------------------------------------------------- | +| visible | boolean | Yes | Whether the mouse pointer is visible. The value **true** indicates that the mouse pointer is visible, and the value **false** indicates the opposite.| + +**Return value** + +| Parameter | Description | +| ------------------- | ------------------------------- | +| Promise<void> | Promise used to return the result.| + +**Example** + +```js +pointer.setPointerVisible(false).then( data => { + console.log(`set mouse pointer visible success`); + }, data => { + console.log(`set mouse pointer visible failed err=${JSON.stringify(data)}`); +}); +``` + +## pointer.isPointerVisible + +isPointerVisible(callback: AsyncCallback<boolean>): void + +Checks the visible status of the mouse pointer. This API uses an asynchronous callback to return the result. + +**System capability**: SystemCapability.MultimodalInput.Input.Pointer + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------- | ---------------------------- | ---- | ---------------------------- | +| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.| + +**Example** + +```js +pointer.isPointerVisible((visible)=>{ + console.log("The mouse pointer visible attributes is " + visible); +}); +``` + +## pointer.isPointerVisible + +isPointerVisible(): Promise<boolean> + +Checks the visible status of the mouse pointer. This API uses a promise to return the result. + +**System capability**: SystemCapability.MultimodalInput.Input.Pointer + +**Return value** + +| Parameter | Description | +| ---------------------- | ------------------------------- | +| Promise<boolean> | Promise used to return the result.| + +**Example** + +```js +pointer.isPointerVisible().then( data => { + console.log(`isPointerThen success data=${JSON.stringify(data)}`); +}); +``` diff --git a/en/application-dev/reference/apis/js-apis-radio.md b/en/application-dev/reference/apis/js-apis-radio.md index 16da2e93685e99d26b9af2040af3f294ce68bd08..6e3ee3ab521fd77e73a8085002296cd6b5883430 100644 --- a/en/application-dev/reference/apis/js-apis-radio.md +++ b/en/application-dev/reference/apis/js-apis-radio.md @@ -1588,6 +1588,128 @@ promise.then(data => { }); ``` +## radio.getImsRegInfo9+ + +getImsRegInfo(slotId: number, imsType: ImsServiceType, callback: AsyncCallback): void + +Obtains the IMS registration status of the specified IMS service type. This API uses an asynchronous callback to return the result. + +This is a system API. + +**Required permission**: ohos.permission.GET_TELEPHONY_STATE + +**System capability**: SystemCapability.Telephony.CoreService + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------- | ------------------------------------------ | ---- | -------------------------------------- | +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. | +| callback | AsyncCallback<[ImsRegInfo](#imsreginfo9)\> | Yes | Callback used to return the result. | + +**Example** + +```js +radio.getImsRegInfo(0, 1, (err, data) => { + console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +}); +``` + +## radio.getImsRegInfo9+ + +getImsRegInfo(slotId: number, imsType: ImsServiceType): Promise + +Obtains the IMS registration status of the specified IMS service type. This API uses a promise to return the result. + +This is a system API. + +**Required permission**: ohos.permission.GET_TELEPHONY_STATE + +**System capability**: SystemCapability.Telephony.CoreService + +**Parameters** + +| Name | Type | Mandatory| Description | +| ------- | ---------------------------------- | ---- | -------------------------------------- | +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. | + +**Return value** + +| Type | Description | +| ------------------------------------- | ----------------------- | +| Promise\<[ImsRegInfo](#imsreginfo9)\> | Promise used to return the result.| + +**Example** + +```js +let promise = radio.getImsRegInfo(0, 1); +promise.then(data => { + console.log(`getImsRegInfo success, promise: data->${JSON.stringify(data)}`); +}).catch(err => { + console.log(`getImsRegInfo fail, promise: err->${JSON.stringify(err)}`); +}); +``` + +## radio.on('imsRegStateChange')9+ + +on(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback: Callback): void + +Enables listening for **imsRegStateChange** events. This API uses an asynchronous callback to return the result. + +This is a system API. + +**Required permission**: ohos.permission.GET_TELEPHONY_STATE + +**System capability**: SystemCapability.Telephony.CoreService + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------- | ------------------------------------ | ---- | -------------------------------------- | +| type | string | Yes | IMS registration status changes. | +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. | +| callback | Callback<[ImsRegInfo](#imsreginfo9)> | Yes | Callback used to return the result. | + +**Example** + +```js +radio.on('imsRegStateChange', 0, 1, (err, data) => { + console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +}); +``` + +## radio.off('imsRegStateChange')9+ + +off(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback?: Callback): void + +Disables listening for **imsRegStateChange** events. This API uses an asynchronous callback to return the result. + +This is a system API. + +**Required permission**: ohos.permission.GET_TELEPHONY_STATE + +**System capability**: SystemCapability.Telephony.CoreService + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------- | ------------------------------------ | ---- | -------------------------------------- | +| type | string | Yes | IMS registration status changes. | +| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. | +| callback | Callback<[ImsRegInfo](#imsreginfo9)> | No | Callback used to return the result. | + +**Example** + +```js +radio.off('imsRegStateChange', 0, 1, (err, data) => { + console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +}); +``` + ## RadioTechnology Enumerates radio access technologies. @@ -1755,11 +1877,11 @@ This is a system API. | Name | Type | Description | | ----------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| networkType | [NetworkType](#networkType) | Network type of the cell. | +| networkType | [NetworkType](#networktype) | Network type of the cell. | | isCamped | boolean | Status of the cell. | | timeStamp | number | Timestamp when cell information is obtained. | | signalInformation | [SignalInformation](#signalinformation) | Signal information. | -| data | [CdmaCellInformation](#cdmacellinformation) \| [GsmCellInformation](#gsmcellinformation) \| [LteCellInformation](#ltecellinformation) \| [NrCellInformation](#nrcellinformation) \| [TdscdmaCellInformation](#tdscdmacellinformation) | CDMA cell information \| GSM cell information \| LTE cell information \| NR cell information \| TD-SCDMA cell information | +| data | [CdmaCellInformation](#cdmacellinformation8) \| [GsmCellInformation](#gsmcellinformation8) \| [LteCellInformation](#ltecellinformation8) \| [NrCellInformation](#nrcellinformation8) \| [TdscdmaCellInformation](#tdscdmacellinformation8) | CDMA cell information \|GSM cell information \|LTE cell information \|NR cell information \|TD-SCDMA cell information| ## CdmaCellInformation8+ @@ -1883,6 +2005,8 @@ This is a system API. Defines the network search result. +This is a system API. + **System capability**: SystemCapability.Telephony.CoreService | Name | Type | Description | @@ -1934,3 +2058,59 @@ This is a system API. | selectMode | [NetworkSelectionMode](#networkselectionmode) | Network selection mode. | | networkInformation | [NetworkInformation](#networkinformation) | Network information. | | resumeSelection | boolean | Whether to resume selection. | + +## ImsRegState9+ + +Enumerates IMS registration states. + +This is a system API. + +**System capability**: SystemCapability.Telephony.CoreService + +| Name | Value | Description | +| ---------------- | ---- | -------- | +| IMS_UNREGISTERED | 0 | Not registered.| +| IMS_REGISTERED | 1 | Registered.| + +## ImsRegTech9+ + +Enumerates IMS registration technologies. + +This is a system API. + +**System capability**: SystemCapability.Telephony.CoreService + +| Name | Value | Description | +| ----------------------- | ---- | --------------- | +| REGISTRATION_TECH_NONE | 0 | None. | +| REGISTRATION_TECH_LTE | 1 | LTE. | +| REGISTRATION_TECH_IWLAN | 2 | I-WLAN.| +| REGISTRATION_TECH_NR | 3 | NR. | + +## ImsRegInfo9+ + +Defines the IMS registration information. + +This is a system API. + +**System capability**: SystemCapability.Telephony.CoreService + +| Name | Type | Description | +| ----------- | ---------------------------- | ------------- | +| imsRegState | [ImsRegState](#imsregstate9) | IMS registration state.| +| imsRegTech | [ImsRegTech](#imsregtech9) | IMS registration technology.| + +## ImsServiceType9+ + +Enumerates IMS service types. + +This is a system API. + +**System capability**: SystemCapability.Telephony.CoreService + +| Name | Value | Description | +| ---------- | ---- | ---------- | +| TYPE_VOICE | 0 | Voice service.| +| TYPE_VIDEO | 1 | Video service.| +| TYPE_UT | 2 | UT service. | +| TYPE_SMS | 3 | SMS service.| diff --git a/en/application-dev/reference/apis/js-apis-router.md b/en/application-dev/reference/apis/js-apis-router.md index ac9435450c7e47d70deb11ed0a5b7249eea8f368..5fd946a50a96ae6ba4086934c749d05f89e5362e 100644 --- a/en/application-dev/reference/apis/js-apis-router.md +++ b/en/application-dev/reference/apis/js-apis-router.md @@ -5,7 +5,7 @@ The **Router** module provides APIs to access pages through URLs. You can use th > **NOTE** > > - The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. -> +> > - Page routing APIs can be invoked only after page rendering is complete. Do not call these APIs in **onInit** and **onReady** when the page is still in the rendering phase. ## Modules to Import @@ -23,9 +23,9 @@ Navigates to a specified page in the application. **System capability**: SystemCapability.ArkUI.ArkUI.Full **Parameters** -| Name | Type | Mandatory| Description | -| ------- | ------------------------------- | ---- | ------------------ | -| options | [RouterOptions](#routeroptions) | Yes | Page routing parameters.| +| Name | Type | Mandatory | Description | +| ------- | ------------------------------- | ---- | --------- | +| options | [RouterOptions](#routeroptions) | Yes | Page routing parameters.| **Example** @@ -49,10 +49,10 @@ Navigates to a specified page in the application. **System capability**: SystemCapability.ArkUI.ArkUI.Full **Parameters** -| Name | Type | Mandatory| Description | -| ----------------- | ------------------------------- | ---- | -------------------- | -| options | [RouterOptions](#routeroptions) | Yes | Page routing parameters. | -| mode9+ | [RouterMode](#routermode9) | Yes | Routing mode.| +| Name | Type | Mandatory | Description | +| ------- | ------------------------------- | ---- | ---------- | +| options | [RouterOptions](#routeroptions) | Yes | Page routing parameters. | +| mode | [RouterMode](#routermode9) | Yes | Routing mode.| **Example** @@ -77,6 +77,7 @@ Replaces the current page with another one in the application and destroys the c **System capability**: SystemCapability.ArkUI.ArkUI.Full **Parameters** + | Name | Type | Mandatory| Description | | ------- | ------------------------------- | ---- | ------------------ | | options | [RouterOptions](#routeroptions) | Yes | Description of the new page.| @@ -101,10 +102,10 @@ Replaces the current page with another one in the application and destroys the c **System capability**: SystemCapability.ArkUI.ArkUI.Full **Parameters** -| Name | Type | Mandatory| Description | -| ----------------- | ------------------------------- | ---- | -------------------- | -| options | [RouterOptions](#routeroptions) | Yes | Description of the new page. | -| mode9+ | [RouterMode](#routermode9) | Yes | Routing mode.| +| Name | Type | Mandatory | Description | +| ------- | ------------------------------- | ---- | ---------- | +| options | [RouterOptions](#routeroptions) | Yes | Description of the new page. | +| mode | [RouterMode](#routermode9) | Yes | Routing mode.| **Example** @@ -128,7 +129,7 @@ Returns to the previous page or a specified page. **Parameters** | Name | Type | Mandatory| Description | | ------- | ------------------------------- | ---- | ------------------------------------------------------------ | -| options | [RouterOptions](#routeroptions) | No | Description of the page. The **url** parameter indicates the URL of the page to return to. If the specified page does not exist in the page stack, the application does not respond. If this parameter is not set, the application returns to the previous page.| +| options | [RouterOptions](#routeroptions) | No | Description of the page. The **url** parameter indicates the URL of the page to return to. If the specified page does not exist in the page stack, the application does not respond. If no URL is set, the previous page is returned, and the page in the page stack is not reclaimed. It will be reclaimed after being popped up.| **Example** @@ -159,8 +160,8 @@ Obtains the number of pages in the current stack. **System capability**: SystemCapability.ArkUI.ArkUI.Full **Return value** -| Type | Description | -| ------ | ---------------------------------- | +| Type | Description | +| ------ | ------------------ | | string | Number of pages in the stack. The maximum value is **32**.| **Example** @@ -179,8 +180,8 @@ Obtains state information about the current page. **Return value** -| Type | Description | -| --------------------------- | -------------- | +| Type | Description | +| --------------------------- | ------- | | [RouterState](#routerstate) | Page routing state.| **Example** @@ -197,11 +198,11 @@ Describes the page routing state. **System capability**: SystemCapability.ArkUI.ArkUI.Full -| Name | Type | Description | -| ----- | ------ | ------------------------------------------------------------ | +| Name | Type | Description | +| ----- | ------ | ---------------------------------- | | index | number | Index of the current page in the stack. The index starts from 1 from the bottom to the top of the stack.| -| name | string | Name of the current page, that is, the file name. | -| path | string | Path of the current page. | +| name | string | Name of the current page, that is, the file name. | +| path | string | Path of the current page. | ## router.enableAlertBeforeBackPage @@ -212,9 +213,9 @@ Enables the display of a confirm dialog box before returning to the previous pag **System capability**: SystemCapability.ArkUI.ArkUI.Full **Parameters** -| Name | Type | Mandatory| Description | -| ------- | ----------------------------------------- | ---- | ------------------ | -| options | [EnableAlertOptions](#enablealertoptions) | Yes | Description of the dialog box.| +| Name | Type | Mandatory | Description | +| ------- | ---------------------------------------- | ---- | --------- | +| options | [EnableAlertOptions](#enablealertoptions) | Yes | Description of the dialog box.| **Example** @@ -229,9 +230,9 @@ Describes the confirm dialog box. **System capability**: SystemCapability.ArkUI.ArkUI.Full -| Name | Type | Mandatory| Description | -| ------- | ------ | ---- | ---------------- | -| message | string | Yes | Content displayed in the confirm dialog box.| +| Name | Type | Mandatory | Description | +| ------- | ------ | ---- | -------- | +| message | string | Yes | Content displayed in the confirm dialog box.| ## router.disableAlertBeforeBackPage @@ -256,8 +257,8 @@ Obtains the parameters passed from the page that initiates redirection to the cu **Return value** -| Type | Description | -| ------ | ---------------------------------- | +| Type | Description | +| ------ | ----------------- | | Object | Parameters passed from the page that initiates redirection to the current page.| **Example** @@ -272,14 +273,13 @@ Describes the page routing options. **System capability**: SystemCapability.ArkUI.ArkUI.Lite -| Name | Type | Mandatory| Description | -| ------ | ------ | ---- | ------------------------------------------------------------ | -| url | string | Yes | URI of the destination page, in either of the following formats:
- Absolute path of the page. The value is available in the pages list in the **config.json** file, for example:
- pages/index/index
- pages/detail/detail
- Particular path. If the URI is a slash (/), the home page is displayed. | -| params | Object | No | Data that needs to be passed to the destination page during redirection. After the destination page is displayed, it can use the passed data, for example, **this.data1** (**data1** is a key in **params**). If there is the same key (for example, **data1**) on the destination page, the passed **data1** value will replace the original value on the destination page.| +| Name | Type | Mandatory | Description | +| ------ | ------ | ---- | ---------------------------------------- | +| url | string | Yes | URI of the destination page, in either of the following formats:
- Absolute path of the page. The value is available in the pages list in the **config.json** file, for example:
- pages/index/index
- pages/detail/detail
- Particular path. If the URI is a slash (/), the home page is displayed.| +| params | Object | No | Data that needs to be passed to the destination page during redirection. After the destination page is displayed, it can use the passed data, for example, **this.data1** (**data1** is a key in **params**). If there is the same key (for example, **data1**) on the destination page, the passed **data1** value will replace the original value on the destination page.| > **NOTE** - > > The page routing stack supports a maximum of 32 pages. ## RouterMode9+ @@ -288,9 +288,9 @@ Enumerates the routing modes. **System capability**: SystemCapability.ArkUI.ArkUI.Full -| Name | Description | -| -------- | ------------------------------------------------------------ | -| Standard | Standard mode. | +| Name | Description | +| -------- | ---------------------------------------- | +| Standard | Standard mode. | | Single | Singleton mode.
If the URL of the target page already exists in the page stack, the page closest to the top of the stack is moved as a new page to the top of the stack.
If the URL of the target page does not exist in the page stack, the page is redirected to in standard mode.| ## Examples diff --git a/en/application-dev/reference/apis/js-apis-sim.md b/en/application-dev/reference/apis/js-apis-sim.md index 958de3d7d1bb9d7295bedac1c844867160d687ca..681e5cdc6ac3dea7924feb25752e017052bef23e 100644 --- a/en/application-dev/reference/apis/js-apis-sim.md +++ b/en/application-dev/reference/apis/js-apis-sim.md @@ -1482,7 +1482,7 @@ promise.then(data => { ## sim.**unlockPin**28+ -****unlockPin2****(slotId: number,pin2: string ,callback: AsyncCallback): void +unlockPin2(slotId: number,pin2: string ,callback: AsyncCallback): void Unlocks PIN 2 of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. @@ -1549,7 +1549,7 @@ promise.then(data => { ## sim.**unlockPuk**28+ -unlockPuk2(slotId: number,newPin2: string,puk2: string ,callback: AsyncCallback): void +unlockPuk2(slotId: number, newPin2: string, puk2: string, callback: AsyncCallback): void Unlocks PUK 2 of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. @@ -1581,7 +1581,7 @@ sim.unlockPuk2(0, newPin2, puk2, (err, data) => { ## sim.**unlockPuk2**8+ -unlockPuk2slotId: number,newPin2: string,puk2: string): Promise<LockStatusResponse\> +unlockPuk2(slotId: number, newPin2: string, puk2: string): Promise<LockStatusResponse\> Unlocks PUK 2 of the SIM card in the specified slot. This API uses a promise to return the result. @@ -2653,7 +2653,7 @@ promise.then(data => { ## sim.getOpKey9+ -getOpKey(slotId: number, callback: AsyncCallback): void +getOpKey(slotId: number, callback: AsyncCallback): void Obtains the opkey of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. @@ -2666,7 +2666,7 @@ This is a system API. | Name | Type | Mandatory| Description | | -------- | ---------------------- | ---- | -------------------------------------- | | slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| -| callback | AsyncCallback | Yes | Callback used to return the result. | +| callback | AsyncCallback | Yes | Callback used to return the result. | **Example** @@ -2679,7 +2679,7 @@ sim.getOpKey(0, (err, data) => { ## sim.getOpKey9+ -getOpKey(slotId: number): Promise +getOpKey(slotId: number): Promise Obtains the opkey of the SIM card in the specified slot. This API uses a promise to return the result. @@ -2697,7 +2697,7 @@ This is a system API. | Type | Description | | ---------------- | ----------------------------------------- | -| Promise | Promise used to return the result.| +| Promise | Promise used to return the result.| **Example** diff --git a/en/application-dev/reference/apis/js-apis-sms.md b/en/application-dev/reference/apis/js-apis-sms.md index fa226f072e2a1c4aa568937455e7ee78e3513469..9039fb774527e9ed6bbd43c95b0996afdc94780d 100644 --- a/en/application-dev/reference/apis/js-apis-sms.md +++ b/en/application-dev/reference/apis/js-apis-sms.md @@ -678,7 +678,7 @@ This is a system API. | Name | Type | Mandatory| Description | | -------- | ----------------------------------------------------------- | ---- | ----------------------------------------- | | slotId | number | Yes | SIM card slot ID.
- **0**: card slot 1
- **1**: card slot 2| -| callback | AsyncCallback> | Yes | Callback used to return the result. | +| callback | AsyncCallback> | Yes | Callback used to return the result. | **Example** @@ -712,7 +712,7 @@ This is a system API. | Type | Description | | ------------------------------------------------------- | ---------------------------------- | -| PromiseArray<[SimShortMessage](#simshortmessage8)\>> | Promise used to return the result.| +| PromiseArray<[SimShortMessage](#simshortmessage7)\>> | Promise used to return the result.| **Example** @@ -742,7 +742,7 @@ This is a system API. | Name | Type | Mandatory| Description | | -------- | ------------------------------------ | ---- | ------------ | -| options | [CBConfigOptions](#cbconfigoptions8) | Yes | Cell broadcast configuration options.| +| options | [CBConfigOptions](#cbconfigoptions7) | Yes | Cell broadcast configuration options.| | callback | AsyncCallback<void> | Yes | Callback used to return the result. | **Example** @@ -776,7 +776,7 @@ This is a system API. | Name | Type | Mandatory| Description | | ------- | ------------------------------------ | ---- | ------------ | -| options | [CBConfigOptions](#cbconfigoptions8) | Yes | Cell broadcast configuration options.| +| options | [CBConfigOptions](#cbconfigoptions7) | Yes | Cell broadcast configuration options.| **Return value** @@ -818,7 +818,7 @@ This is a system API. | slotId | number | Yes | SIM card slot ID.
- **0**: card slot 1
- **1**: card slot 2| | message | string | Yes | SMS message. | | force7bit | boolean | Yes | Whether to use 7-bit coding. | -| callback | AsyncCallback<[SmsSegmentsInfo](#8+ + +Defines the MMS message reading index. + +This is a system API. + +**System capability**: SystemCapability.Telephony.SmsMms + +| Name | Type | Mandatory| Description | +| ---------- | ---------------------------------- | ---- | -------- | +| version | [MmsVersionType](#mmsversiontype8) | Yes | Version | +| messageId | string | Yes | Message ID. | +| to | Array<[MmsAddress](#mmsaddress8)\> | Yes | Destination. | +| from | [MmsAddress](#mmsaddress8) | Yes | Source. | +| readStatus | number | Yes | Read state.| +| date | number | No | Date. | + + ## MmsAttachment8+ Defines the attachment of an MMS message. @@ -1466,7 +1485,7 @@ This is a system API. | MMS_YES | 128 | YES | | MMS_NO | 129 | NO | -## CBConfigOptions8+ +## CBConfigOptions7+ Defines the cell broadcast configuration options. @@ -1557,7 +1576,7 @@ This is a system API. | pdu | string | Yes | Protocol data unit. | | smsc | string | Yes | Short message service center.| -## SimShortMessage8+ +## SimShortMessage7+ Defines a SIM message. diff --git a/en/application-dev/reference/apis/js-apis-system-router.md b/en/application-dev/reference/apis/js-apis-system-router.md index 0f1f932efe54af1337ce19354d19343b6f637687..a35aa162b0b7eb57c3535f821b74a15d4cb58d9f 100644 --- a/en/application-dev/reference/apis/js-apis-system-router.md +++ b/en/application-dev/reference/apis/js-apis-system-router.md @@ -1,5 +1,7 @@ # Page Routing +The **Router** module provides APIs to access pages through URIs. + > **NOTE** > > - The APIs of this module are no longer maintained since API version 8. You are advised to use [`@ohos.router`](js-apis-router.md) instead. @@ -372,12 +374,12 @@ Defines the **EnableAlertBeforeBackPage** parameters. **System capability**: SystemCapability.ArkUI.ArkUI.Full -| Name | Type | Mandatory | Description | -| -------- | ------------------------ | ---- | ------------------------- | -| message | string | Yes | Content displayed in the confirm dialog box. | -| success | (errMsg: string) => void | No | Called when a dialog box is displayed. **errMsg** indicates the returned information. | -| fail | (errMsg: string) => void | No | Called when the API fails to be called. **errMsg** indicates the returned information.| -| complete | () => void | No | Called when the API call is complete. | +| Name | Type | Mandatory| Description | +| -------- | ------------------------ | ---- | -------------------------------------------------- | +| message | string | Yes | Content displayed in the confirm dialog box. | +| success | (errMsg: string) => void | No | Called when the **OK** button in the confirm dialog box is clicked. **errMsg** indicates the returned information.| +| cancel | (errMsg: string) => void | No | Called when the **Cancel** button in the confirm dialog box is clicked. **errMsg** indicates the returned information.| +| complete | () => void | No | Called when the API call is complete. | ## DisableAlertBeforeBackPageOptions6+ @@ -385,11 +387,11 @@ Define the **DisableAlertBeforeBackPage** parameters. **System capability**: SystemCapability.ArkUI.ArkUI.Full -| Name | Type | Mandatory | Description | -| -------- | ------------------------ | ---- | ------------------------- | -| success | (errMsg: string) => void | No | Called when a dialog box is displayed. **errMsg** indicates the returned information. | -| fail | (errMsg: string) => void | No | Called when the API fails to be called. **errMsg** indicates the returned information.| -| complete | () => void | No | Called when the API call is complete. | +| Name | Type | Mandatory| Description | +| -------- | ------------------------ | ---- | -------------------------------------------------- | +| success | (errMsg: string) => void | No | Called when the dialog box is closed. **errMsg** indicates the returned information.| +| cancel | (errMsg: string) => void | No | Called when the dialog box fails to be closed. **errMsg** indicates the returned information.| +| complete | () => void | No | Called when the API call is complete. | ## ParamsInterface diff --git a/en/application-dev/webgl/webgl-guidelines.md b/en/application-dev/webgl/webgl-guidelines.md index d4528ff7ce4abc2e61e885974039bc2aae788724..b169d0586096c5e5932da39625fe656b50b21733 100644 --- a/en/application-dev/webgl/webgl-guidelines.md +++ b/en/application-dev/webgl/webgl-guidelines.md @@ -65,7 +65,7 @@ To draw a 2D image without using WebGL, that is, to implement CPU rather than GP 3. Edit the **index.js** file to add the 2D drawing logic code. The following is an example of the file content: ``` - //index.js + // index.js export default { // Native API interaction code data: { title: "DEMO BY TEAMOL", @@ -136,7 +136,7 @@ To use WebGL to draw a color triangle (GPU drawing), perform the following steps 3. Edit the JavaScript code file to add the logic code for drawing a color triangle. The following is an example of the file content: ``` - //index.js + // index.js // WebGL-related predefinition var gl = { @@ -696,13 +696,6 @@ To use WebGL to draw a color triangle (GPU drawing), perform the following steps } ``` - **Figure 2** Effect of clicking the button to draw a color triangle ![en-us_image_0000001192429306](figures/en-us_image_0000001192429306.gif) - -## Samples - -The following sample is provided to help you better understand how to develop WebGL: - -- [`JsWbgGL`: WebGL (JS, API version 8)](https://gitee.com/openharmony/app_samples/tree/master/Graphics/JsWebGL) diff --git a/en/application-dev/windowmanager/display-guidelines.md b/en/application-dev/windowmanager/display-guidelines.md index 10895f9f6a6e9f59c7d7e446eaceb491503bd268..cdfaa91c9e30760be35923d2c41345feba682080 100644 --- a/en/application-dev/windowmanager/display-guidelines.md +++ b/en/application-dev/windowmanager/display-guidelines.md @@ -10,12 +10,11 @@ For details about the APIs, see [Display](../reference/apis/js-apis-display.md). ## How to Develop -Call **getDefaultDisplay(): Promise** to obtain the default display object. An example code snippet is as follows: +Call `getDefaultDisplay(): Promise` to obtain the default display object. An example code snippet is as follows: ```js import display from '@ohos.display' // Import the module. -let disp; // disp is used to save the default display object. display.getDefaultDisplay().then((disp) => { console.log('display.getDefaultDisplay success, display :' + JSON.stringify(disp)); }, (err) => { diff --git a/en/device-dev/subsystems/Readme-EN.md b/en/device-dev/subsystems/Readme-EN.md index e109fa185f4feacedf1033af5cf83c0ae6c8eec6..389cff3cc3f464451721d2b34e952f0db1f93f0e 100644 --- a/en/device-dev/subsystems/Readme-EN.md +++ b/en/device-dev/subsystems/Readme-EN.md @@ -77,7 +77,6 @@ - [init Module](subsys-boot-init.md) - [appspawn Module](subsys-boot-appspawn.md) - [bootstrap Module](subsys-boot-bootstrap.md) - - [syspara Module](subsys-boot-syspara.md) - [FAQs](subsys-boot-faqs.md) - [Reference](subsys-boot-ref.md) - [Test Case Development](subsys-testguide-test.md) diff --git a/en/device-dev/subsystems/subsys-aiframework-demo-plugin.md b/en/device-dev/subsystems/subsys-aiframework-demo-plugin.md index 298489f6d6faf68f35c7e2b39616d0ae6c7e94b0..5bb827d8262903199e27122c11b9e5f65d5c5cb1 100644 --- a/en/device-dev/subsystems/subsys-aiframework-demo-plugin.md +++ b/en/device-dev/subsystems/subsys-aiframework-demo-plugin.md @@ -20,7 +20,7 @@ }; ``` - The preceding code implements the **IPlugin** API provided by the server. [Table 1](#table567211582104) shows the mapping between the client APIs and the plug-in APIs. + The preceding code implements the **IPlugin** API provided by the server. The following table shows the mapping between the client APIs and the plug-in APIs. **Table 1** Mapping between the client APIs and the plug-in APIs diff --git a/en/device-dev/subsystems/subsys-aiframework-tech-codemanage.md b/en/device-dev/subsystems/subsys-aiframework-tech-codemanage.md index 16602e69ef26c7ddc5e383c8658cb4bce5938f90..e10289c626c0a22be29a97a109d5254c54e4cc75 100644 --- a/en/device-dev/subsystems/subsys-aiframework-tech-codemanage.md +++ b/en/device-dev/subsystems/subsys-aiframework-tech-codemanage.md @@ -15,15 +15,19 @@ In the overall planning of the AI engine framework, northbound SDKs are a part o - SDK code directory: //foundation/ai/engine/services/client/algorithm\_sdk - e.g. //foundation/ai/engine/services/client/algorithm\_sdk/cv + Examples: + + //foundation/ai/engine/services/client/algorithm\_sdk/cv - e.g. //foundation/ai/engine/services/client/algorithm\_sdk/nlu + //foundation/ai/engine/services/client/algorithm\_sdk/nlu - Plug-in code directory: //foundation/ai/engine/services/server/plugin - e.g. //foundation/ai/engine/services/server/plugin/cv + Examples: - e.g. //foundation/ai/engine/services/server/plugin/nlu + //foundation/ai/engine/services/server/plugin/cv + + //foundation/ai/engine/services/server/plugin/nlu ## Rule: Store all external APIs provided by plug-ins in the **interfaces/kits** directory of the AI subsystem. diff --git a/en/device-dev/subsystems/subsys-boot-init-jobs.md b/en/device-dev/subsystems/subsys-boot-init-jobs.md index 8bbbc1a8c030cf07366fc49c010862b99555f207..31e52aa9bb74cb28168744a9427a88df47279460 100644 --- a/en/device-dev/subsystems/subsys-boot-init-jobs.md +++ b/en/device-dev/subsystems/subsys-boot-init-jobs.md @@ -160,6 +160,20 @@ A job is a command set, where you can manage the commands to be executed. A maxi Small and standard systems + + + write + + + write filename value
Example:
write /data/testfile 0 + + + Writes a file. filename and value respectively indicate the absolute file path and the string to write. + + + Standard system + + stop @@ -300,6 +314,20 @@ A job is a command set, where you can manage the commands to be executed. A maxi Small and standard systems + + + syncexec + + + syncexec Path of the executable file Parameters passed by the executable file
Example:
syncexec /system/bin/udevadm trigger + + + Runs an executable file synchronously. The **wait** function will be called to wait for the child process to end. The command must not contain more than 10 parameters. + + + Standard system + + mknode diff --git a/en/device-dev/subsystems/subsys-boot-init-plugin.md b/en/device-dev/subsystems/subsys-boot-init-plugin.md index aeb47c97c0ec13179059f1face42d6dba59f730b..89acad326572294105c9946ecae6bc6c7b415cff 100644 --- a/en/device-dev/subsystems/subsys-boot-init-plugin.md +++ b/en/device-dev/subsystems/subsys-boot-init-plugin.md @@ -17,7 +17,7 @@ bootchart is available only for the standard system, and begetctl is available f ## How to Develop ### Parameters - **Table 1** Description of begetctl commands + **Table 1** Description of begetctl commands | Command| Format and Example| Description| | :---------- | :---------- |:--------| | init group test [stage] | init group test | For details about **stage**, see **ServiceStatus**.| diff --git a/en/device-dev/subsystems/subsys-boot-init-service.md b/en/device-dev/subsystems/subsys-boot-init-service.md index 38f88f250c710101c84320f59b378b3cc827d568..6c306c1543b4dd7ff81b0e090eb3306483a73704 100644 --- a/en/device-dev/subsystems/subsys-boot-init-service.md +++ b/en/device-dev/subsystems/subsys-boot-init-service.md @@ -114,7 +114,7 @@ The service management module is available only for the mini system and standard By parsing the *.cfg file, you can obtain **service** fields, and then set and start the service. ### Parameters - **Table 1** Description of service fields + **Table 1** Description of service fields @@ -208,11 +208,11 @@ By parsing the *.cfg file, you can obtain **service** fields, a importance
- Current service priority. + Service priority (for the standard system) or service importance (for the mini system). Standard system: The service priority ranges from -20 to 19. A value beyond the range is invalid.
- Small system: The value 0 indicates an unimportant process and a value greater than 0 indicates an important process. + Small system: The value 0 indicates that a system restart is not required, and a value greater than 0 indicates the opposite.
Small and standard systems @@ -362,7 +362,7 @@ By parsing the *.cfg file, you can obtain **service** fields, a | option | Socket option. This field is passed when **setsockopt** is called. Currently, the available options include SOCKET_OPTION_PASSCRED, SOCKET_OPTION_RCVBUFFORCE, SOCK_CLOEXEC, and SOCK_NONBLOCK.| ### Available APIs - **Table 3** FD proxy APIs + **Table 3** FD proxy APIs | API | Function| Description | | ---------- | ---------- |--------| | int *ServiceGetFd(const char *serviceName, size_t *outfdCount) | Obtains the proxy FD from the init process.| Return value: Returns the pointer to the fd array if the operation is successful; returns **NULL** otherwise. (Note: Manual release is required.)
Arguments:
**serviceName**: service name.
**outfdCount**: length of the returned fd array.| diff --git a/en/device-dev/subsystems/subsys-boot.md b/en/device-dev/subsystems/subsys-boot.md index a5b61f59149cd57c0df24fa4d656e92271808808..7888048a08574ef3a06b3cdca551a4d598dc201d 100644 --- a/en/device-dev/subsystems/subsys-boot.md +++ b/en/device-dev/subsystems/subsys-boot.md @@ -4,7 +4,6 @@ - **[init Module](subsys-boot-init.md)** - **[appspawn Module](subsys-boot-appspawn.md)** - **[bootstrap Module](subsys-boot-bootstrap.md)** -- **[syspara Module](subsys-boot-syspara.md)** - **[FAQs](subsys-boot-faqs.md)** - **[Reference](subsys-boot-ref.md)** diff --git a/en/device-dev/subsystems/subsys-dfx-hisysevent-logging.md b/en/device-dev/subsystems/subsys-dfx-hisysevent-logging.md index 23edcbae978020463839ea97b876ef4819fe09d1..2bb67bf541229f541a5461db0c04beecbeabd18e 100644 --- a/en/device-dev/subsystems/subsys-dfx-hisysevent-logging.md +++ b/en/device-dev/subsystems/subsys-dfx-hisysevent-logging.md @@ -23,13 +23,14 @@ Use HiSysEvent logging to flush logged event data to disks. HiSysEvent logging is implemented using the API provided by the **HiSysEvent** class. For details, see the API Reference. > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> > In OpenHarmony-3.2-Beta3, HiSysEvent logging is open for restricted use to avoid event storms. The **HiSysEvent::Write** API in Table 1 is replaced by the **HiSysEventWrite** API in Table 2. The **HiSysEvent::Write** API has been deprecated. Use the **HiSysEventWrite** API instead for HiSysEvent logging. **Table 1** C++ event logging API (deprecated) | API | Description | | ------------------------------------------------------------ | ---------------------- | -| template<typename... Types> 
static int Write(const std::string &domain, const std::string &eventName, EventType type, Types... keyValues) | Flushes logged event data to disks.| +| template<typename... Types>
static int Write(const std::string &domain, const std::string &eventName, EventType type, Types... keyValues) | Flushes logged event data to disks.| **Table 2** C++ event logging API (in use) | API | Description | @@ -49,7 +50,7 @@ HiSysEvent logging is implemented using the API provided by the **HiSysEvent** c The following table describes the kernel event logging APIs. -**Table 4** Description of kernel event logging APIs +**Table 4** Kernel event logging APIs | API | Description | | ------------------------------------------------------------ | ------------------------------------ | diff --git a/en/readme/figures/location_En-1.png b/en/readme/figures/location_En-1.png new file mode 100644 index 0000000000000000000000000000000000000000..1ae4bcd7173f2e95004c96fa13d420c09f017f76 Binary files /dev/null and b/en/readme/figures/location_En-1.png differ diff --git a/en/readme/globalization.md b/en/readme/globalization.md index 8ba91ef0aa3a8cd788fe54792a4a7148af5c3cdf..8e1841cc3fb0c65a43b29fa7c8ac07c4e931a2b8 100755 --- a/en/readme/globalization.md +++ b/en/readme/globalization.md @@ -15,7 +15,7 @@ If OpenHarmony devices and applications need to be used globally, they must meet ## Architecture -**Figure 1** Architecture of the globalization subsystem +**Figure 1** Architecture of the globalization subsystem ![](figures/architecture-of-the-globalization-subsystem.png "architecture-of-the-globalization-subsystem") diff --git a/en/readme/location.md b/en/readme/location.md index 09cacb485331c6b0e5b46af2c070acae735690c6..2e7ba90b4b18d9f86e708ddb16cf0aa539b7fc07 100644 --- a/en/readme/location.md +++ b/en/readme/location.md @@ -8,7 +8,7 @@ With the location awareness capability offered by OpenHarmony, mobile devices wi Your application can call location-specific APIs to obtain the location information of a mobile device for offering location-based services such as drive navigation and motion track recording. -Basic Concepts +**Basic Concepts** Location awareness helps determine where a mobile device locates. The system identifies the location of a mobile device with its coordinates, and uses location technologies such as Global Navigation Satellite System (GNSS) and network positioning (for example, base station positioning or WLAN/Bluetooth positioning) to provide diverse location-based services. These advanced location technologies make it possible to obtain the accurate location of the mobile device, regardless of whether it is indoors or outdoors. @@ -28,6 +28,10 @@ Location awareness helps determine where a mobile device locates. The system ide WLAN or Bluetooth positioning estimates the current location of a mobile device based on the locations of WLANs and Bluetooth devices that can be discovered by the device. The location accuracy of this technology depends on the distribution of fixed WLAN access points (APs) and Bluetooth devices around the device. A high density of WLAN APs and Bluetooth devices can produce a more accurate location result than base station positioning. This technology also requires access to the network. +**Figure 1** ** Location subsystem architecture** + +![](figures/location_En-1.png) +![](figures/location_En-1.png) ## Directory Structure @@ -102,7 +106,8 @@ The following table describes APIs available for obtaining device location infor **Obtaining the device location information:** 1. Before using basic location capabilities, check whether your application has been granted the permission to access the device location information. If not, your application needs to obtain the permission from the user. - The system provides the following location permissions: + + The system provides the following location permissions: - ohos.permission.LOCATION - ohos.permission.LOCATION_IN_BACKGROUND @@ -131,7 +136,7 @@ The following table describes APIs available for obtaining device location infor } ``` - For details about the configuration fields, see the description of the **module.json** file. + For details about the configuration fields, see [Application Package Structure Configuration File](../application-dev/quick-start/stage-structure.md). 2. Import the **geolocation** module by which you can implement all APIs related to the basic location capabilities. @@ -204,7 +209,8 @@ The following table describes APIs available for obtaining device location infor ``` 4. Instantiate the **Callback** object for the system to report location results. - Your application needs to implement the callback defined by the system. When the system successfully obtains the real-time location of a device, it will report the location result to your application through the callback interface. Your application can implement the callback interface in such a way to complete your own service logic. + + Your application needs to implement the callback defined by the system. When the system successfully obtains the real-time location of a device, it will report the location result to your application through the callback interface. Your application can implement the callback interface in such a way to complete your own service logic. ``` var locationChange = (location) => { @@ -239,6 +245,7 @@ The following table describes APIs available for obtaining device location infor **Converting the coordinates and geocoding information:** > **NOTE** +> > The **GeoConvert** instance needs to access backend services to obtain information. Therefore, before performing the following steps, ensure that your device is connected to the network. 1. Import the **geolocation** module by which you can implement all APIs related to the geocoding and reverse geocoding conversion capabilities. @@ -248,6 +255,7 @@ The following table describes APIs available for obtaining device location infor ``` 2. Obtain the conversion result. + - Call **getAddressesFromLocation** to convert coordinates into geographical location information. ``` @@ -258,6 +266,7 @@ The following table describes APIs available for obtaining device location infor ``` Your application can obtain the **GeoAddress** list that matches the specified coordinates and then read location information from it. For details, see the *API Reference*. + - Call **getAddressesFromLocationName** to convert geographic description into coordinates. ``` diff --git a/zh-cn/application-dev/database/database-mdds-guidelines.md b/zh-cn/application-dev/database/database-mdds-guidelines.md index ccaedffd12c071d0cd64630fbded0be686c5e491..d6781ccb46af4bf7ef2d50af4b689cdba7f09035 100644 --- a/zh-cn/application-dev/database/database-mdds-guidelines.md +++ b/zh-cn/application-dev/database/database-mdds-guidelines.md @@ -117,7 +117,7 @@ const KEY_TEST_STRING_ELEMENT = 'key_test_string'; const VALUE_TEST_STRING_ELEMENT = 'value-test-string'; try { - kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err,data) { + kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) { if (err != undefined) { console.log("put err: " + JSON.stringify(err)); return; @@ -139,13 +139,13 @@ const KEY_TEST_STRING_ELEMENT = 'key_test_string'; const VALUE_TEST_STRING_ELEMENT = 'value-test-string'; try { - kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err,data) { + kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) { if (err != undefined) { console.log("put err: " + JSON.stringify(err)); return; } console.log("put success"); - kvStore.get(KEY_TEST_STRING_ELEMENT, function (err,data) { + kvStore.get(KEY_TEST_STRING_ELEMENT, function (err, data) { console.log("get success data: " + data); }); }); diff --git a/zh-cn/application-dev/device/device-location-overview.md b/zh-cn/application-dev/device/device-location-overview.md index d6a7606f38bc5ad49b72d9c8818ba2c0ec905d63..abd7fd615fecca1587c3deb5ee0bd1c11760a313 100644 --- a/zh-cn/application-dev/device/device-location-overview.md +++ b/zh-cn/application-dev/device/device-location-overview.md @@ -42,4 +42,4 @@ 针对位置服务,有以下相关实例可供参考: --[`Location`:位置服务(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/device/Location) +-[`Location`:位置服务(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/device/Location) diff --git a/zh-cn/application-dev/internationalization/intl-guidelines.md b/zh-cn/application-dev/internationalization/intl-guidelines.md index ffd0b98fc45ad1e6973b9e1f2435650f86656408..c14e19384a2ce28bc2bca975de01638daf8282c0 100644 --- a/zh-cn/application-dev/internationalization/intl-guidelines.md +++ b/zh-cn/application-dev/internationalization/intl-guidelines.md @@ -320,6 +320,6 @@ 针对Intl开发,有以下相关实例可供参考: --[`International`:国际化(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/International) +-[`International`:国际化(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/International) --[`International`:国际化(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/common/International) \ No newline at end of file +-[`International`:国际化(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/common/International) \ No newline at end of file diff --git a/zh-cn/application-dev/key-features/multi-device-app-dev/layout-intro.md b/zh-cn/application-dev/key-features/multi-device-app-dev/layout-intro.md index 474da8065f0ad6a0d8bd97afcca584ee260fbfc0..547597b6e0b751264dfbb432d445a7a8f47dd8a2 100644 --- a/zh-cn/application-dev/key-features/multi-device-app-dev/layout-intro.md +++ b/zh-cn/application-dev/key-features/multi-device-app-dev/layout-intro.md @@ -15,6 +15,6 @@ 下面将详细介绍这些布局能力。 ## 相关实例 针对一次开发,多端部署,有以下相关实例可供参考: -- [`AdaptiveCapabilities`:多设备自适应能力(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/MultiDeviceAppDev/AdaptiveCapabilities) -- [`JsAdaptiveCapabilities`:多设备自适应能力(JS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/MultiDeviceAppDev/JsAdaptiveCapabilities) +- [`AdaptiveCapabilities`:多设备自适应能力(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/MultiDeviceAppDev/AdaptiveCapabilities) +- [`JsAdaptiveCapabilities`:多设备自适应能力(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/MultiDeviceAppDev/JsAdaptiveCapabilities) - [一次开发多端部署(eTS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/MultiDeploymentEts) diff --git a/zh-cn/application-dev/media/audio-capturer.md b/zh-cn/application-dev/media/audio-capturer.md index 84a51ffd2461a5e156d627f79033948b4a157be9..84702dd781f7c2bec186c7b1e5e61ed1333ff5c4 100644 --- a/zh-cn/application-dev/media/audio-capturer.md +++ b/zh-cn/application-dev/media/audio-capturer.md @@ -22,24 +22,24 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以 ```js var audioStreamInfo = { - samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, - channels: audio.AudioChannel.CHANNEL_1, - sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, - encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW - } + samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, + channels: audio.AudioChannel.CHANNEL_1, + sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, + encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW + } - var audioCapturerInfo = { - source: audio.SourceType.SOURCE_TYPE_MIC, - capturerFlags: 1 - } + var audioCapturerInfo = { + source: audio.SourceType.SOURCE_TYPE_MIC, + capturerFlags: 1 + } - var audioCapturerOptions = { - streamInfo: audioStreamInfo, - capturerInfo: audioCapturerInfo - } + var audioCapturerOptions = { + streamInfo: audioStreamInfo, + capturerInfo: audioCapturerInfo + } - let audioCapturer = await audio.createAudioCapturer(audioCapturerOptions); - var state = audioRenderer.state; + let audioCapturer = await audio.createAudioCapturer(audioCapturerOptions); + var state = audioRenderer.state; ``` 2. (可选)使用on('stateChange')订阅音频采集器状态更改。 @@ -49,26 +49,26 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以 audioCapturer.on('stateChange',(state) => { console.info('AudioCapturerLog: Changed State to : ' + state) switch (state) { - case audio.AudioState.STATE_PREPARED: - console.info('--------CHANGE IN AUDIO STATE----------PREPARED--------------'); - console.info('Audio State is : Prepared'); - break; - case audio.AudioState.STATE_RUNNING: - console.info('--------CHANGE IN AUDIO STATE----------RUNNING--------------'); - console.info('Audio State is : Running'); - break; - case audio.AudioState.STATE_STOPPED: - console.info('--------CHANGE IN AUDIO STATE----------STOPPED--------------'); - console.info('Audio State is : stopped'); - break; - case audio.AudioState.STATE_RELEASED: - console.info('--------CHANGE IN AUDIO STATE----------RELEASED--------------'); - console.info('Audio State is : released'); - break; - default: - console.info('--------CHANGE IN AUDIO STATE----------INVALID--------------'); - console.info('Audio State is : invalid'); - break; + case audio.AudioState.STATE_PREPARED: + console.info('--------CHANGE IN AUDIO STATE----------PREPARED--------------'); + console.info('Audio State is : Prepared'); + break; + case audio.AudioState.STATE_RUNNING: + console.info('--------CHANGE IN AUDIO STATE----------RUNNING--------------'); + console.info('Audio State is : Running'); + break; + case audio.AudioState.STATE_STOPPED: + console.info('--------CHANGE IN AUDIO STATE----------STOPPED--------------'); + console.info('Audio State is : stopped'); + break; + case audio.AudioState.STATE_RELEASED: + console.info('--------CHANGE IN AUDIO STATE----------RELEASED--------------'); + console.info('Audio State is : released'); + break; + default: + console.info('--------CHANGE IN AUDIO STATE----------INVALID--------------'); + console.info('Audio State is : invalid'); + break; } }); ``` @@ -80,9 +80,9 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以 ```js await audioCapturer.start(); if (audioCapturer.state == audio.AudioState.STATE_RUNNING) { - console.info('AudioRecLog: Capturer started'); + console.info('AudioRecLog: Capturer started'); } else { - console.info('AudioRecLog: Capturer start failed'); + console.info('AudioRecLog: Capturer start failed'); } ``` @@ -103,29 +103,29 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以 const path = '/data/data/.pulse_dir/capture_js.wav'; let fd = fileio.openSync(path, 0o102, 0o777); if (fd !== null) { - console.info('AudioRecLog: file fd created'); + console.info('AudioRecLog: file fd created'); } else{ - console.info('AudioRecLog: file fd create : FAILED'); - return; + console.info('AudioRecLog: file fd create : FAILED'); + return; } fd = fileio.openSync(path, 0o2002, 0o666); if (fd !== null) { - console.info('AudioRecLog: file fd opened in append mode'); + console.info('AudioRecLog: file fd opened in append mode'); } var numBuffersToCapture = 150; while (numBuffersToCapture) { - var buffer = await audioCapturer.read(bufferSize, true); - if (typeof(buffer) == undefined) { - console.info('read buffer failed'); - } else { - var number = fileio.writeSync(fd, buffer); - console.info('AudioRecLog: data written: ' + number); - } + var buffer = await audioCapturer.read(bufferSize, true); + if (typeof(buffer) == undefined) { + console.info('read buffer failed'); + } else { + var number = fileio.writeSync(fd, buffer); + console.info('AudioRecLog: data written: ' + number); + } - numBuffersToCapture--; + numBuffersToCapture--; } ``` @@ -134,9 +134,9 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以 ``` await audioCapturer.stop(); if (audioCapturer.state == audio.AudioState.STATE_STOPPED) { - console.info('AudioRecLog: Capturer stopped'); + console.info('AudioRecLog: Capturer stopped'); } else { - console.info('AudioRecLog: Capturer stop failed'); + console.info('AudioRecLog: Capturer stop failed'); } ``` @@ -145,8 +145,8 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以 ```js await audioCapturer.release(); if (audioCapturer.state == audio.AudioState.STATE_RELEASED) { - console.info('AudioRecLog: Capturer released'); + console.info('AudioRecLog: Capturer released'); } else { - console.info('AudioRecLog: Capturer release failed'); + console.info('AudioRecLog: Capturer release failed'); } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/media/figures/zh-ch_image_audio_state_machine.png b/zh-cn/application-dev/media/figures/zh-ch_image_audio_state_machine.png index f6bdbebc49144f5afa093c753845ad7bd5d8f090..7497edd0edbdcfccbc448e9f2f48268ebb75e72e 100644 Binary files a/zh-cn/application-dev/media/figures/zh-ch_image_audio_state_machine.png and b/zh-cn/application-dev/media/figures/zh-ch_image_audio_state_machine.png differ diff --git a/zh-cn/application-dev/media/image.md b/zh-cn/application-dev/media/image.md index a7f8983c8029357e34eb085731b28050fd4ebf89..6caf2a1fba2a11847e49325991e7edfc60857f51 100644 --- a/zh-cn/application-dev/media/image.md +++ b/zh-cn/application-dev/media/image.md @@ -115,6 +115,7 @@ pixelmap.release(()=>{ done(); }) +let path = '/data/local/tmp/test.jpg'; // 用于创建imagesource(uri) const imageSourceApi = image.createImageSource(path); // '/data/local/tmp/test.jpg' @@ -145,7 +146,7 @@ imagePackerApi.release(); ### 解码场景 ```js -/data/local/tmp/test.jpg // 设置创建imagesource的路径 +let path = '/data/local/tmp/test.jpg'; // 设置创建imagesource的路径 // 用路径创建imagesource const imageSourceApi = image.createImageSource(path); // '/data/local/tmp/test.jpg' @@ -222,7 +223,7 @@ catch(error => { ### 编码场景 ```js -/data/local/tmp/test.png // 设置创建imagesource的路径 +let path = '/data/local/tmp/test.png' // 设置创建imagesource的路径 // 用于设置imagesource const imageSourceApi = image.createImageSource(path); // '/data/local/tmp/test.png' diff --git a/zh-cn/application-dev/notification/background-agent-scheduled-reminder-guide.md b/zh-cn/application-dev/notification/background-agent-scheduled-reminder-guide.md index 13b3a3f980fd2addecea4f3d960fd0de031a4e3e..ef25e329e8edab09e8ccda480916d05265422ceb 100644 --- a/zh-cn/application-dev/notification/background-agent-scheduled-reminder-guide.md +++ b/zh-cn/application-dev/notification/background-agent-scheduled-reminder-guide.md @@ -284,6 +284,6 @@ let alarm : reminderAgent.ReminderRequestAlarm = { - [`AlarmClock`:后台代理提醒(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/Notification/AlarmClock) -- [`FlipClock`:翻页时钟(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/CompleteApps/FlipClock) +- [`FlipClock`:翻页时钟(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/CompleteApps/FlipClock) - [闹钟应用(eTS)(API9)](https://gitee.com/openharmony/codelabs/tree/master/CommonEventAndNotification/AlarmClock) \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/Readme-CN.md b/zh-cn/application-dev/reference/apis/Readme-CN.md index 1d269ce4c10b9506a11dc9e9e69291d5c37ad058..3eaaa5ce7a6afe557caa9b7a1eb0e291d4e34e7e 100755 --- a/zh-cn/application-dev/reference/apis/Readme-CN.md +++ b/zh-cn/application-dev/reference/apis/Readme-CN.md @@ -182,6 +182,8 @@ - [@ohos.nfc.cardEmulation (标准NFC-cardEmulation)](js-apis-cardEmulation.md) - [@ohos.nfc.controller (标准NFC)](js-apis-nfcController.md) - [@ohos.nfc.tag (标准NFC-Tag)](js-apis-nfcTag.md) + - [@ohos.nfc.tag (标准NFC-Tag Nfc 技术)](js-apis-nfctech.md) + - [@ohos.nfc.tag (标准NFC-Tag TagSession)](js-apis-tagSession.md) - [@ohos.rpc (RPC通信)](js-apis-rpc.md) - [@ohos.wifi (WLAN)](js-apis-wifi.md) - [@ohos.wifiext (WLAN)](js-apis-wifiext.md) diff --git a/zh-cn/application-dev/reference/apis/js-apis-Context.md b/zh-cn/application-dev/reference/apis/js-apis-Context.md index 1352981c55e13ae8451df234cb434a5f7bb4138c..2de7d3aa4e6ce916921035329f2d623df5ff4308 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-Context.md +++ b/zh-cn/application-dev/reference/apis/js-apis-Context.md @@ -195,6 +195,44 @@ context.requestPermissionsFromUser( ``` +## Context.requestPermissionsFromUser7+ + +requestPermissionsFromUser(permissions: Array\, requestCode: number): Promise\<[PermissionRequestResult](#permissionrequestresult7)> + +从系统请求某些权限(promise形式)。 + +**系统能力**:SystemCapability.Ability.AbilityRuntime.Core + +**参数:** + +| 名称 | 类型 | 必填 | 描述 | +| -------------- | ------------------- | ----- | -------------------------------------------- | +| permissions | Array\ | 是 | 指示要请求的权限列表。此参数不能为null。 | +| requestCode | number | 是 | 指示要传递给PermissionRequestResult的请求代码。 | + +**返回值:** + +| 类型 | 说明 | +| ------------------------------------------------------------- | ---------------- | +| Promise\<[PermissionRequestResult](#permissionrequestresult7)> | 返回授权结果信息。 | + +**示例:** + +```js +import featureAbility from '@ohos.ability.featureAbility' +var context = featureAbility.getContext(); +context.requestPermissionsFromUser( + ["com.example.permission1", + "com.example.permission2", + "com.example.permission3", + "com.example.permission4", + "com.example.permission5"], + 1).then((data)=>{ + console.info("====>requestdata====>" + JSON.stringify(data)); + }); +``` + + ## Context.getApplicationInfo7+ diff --git a/zh-cn/application-dev/reference/apis/js-apis-accessibility-extension-context.md b/zh-cn/application-dev/reference/apis/js-apis-accessibility-extension-context.md index affa083e8924ad08aaf674be55f9acbaf455b1fe..d5bd800be9ab473969b593cd37a3a01aca8e749e 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-accessibility-extension-context.md +++ b/zh-cn/application-dev/reference/apis/js-apis-accessibility-extension-context.md @@ -9,10 +9,18 @@ AccessibilityExtensionContext模块提供扩展的上下文的能力,包括允 > 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块接口仅可在Stage模型下使用。 -## 导入模块 +## 使用说明 + +在使用AccessibilityExtensionContext的功能前,需要通过AccessibilityExtensionAbility子类实例获取。 ```js import AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility' +class MainAbility extends AccessibilityExtensionAbility { + onConnect(): void { + console.log("AxExtensionAbility onConnect"); + let axContext = this.context; + } +} ``` ## FocusDirection @@ -203,9 +211,9 @@ this.context.getWindows().then(windows => { }) ``` -## AccessibilityExtensionContext.gestureInject +## AccessibilityExtensionContext.injectGesture -gestureInject(gesturePath: GesturePath, listener: Callback\): Promise\): Promise\9+ getAssociatedDataSync(name: string, key: string): string; diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-AccessibilityExtensionAbility.md b/zh-cn/application-dev/reference/apis/js-apis-application-AccessibilityExtensionAbility.md index 90037d0d882506a98d94d0a1c3e66e0b183ea4cd..22ecd482ae30cbb7c8296ce9d64ee9f24d2cae8d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-AccessibilityExtensionAbility.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-AccessibilityExtensionAbility.md @@ -18,7 +18,7 @@ import AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtens 辅助事件信息。 -**系统能力**:以下各项对应的系统能力均为 SystemCapability.Barrierfree.Accessibility.Core +**系统能力**:以下各项对应的系统能力均为 SystemCapability.BarrierFree.Accessibility.Core ### 属性 @@ -32,7 +32,7 @@ import AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtens 表示手势路径信息。 -**系统能力**:以下各项对应的系统能力均为 SystemCapability.Barrierfree.Accessibility.Core +**系统能力**:以下各项对应的系统能力均为 SystemCapability.BarrierFree.Accessibility.Core ### 属性 @@ -41,29 +41,11 @@ import AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtens | points | Array<[GesturePoint](gesturepoint)> | 是 | 是 | 手势。 | | durationTime | number | 是 | 是 | 手势总耗时。 | -### constructor - -constructor(durationTime: number) - -构造函数。 - -- **参数:** - - | 参数名 | 参数类型 | 必填 | 说明 | - | ------------ | ------ | ---- | ------ | - | durationTime | number | 是 | 手势总耗时。 | - -- **示例:** - - ```typescript - let gesturePath = new GesturePath(100); - ``` - ## GesturePoint 表示手势触摸点。 -**系统能力**:以下各项对应的系统能力均为 SystemCapability.Barrierfree.Accessibility.Core +**系统能力**:以下各项对应的系统能力均为 SystemCapability.BarrierFree.Accessibility.Core ### 属性 @@ -72,30 +54,11 @@ constructor(durationTime: number) | positionX | number | 是 | 是 | 触摸点X坐标。 | | positionY | number | 是 | 是 | 触摸点Y坐标。 | -### constructor - -constructor(positionX: number, positionY: number) - -构造函数。 - -- **参数:** - - | 参数名 | 参数类型 | 必填 | 说明 | - | --------- | ------ | ---- | ------- | - | positionX | number | 是 | 触摸点X坐标。 | - | positionY | number | 是 | 触摸点Y坐标。 | - -- **示例:** - - ```typescript - let gesturePoint = new GesturePoint(100, 200); - ``` - ## GestureType 手势事件类型。 -**系统能力**:以下各项对应的系统能力均为 SystemCapability.Barrierfree.Accessibility.Core +**系统能力**:以下各项对应的系统能力均为 SystemCapability.BarrierFree.Accessibility.Core | 名称 | 描述 | | ------------- | ------------ | @@ -120,7 +83,7 @@ constructor(positionX: number, positionY: number) 页面刷新类型。 -**系统能力**:以下各项对应的系统能力均为 SystemCapability.Barrierfree.Accessibility.Core +**系统能力**:以下各项对应的系统能力均为 SystemCapability.BarrierFree.Accessibility.Core | 名称 | 描述 | | ----------------- | --------- | @@ -131,7 +94,7 @@ constructor(positionX: number, positionY: number) 触摸浏览事件类型。 -**系统能力**:以下各项对应的系统能力均为 SystemCapability.Barrierfree.Accessibility.Core +**系统能力**:以下各项对应的系统能力均为 SystemCapability.BarrierFree.Accessibility.Core | 名称 | 描述 | | ---------- | ------------ | @@ -205,7 +168,7 @@ onAccessibilityEvent(event: AccessibilityEvent): void { ## AccessibilityExtensionAbility.onKeyEvent -onKeyEvent(keyEvent: inputEventClient.KeyEvent): boolean; +onKeyEvent(keyEvent: KeyEvent): boolean; 在物理按键按下时回调此方法,可以在该方法中根据业务判断是否对事件进行拦截。 @@ -215,7 +178,7 @@ onKeyEvent(keyEvent: inputEventClient.KeyEvent): boolean; | 参数名 | 参数类型 | 必填 | 说明 | | -------- | ---------------------------------------- | ---- | ----------------------- | -| keyEvent | [KeyEvent](js-apis-inputeventclient.md#KeyEvent) | 是 | 按键事件回调函数。返回true表示拦截此按键。 | +| keyEvent | [KeyEvent](js-apis-keyevent.md#KeyEvent) | 是 | 按键事件回调函数。返回true表示拦截此按键。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-audio.md b/zh-cn/application-dev/reference/apis/js-apis-audio.md index 505b86f9912b6bc535bcccafe69e6cd34f3fc253..c3eee8fc7f9d1e96aac8d49b5786ff82fd09eb9d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-audio.md +++ b/zh-cn/application-dev/reference/apis/js-apis-audio.md @@ -762,6 +762,56 @@ getVolumeGroupInfos(); 管理音频音量和音频设备。在调用AudioManager的接口前,需要先通过[getAudioManager](#audiogetaudiomanager)创建实例。 +### getRoutingManager9+ + +getRoutingManager(callback: AsyncCallback<AudioRoutingManager>): void + +获取AudioRoutingManager对象,使用callback方式异步返回结果。 + +**系统能力:** SystemCapability.Multimedia.Audio.Device + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ---------------------------------------------------------------- | ---- | --------------------------------- | +| callback | AsyncCallback<[AudioRoutingManager](#audioroutingmanager9)> | 是 | 回调,返回AudioRoutingManager对象。 | + +**示例:** +```js +await audioManager.getRoutingManager((err,callback) => { + if (err) { + console.error(`Result ERROR: ${err.message}`); + } + console.info('getRoutingManager Callback SUCCESS.'); + var audioRoutingManager; + audioRoutingManager = callback; +}); +``` + +### getRoutingManager9+ + +getRoutingManager(): Promise<AudioRoutingManager> + +获取AudioRoutingManager对象,使用Promise方式异步返回结果。 + +**系统能力:** SystemCapability.Multimedia.Audio.Device + +**返回值:** + +| 类型 | 说明 | +| ----------------------------------------------------------- | --------------------------------------- | +| Promise<[AudioRoutingManager](#audioroutingmanager9)> | Promise回调返回AudioRoutingManager对象。 | + +**示例:** +```js +await audioManager.getRoutingManager().then((value) => { + var routingManager = value; + console.info('getRoutingManager Promise SUCCESS.'); +}).catch((err) => { + console.error(`Result ERROR: ${err.message}`); +}); +``` + ### setVolume setVolume(volumeType: AudioVolumeType, volume: number, callback: AsyncCallback<void>): void @@ -2805,6 +2855,172 @@ let result = audioStreamManager.isAudioRendererLowLatencySupported(AudioStreamIn console.info(`isAudioRendererLowLatencySupported success var ${result}`); ``` +## AudioRoutingManager9+ + +音频路由管理。在使用AudioRoutingManager的接口前,需要使用[getRoutingManager](#getroutingmanager9)获取AudioRoutingManager实例。 + +### selectOutputDevice9+ + +selectOutputDevice(audiodevicedescriptors: AudioDeviceDescriptors, callback: AsyncCallback<void>): void + +选择音频输出设备,当前只能选择一个输出设备,使用callback方式异步返回结果。该接口为系统应用接口。 + +**系统能力:** SystemCapability.Multimedia.Audio.Device + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| --------------------------- | ------------------------------------------------------------ | ---- | ------------------------- | +| audiodevicedescriptors | [AudioDeviceDescriptors](#audiodevicedescriptors) | 是 | 输出设备类。 | +| callback | AsyncCallback<void> | 是 | 回调,返回获取输出设备结果。 | + +**示例:** +```js +let outputAudioDeviceDescriptor = [{ + "deviceRole":audio.DeviceRole.OUTPUT_DEVICE, + "networkId":audio.LOCAL_NETWORK_ID, + "interruptGroupId":1, + "volumeGroupId":1 }]; +var audioRoutingManager; +await audioManager.getRoutingManager().then((value) => { + audioRoutingManager = value; + audioRoutingManager.selectOutputDevice(outputAudioDeviceDescriptor, (err) => { + if (err) { + console.error(`Result ERROR: ${err.message}`); + } else { + console.info('Select output devices result callback: SUCCESS'); } + }); +}); +``` + +### selectOutputDevice9+ + +selectOutputDevice(audiodevicedescriptors: AudioDeviceDescriptors): Promise<void> + +选择音频输出设备,当前只能选择一个输出设备,使用Promise方式异步返回结果。该接口为系统应用接口。 + +**系统能力:** SystemCapability.Multimedia.Audio.Device + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| --------------------------- | ------------------------------------------------------------ | ---- | ------------------------- | +| audiodevicedescriptors | [AudioDeviceDescriptors](#audiodevicedescriptors) | 是 | 输出设备类。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------- | --------------------------- | +| Promise<void> | Promise返回选择输出设备结果。 | + +**示例:** + +```js +let outputAudioDeviceDescriptor =[{ + "deviceRole":audio.DeviceRole.OUTPUT_DEVICE, + "networkId":audio.LOCAL_NETWORK_ID, + "interruptGroupId":1, + "volumeGroupId":1 }]; +var audioRoutingManager; +await audioManager.getRoutingManager().then((value) => { + audioRoutingManager = value; + audioRoutingManager.selectOutputDevice(outputAudioDeviceDescriptor).then(() => { + console.info('Select output devices result promise: SUCCESS'); + }).catch((err) => { + console.error(`Result ERROR: ${err.message}`); + }); +}); +``` + +### selectOutputDeviceByFilter9+ + +selectOutputDeviceByFilter(audiorendererfilter: AudioRendererFilter, audiodevicedescriptors: AudioDeviceDescriptors, callback: AsyncCallback<void>): void + +根据过滤条件,选择音频输出设备,当前只能选择一个输出设备,使用callback方式异步返回结果。该接口为系统应用接口。 + +**系统能力:** SystemCapability.Multimedia.Audio.Device + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| --------------------------- | ------------------------------------------------------------ | ---- | ------------------------- | +| audiorendererfilter | [AudioRendererFilter](#audiorendererfilter9) | 是 | 过滤条件类。 | +| audiodevicedescriptors | [AudioDeviceDescriptors](#audiodevicedescriptors) | 是 | 输出设备类。 | +| callback | AsyncCallback<void> | 是 | 回调,返回获取输出设备结果。 | + +**示例:** +```js +let outputAudioRendererFilter = { + "uid":20010041, + "rendererInfo": { + "contentType":audio.ContentType.CONTENT_TYPE_MUSIC, + "streamUsage":audio.StreamUsage.STREAM_USAGE_MEDIA, + "rendererFlags":0 }, + "rendererId":0 }; +let outputAudioDeviceDescriptor = [{ + "deviceRole":audio.DeviceRole.OUTPUT_DEVICE, + "networkId":audio.LOCAL_NETWORK_ID, + "interruptGroupId":1, + "volumeGroupId":1 }]; +var audioRoutingManager; +await audioManager.getRoutingManager().then((value) => { + audioRoutingManager = value; + audioRoutingManager.selectOutputDeviceByFilter(outputAudioRendererFilter, outputAudioDeviceDescriptor, (err) => { + if (err) { + console.error(`Result ERROR: ${err.message}`); + } else { + console.info('Select output devices by filter result callback: SUCCESS'); } + }); +}); +``` + +### selectOutputDeviceByFilter9+ + +selectOutputDeviceByFilter(audiorendererfilter: AudioRendererFilter, audiodevicedescriptors: AudioDeviceDescriptors): Promise<void> + +根据过滤条件,选择音频输出设备,当前只能选择一个输出设备,使用Promise方式异步返回结果。该接口为系统应用接口。 + +**系统能力:** SystemCapability.Multimedia.Audio.Device + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ---------------------------- | ------------------------------------------------------------ | ---- | ------------------------- | +| audiorendererfilter | [AudioRendererFilter](#audiorendererfilter9) | 是 | 过滤条件类。 | +| audiodevicedescriptors | [AudioDeviceDescriptors](#audiodevicedescriptors) | 是 | 输出设备类。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------- | --------------------------- | +| Promise<void> | Promise返回选择输出设备结果。 | + +**示例:** + +```js +let outputAudioRendererFilter = { + "uid":20010041, + "rendererInfo": { + "contentType":audio.ContentType.CONTENT_TYPE_MUSIC, + "streamUsage":audio.StreamUsage.STREAM_USAGE_MEDIA, + "rendererFlags":0 }, + "rendererId":0 }; +let outputAudioDeviceDescriptor = [{ + "deviceRole":audio.DeviceRole.OUTPUT_DEVICE, + "networkId":audio.LOCAL_NETWORK_ID, + "interruptGroupId":1, + "volumeGroupId":1 }]; +var audioRoutingManager; +await audioManager.getRoutingManager().then((value) => { + audioRoutingManager = value; + audioRoutingManager.selectOutputDeviceByFilter(outputAudioRendererFilter, outputAudioDeviceDescriptor).then(() => { + console.info('Select output devices by filter result promise: SUCCESS'); + }).catch((err) => { + console.error(`Result ERROR: ${err.message}`); + }) +}); +``` + ## AudioRendererChangeInfo9+ 描述音频渲染器更改信息。 @@ -2936,16 +3152,19 @@ audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => **系统能力:** 以下各项对应的系统能力均为SystemCapability.Multimedia.Audio.Device -| 名称 | 类型 | 可读 | 可写 | 说明 | -| -------------------------- | -------------------------- | ---- | ---- | ---------- | -| deviceRole | [DeviceRole](#devicerole) | 是 | 否 | 设备角色。 | -| deviceType | [DeviceType](#devicetype) | 是 | 否 | 设备类型。 | -| id9+ | number | 是 | 否 | 设备id。 | -| name9+ | string | 是 | 否 | 设备名称。 | -| address9+ | string | 是 | 否 | 设备地址。 | -| sampleRates9+ | Array<number> | 是 | 否 | 支持的采样率。 | -| channelCounts9+ | Array<number> | 是 | 否 | 支持的通道数。 | -| channelMasks9+ | Array<number> | 是 | 否 | 支持的通道掩码。 | +| 名称 | 类型 | 可读 | 可写 | 说明 | +| ----------------------------- | -------------------------- | ---- | ---- | ---------- | +| deviceRole | [DeviceRole](#devicerole) | 是 | 否 | 设备角色。 | +| deviceType | [DeviceType](#devicetype) | 是 | 否 | 设备类型。 | +| id9+ | number | 是 | 否 | 设备id。 | +| name9+ | string | 是 | 否 | 设备名称。 | +| address9+ | string | 是 | 否 | 设备地址。 | +| sampleRates9+ | Array<number> | 是 | 否 | 支持的采样率。 | +| channelCounts9+ | Array<number> | 是 | 否 | 支持的通道数。 | +| channelMasks9+ | Array<number> | 是 | 否 | 支持的通道掩码。 | +| networkId9+ | string | 是 | 否 | 设备组网的ID。 | +| interruptGroupId9+ | number | 是 | 否 | 设备所处的焦点组ID。 | +| volumeGroupId9+ | number | 是 | 否 | 设备所处的音量组ID。 | ## AudioDeviceDescriptors @@ -2975,6 +3194,30 @@ promise.then(function (value) { }); ``` +## AudioRendererFilter9+ + +过滤条件类。在调用selectOutputDeviceByFilter接口前,需要先创建AudioRendererFilter实例。 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.Multimedia.Audio.Device + +| 名称 | 类型 | 必填 | 说明 | +| -------------| ---------------------------------------- | ---- | -------------- | +| uid | number | 是 | 表示应用ID。 | +| rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | 否 | 表示渲染器信息。 | +| rendererId | number | 否 | 音频流唯一id。 | + +**示例:** + +```js +let outputAudioRendererFilter = { + "uid":20010041, + "rendererInfo": { + "contentType":audio.ContentType.CONTENT_TYPE_MUSIC, + "streamUsage":audio.StreamUsage.STREAM_USAGE_MEDIA, + "rendererFlags":0 }, + "rendererId":0 }; +``` + ## AudioRenderer8+ 提供音频渲染的相关接口。在调用AudioRenderer的接口前,需要先通过[createAudioRenderer](#audiocreateaudiorenderer8)创建实例。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-bundle-BundleInstaller.md b/zh-cn/application-dev/reference/apis/js-apis-bundle-BundleInstaller.md index 003becc599ab3271b038237b783994d0751a8681..eee0ad7c629dfc3250e20aaaf144251294b07f01 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-bundle-BundleInstaller.md +++ b/zh-cn/application-dev/reference/apis/js-apis-bundle-BundleInstaller.md @@ -11,10 +11,6 @@ -## 系统能力 - -SystemCapability.BundleManager.BundleFramework - ## BundleInstaller.install install(bundleFilePaths: Array<string>, param: InstallParam, callback: AsyncCallback<InstallStatus>): void; @@ -29,6 +25,8 @@ ohos.permission.INSTALL_BUNDLE SystemCapability.BundleManager.BundleFramework +**系统API:** 此接口为系统接口,三方应用不支持调用 + **参数:** | 名称 | 类型 | 必填 | 描述 | @@ -51,6 +49,8 @@ ohos.permission.INSTALL_BUNDLE SystemCapability.BundleManager.BundleFramework +**系统API:** 此接口为系统接口,三方应用不支持调用 + **参数:** | 名称 | 类型 | 必填 | 描述 | @@ -59,7 +59,7 @@ SystemCapability.BundleManager.BundleFramework | param | [InstallParam](#installparam) | 是 | 指定安装所需的其他参数。 | | callback | AsyncCallback<[InstallStatus](#installstatus)> | 是 | 程序启动作为入参的回调函数,返回安装状态信息。 | -## BundleInstaller.recover +## BundleInstaller.recover8+ recover(bundleName: string, param: InstallParam, callback: AsyncCallback<InstallStatus>): void; @@ -73,6 +73,8 @@ ohos.permission.INSTALL_BUNDLE SystemCapability.BundleManager.BundleFramework +**系统API:** 此接口为系统接口,三方应用不支持调用 + **参数:** | 名称 | 类型 | 必填 | 描述 | @@ -81,17 +83,34 @@ SystemCapability.BundleManager.BundleFramework | param | [InstallParam](#installparam) | 是 | 指定安装所需的其他参数。 | | callback | AsyncCallback<[InstallStatus](#installstatus)> | 是 | 程序启动作为入参的回调函数,返回安装状态信息。 | +## HashParam9+ + +应用程序安装卸载信息 + + **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework + + **系统API:** 此接口为系统接口,三方应用不支持调用 + +| 名称 | 类型 | 说明 | +| ---------- | ------ | ---------------- | +| moduleName | string | 应用程序模块名称 | +| hashValue | string | 哈希值 | + ## InstallParam 应用程序安装卸载信息 **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 类型 | 说明 | -| ----------- | ------- | ------------------ | -| userId | number | 指示用户id | -| installFlag | number | 指示安装标志 | -| isKeepData | boolean | 指示参数是否有数据 | + **系统API:** 此接口为系统接口,三方应用不支持调用 + +| 名称 | 类型 | 说明 | +| ------------------------------ | ------------------------------ | ------------------ | +| userId | number | 指示用户id | +| installFlag | number | 指示安装标志 | +| isKeepData | boolean | 指示参数是否有数据 | +| hashParams9+ | Array<[HashParam](#hashparam)> | 哈希值参数 | +| crowdtestDeadline9+ | number | 测试包的被杀死时间 | ## InstallStatus @@ -99,7 +118,9 @@ SystemCapability.BundleManager.BundleFramework **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework + **系统API:** 此接口为系统接口,三方应用不支持调用 + | 名称 | 类型 | 可读 | 可写 | 说明 | | ------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------ | | status | bundle.[InstallErrorCode](js-apis-Bundle.md#installerrorcode) | 是 | 否 | 表示安装或卸载错误状态码 | -| statusMessage | string | 是 | 否 | 表示安装或卸载的字符串结果信息 | \ No newline at end of file +| statusMessage | string | 是 | 否 | 表示安装或卸载的字符串结果信息 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-bundle-PermissionDef.md b/zh-cn/application-dev/reference/apis/js-apis-bundle-PermissionDef.md index 62cc922bfff3498be6dbba4c3ecc935bbc6c7221..86621d7f8b6ae60fef3b10fcdc9b5ed9b461577f 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-bundle-PermissionDef.md +++ b/zh-cn/application-dev/reference/apis/js-apis-bundle-PermissionDef.md @@ -13,6 +13,8 @@ **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework + **系统API:** 此接口为系统接口,三方应用不支持调用 + | 名称 | 类型 | 可读 | 可写 | 说明 | | -------------- | ------ | ---- | ---- | -------------- | | permissionName | string | 是 | 否 | 用户权限名称 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-bundle-ShortcutInfo.md b/zh-cn/application-dev/reference/apis/js-apis-bundle-ShortcutInfo.md index 2a1eb5a9b7e34e472b584258e8014939910c785d..e79c3712d5b527ce8db7f448fb55819eb4bc6512 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-bundle-ShortcutInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-bundle-ShortcutInfo.md @@ -18,6 +18,8 @@ **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework + **系统API:** 此接口为系统接口,三方应用不支持调用 + | 名称 | 类型 | 可读 | 可写 | 说明 | | ------------------------- | ------ | ---- | ---- | -------------------- | | targetBundle | string | 是 | 否 | 快捷方式的目标捆绑包 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-bundle-remoteAbilityInfo.md b/zh-cn/application-dev/reference/apis/js-apis-bundle-remoteAbilityInfo.md index 37601a3c83847c49bdab956e6782934c4f5c5499..5780790fed9c45955d326b23850800ff9227a0f8 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-bundle-remoteAbilityInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-bundle-remoteAbilityInfo.md @@ -11,7 +11,9 @@ ## RemoteAbilityInfo - **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework + **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.DistributedBundleFramework + + **系统API:** 此接口为系统接口,三方应用不支持调用 | 名称 | 类型 | 可读 | 可写 | 说明 | | ----------- | -------------------------------------------- | ---- | ---- | ----------------------- | diff --git a/zh-cn/application-dev/reference/apis/js-apis-device-info.md b/zh-cn/application-dev/reference/apis/js-apis-device-info.md index c6b94fabd80056faea756b95e022670e55c4fce5..65c69aa3057f0c586e7d3e03980def48bf66e97a 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-device-info.md +++ b/zh-cn/application-dev/reference/apis/js-apis-device-info.md @@ -11,7 +11,8 @@ import deviceInfo from '@ohos.deviceInfo' ## 属性 -**系统能力**:以下各项对应的系统能力均为SystemCapability.Startup.SysInfo。 +**系统能力**:以下各项对应的系统能力均为SystemCapability.Startup.SystemInfo。 + **权限**:以下各项所需要的权限有所不同,详见下表。 | 名称 | 参数类型 | 可读 | 可写 | 描述 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-osAccount.md b/zh-cn/application-dev/reference/apis/js-apis-osAccount.md index 20148bd2fb9a95028724d9ce8b0754270bcf8e2c..ba85e9643d14dfd589bcf42683c08776adae58a5 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-osAccount.md +++ b/zh-cn/application-dev/reference/apis/js-apis-osAccount.md @@ -2281,6 +2281,8 @@ constructor() 创建Pin码认证的实例。 +此接口为系统接口,三方应用不支持调用。 + **系统能力**:SystemCapability.Account.OsAccount **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-request.md b/zh-cn/application-dev/reference/apis/js-apis-request.md index 2e8f3bed49b7b5ab43621d61e1c797bf1629874b..13c3e556e3ecd32d725d3c59f9536dabfe2382f5 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-request.md +++ b/zh-cn/application-dev/reference/apis/js-apis-request.md @@ -299,6 +299,48 @@ on(type: 'headerReceive', callback: (header: object) => void): void ``` +### on('complete' | 'fail')9+ + + on(type:'complete' | 'fail', callback: Callback<Array<TaskState>>): void; + +开启上传任务监听,异步方法,使用callback形式返回结果。 + +**需要权限**:ohos.permission.INTERNET + +**系统能力**: SystemCapability.MiscServices.Upload + +**参数:** + + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | type | string | 是 | 订阅的事件类型,取值为'complete',表示上传任务完成;取值为'fail',表示上传任务失败。| + | callback | function | 是 | 上传任务完成或失败的回调函数。 | + + 回调函数的参数 + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| taskstates | Array<[TaskState](#taskstate9)> | 是 | 上传任务返回结果 | + +**示例:** + + ```js + uploadTask.on('complete', function callback(taskStates) { + for (let i = 0; i < taskStates.length; i++ ) { + console.info("upOnComplete taskState:" + JSON.stringify(taskStates[i])); + } + } + ); + + uploadTask.on('fail', function callback(taskStates) { + for (let i = 0; i < taskStates.length; i++ ) { + console.info("upOnFail taskState:" + JSON.stringify(taskStates[i])); + } + } + ); + ``` + + ### off('progress') off(type: 'progress', callback?: (uploadedSize: number, totalSize: number) => void): void @@ -365,6 +407,47 @@ off(type: 'headerReceive', callback?: (header: object) => void): void ); ``` +### off('complete' | 'fail')9+ + + off(type:'complete' | 'fail', callback?: Callback<Array<TaskState>>): void; + +关闭上传任务监听,异步方法,使用callback形式返回结果。 + +**需要权限**:ohos.permission.INTERNET + +**系统能力**: SystemCapability.MiscServices.Upload + +**参数:** + + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | type | string | 是 | 订阅的事件类型,取值为'complete',表示上传任务完成;取值为'fail',表示上传任务失败。| + | callback | function | 否 | 上传任务完成或失败的回调函数。 | + + 回调函数的参数 + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| taskstates | Array<[TaskState](#taskstate9)> | 是 | 上传任务返回结果 | + +**示例:** + + ```js + uploadTask.off('complete', function callback(taskStates) { + for (let i = 0; i < taskStates.length; i++ ) { + console.info("upOnComplete taskState:" + JSON.stringify(taskStates[i])); + } + } + ); + + uploadTask.off('fail', function callback(taskStates) { + for (let i = 0; i < taskStates.length; i++ ) { + console.info("upOnFail taskState:" + JSON.stringify(taskStates[i])); + } + } + ); + ``` + ### remove @@ -444,6 +527,17 @@ remove(callback: AsyncCallback<boolean>): void | files | Array<[File](#file)> | 是 | 要上传的文件列表。请使用 multipart/form-data提交。 | | data | Array<[RequestData](#requestdata)> | 是 | 请求的表单数据。 | +## TaskState9+ + +**需要权限**:ohos.permission.INTERNET + +**系统能力**: 以下各项对应的系统能力均为SystemCapability.MiscServices.Upload。 + +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| path | string | 是 | 文件路径 | +| responseCode | number | 是 | 上传任务返回值 | +| message | string | 是 | 上传任务结果描述信息 | ## File @@ -1118,7 +1212,7 @@ resume(callback: AsyncCallback<void>): void | filePath7+ | string | 否 | 设置下载路径(默认在'internal://cache/'路径下)。
- filePath:'workspace/test.txt':默认路径下创建workspace路径,并将文件存储在workspace路径下。
- filePath:'test.txt':将文件存储在默认路径下。
- filePath:'workspace/':默认路径下创建workspace路径,并将文件存储在workspace路径下。 | | networkType | number | 否 | 设置允许下载的网络类型。
- NETWORK_MOBILE:0x00000001
- NETWORK_WIFI:0x00010000| | title | string | 否 | 设置下载会话标题。 | -| background | boolean | 否 | 后台任务通知开关,开启后可在通知中显示下载状态。 | +| background9+ | boolean | 否 | 后台任务通知开关,开启后可在通知中显示下载状态。 | ## DownloadInfo7+ diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-parameter.md b/zh-cn/application-dev/reference/apis/js-apis-system-parameter.md index 148570c628d44da3cfcc9c5857ebab7f70b879eb..2529125ef2283cf4b2a3f7ba145d54b16b0a5950 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-parameter.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-parameter.md @@ -17,7 +17,7 @@ getSync(key: string, def?: string): string 获取系统属性Key对应的值。 -**系统能力:** SystemCapability.Startup.SysInfo +**系统能力:** SystemCapability.Startup.SystemInfo **参数:** @@ -50,7 +50,7 @@ get(key: string, callback: AsyncCallback<string>): void 获取系统属性Key对应的值。 -**系统能力:** SystemCapability.Startup.SysInfo +**系统能力:** SystemCapability.Startup.SystemInfo **参数:** @@ -81,7 +81,7 @@ get(key: string, def: string, callback: AsyncCallback<string>): void 获取系统属性Key对应的值。 -**系统能力:** SystemCapability.Startup.SysInfo +**系统能力:** SystemCapability.Startup.SystemInfo **参数:** @@ -114,7 +114,7 @@ get(key: string, def?: string): Promise<string> 获取系统属性Key对应的值。 -**系统能力:** SystemCapability.Startup.SysInfo +**系统能力:** SystemCapability.Startup.SystemInfo **参数:** @@ -151,7 +151,7 @@ setSync(key: string, value: string): void 设置系统属性Key对应的值。 -**系统能力:** SystemCapability.Startup.SysInfo +**系统能力:** SystemCapability.Startup.SystemInfo **参数:** @@ -177,7 +177,7 @@ set(key: string, value: string, callback: AsyncCallback<void>): void 设置系统属性Key对应的值。 -**系统能力:** SystemCapability.Startup.SysInfo +**系统能力:** SystemCapability.Startup.SystemInfo **参数:** @@ -209,7 +209,7 @@ set(key: string, value: string): Promise<void> 设置系统属性Key对应的值。 -**系统能力:** SystemCapability.Startup.SysInfo +**系统能力:** SystemCapability.Startup.SystemInfo **参数:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-timer.md b/zh-cn/application-dev/reference/apis/js-apis-system-timer.md index d3cb1e9db5c47e89f6273b894c52c373b8a37c67..bcd9131746f6706d94042c9175cb3bd7208fadd1 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-timer.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-timer.md @@ -29,7 +29,7 @@ createTimer(options: TimerOptions, callback: AsyncCallback<number>): void | options | TimerOptions | 是 | const TIMER_TYPE_REALTIME: 设置为系统启动时间定时器,否则为walltime定时器;
const TIMER_TYPE_WAKEUP: 设置为唤醒定时器,否则为非唤醒;
const TIMER_TYPE_EXACT: 设置为精准定时器,否则为非精准定时器;
const TIMER_TYPE_IDLE: number: 设置为IDLE模式定时器,否则为非IDLE模式定时器(暂不支持) | | repeat | boolean | 是 | true 为循环定时器,false为单次定时器。 | | interval | number | 否 | 如果是循环定时器,repeat值应大于5000毫秒,非重复定时器置为0。 | -| wantAgent| wantAgent | 否 | 设置通知的wantagent,定时器到期后通知。 | +| wantAgent| wantAgent | 否 | 设置通知的wantagent,定时器到期后通知。(支持拉起鸿蒙应用MainAbility,暂不支持拉起SA) | **返回值:** @@ -40,17 +40,21 @@ createTimer(options: TimerOptions, callback: AsyncCallback<number>): void **示例:** ```js - var options = { - type:TIMER_TYPE_REALTIME, - repeat:false - } - systemTime.createTimer(options, (error, data) => { - if (error) { - console.error(`failed to systemTime.createTimer ` + JSON.stringify(error)); - return; - } - console.log(`systemTime.createTimer success data : ` + JSON.stringify(data)); - }); +export default { + systemTimer () { + var options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat: false + } + systemTimer.createTimer(options, (error, data) => { + if (error) { + console.error(`failed to systemTime.createTimer ` + JSON.stringify(error)); + return; + } + console.log(`systemTime.createTimer success data : ` + JSON.stringify(data)); + }); + } +} ``` @@ -69,7 +73,7 @@ createTimer(options: TimerOptions): Promise<number> | options | TimerOptions | 是 | const TIMER_TYPE_REALTIME: 设置为系统启动时间定时器,否则为walltime定时器;
const TIMER_TYPE_WAKEUP: 设置为唤醒定时器,否则为非唤醒;
const TIMER_TYPE_EXACT: 设置为精准定时器,否则为非精准定时器;
const TIMER_TYPE_IDLE: number: 设置为IDLE模式定时器,否则为非IDLE模式定时器(暂不支持) | | repeat | boolean | 是 | true 为循环定时器,false为单次定时器。 | | interval | number | 否 | 如果是循环定时器,repeat值应大于5000毫秒,非重复定时器置为0。 | -| wantAgent| wantAgent | 否 | 设置通知的wantagent,定时器到期后通知。 | +| wantAgent| wantAgent | 否 | 设置通知的wantagent,定时器到期后通知。(支持拉起鸿蒙应用MainAbility,暂不支持拉起SA) | **返回值:** @@ -80,15 +84,19 @@ createTimer(options: TimerOptions): Promise<number> **示例:** ```js - var options = { - type:TIMER_TYPE_REALTIME, - repeat:false - } - systemTime.createTimer(options).then((data) => { - console.log(`systemTime.createTimer success data : ` + JSON.stringify(data)); - }).catch((error) => { - console.error(`failed to systemTime.createTimer because ` + JSON.stringify(error)); - }); +export default { + systemTimer () { + var options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + systemTimer.createTimer(options).then((data) => { + console.log(`systemTime.createTimer success data : ` + JSON.stringify(data)); + }).catch((error) => { + console.error(`failed to systemTime.createTimer because ` + JSON.stringify(error)); + }); + } +} ``` @@ -111,18 +119,22 @@ startTimer(timer: number, triggerTime: number, callback: AsyncCallback<void&g **示例:** ```js - var options = { - type:TIMER_TYPE_REALTIME, - repeat:false - } - let timerId = systemTimer.Timer(options) - systemTime.startTimer(timerId, 10000, (error, data) => { - if (error) { - console.error(`failed to systemTime.startTimer ` + JSON.stringify(error)); - return; - } - console.log(`systemTime.startTimer success data : ` + JSON.stringify(data)); - }); +export default { + systemTimer () { + var options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = systemTimer.Timer(options) + systemTimer.startTimer(timerId, 10000, (error, data) => { + if (error) { + console.error(`failed to systemTime.startTimer ` + JSON.stringify(error)); + return; + } + console.log(`systemTime.startTimer success data : ` + JSON.stringify(data)); + }); + } +} ``` ## systemTime.startTimer @@ -144,16 +156,20 @@ startTimer(timer: number, triggerTime: number): Promise<void> **示例:** ```js - var options = { - type:TIMER_TYPE_REALTIME, - repeat:false - } - let timerId = systemTimer.Timer(options) - systemTime.startTimer(timerId, 10000).then((data) => { - console.log(`systemTime.startTimer success data : ` + JSON.stringify(data)); - }).catch((error) => { - console.error(`failed to systemTime.startTimer because ` + JSON.stringify(error)); - }); +export default { + systemTimer (){ + var options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = systemTimer.Timer(options) + systemTimer.startTimer(timerId, 10000).then((data) => { + console.log(`systemTime.startTimer success data : ` + JSON.stringify(data)); + }).catch((error) => { + console.error(`failed to systemTime.startTimer because ` + JSON.stringify(error)); + }); + } +} ``` @@ -174,19 +190,23 @@ stopTimer(timer: number, callback: AsyncCallback<void>): void **示例:** ```js - var options = { - type:TIMER_TYPE_REALTIME, - repeat:false - } - let timerId = systemTimer.Timer(options) - let startTimerRes = systemTimer.startTimer(timerId, 100000) - systemTime.stopTimer(timerId, (error, data) => { - if (error) { - console.error(`failed to systemTime.stopTimer ` + JSON.stringify(error)); - return; - } - console.log(`systemTime.stopTimer success data : ` + JSON.stringify(data)); - }); +export default { + systemTimer () { + var options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = systemTimer.Timer(options) + systemTimer.startTimer(timerId, 100000) + systemTimer.stoptTimer(timerId, 10000, (error, data) => { + if (error) { + console.error(`failed to systemTime.startTimer ` + JSON.stringify(error)); + return; + } + console.log(`systemTime.startTimer success data : ` + JSON.stringify(data)); + }); + } +} ``` @@ -207,17 +227,21 @@ stopTimer(timer: number): Promise<void> **示例:** ```js - var options = { - type:TIMER_TYPE_REALTIME, - repeat:false - } - let timerId = systemTimer.Timer(options) - let startTimerRes = systemTimer.startTimer(timerId, 100000) - systemTime.stopTimer(timerId).then((data) => { - console.log(`systemTime.stopTimer success data : ` + JSON.stringify(data)); - }).catch((error) => { - console.error(`failed to systemTime.stopTimer because ` + JSON.stringify(error)); - }); +export default { + systemTimer (){ + var options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = systemTimer.Timer(options) + systemTimer.startTimer(timerId, 100000) + systemTimer.stoptTimer(timerId, 10000).then((data) => { + console.log(`systemTime.startTimer success data : ` + JSON.stringify(data)); + }).catch((error) => { + console.error(`failed to systemTime.startTimer because ` + JSON.stringify(error)); + }); + } +} ``` @@ -238,20 +262,24 @@ destroyTimer(timer: number, callback: AsyncCallback<void>): void **示例:** ```js - var options = { - type:TIMER_TYPE_REALTIME, - repeat:false - } - let timerId = systemTimer.Timer(options) - let startTimerRes = systemTimer.startTimer(timerId, 100000) - let stopTimerRes = systemTimer.stopTimer(timerId) - systemTime.destroyTimer(timerId, (error, data) => { - if (error) { - console.error(`failed to systemTime.destroyTimer ` + JSON.stringify(error)); - return; - } - console.log(`systemTime.destroyTimer success data : ` + JSON.stringify(data)); - }); +export default { + systemTimer () { + var options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = systemTimer.Timer(options) + systemTimer.startTimer(timerId, 100000) + systemTimer.stopTimer(timerId) + systemTimer.destroyTimer(timerId, (error, data) => { + if (error) { + console.error(`failed to systemTime.startTimer ` + JSON.stringify(error)); + return; + } + console.log(`systemTime.startTimer success data : ` + JSON.stringify(data)); + }); + } +} ``` @@ -272,16 +300,20 @@ destroyTimer(timer: number): Promise<void> **示例:** ```js - var options = { - type:TIMER_TYPE_REALTIME, - repeat:false - } - let timerId = systemTimer.Timer(options) - let startTimerRes = systemTimer.startTimer(timerId, 100000) - let stopTimerRes = systemTimer.stopTimer(timerId) - systemTime.destroyTimer(timerId).then((data) => { - console.log(`systemTime.destroyTimer success data : ` + JSON.stringify(data)); - }).catch((error) => { - console.error(`failed to systemTime.destroyTimer because ` + JSON.stringify(error)); - }); +export default { + systemTimer (){ + var options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = systemTimer.Timer(options) + systemTimer.startTimer(timerId, 100000) + systemTimer.stopTimer(timerId) + systemTimer.destroytTimer(timerId, 10000).then((data) => { + console.log(`systemTime.startTimer success data : ` + JSON.stringify(data)); + }).catch((error) => { + console.error(`failed to systemTime.startTimer because ` + JSON.stringify(error)); + }); + } +} ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-uitest.md b/zh-cn/application-dev/reference/apis/js-apis-uitest.md index 3a8e4059e63aabfb82e7e4d4bc0329b11292f120..4980f07d68b1d7498adfe7c5cbe1b23f383f31ae 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-uitest.md +++ b/zh-cn/application-dev/reference/apis/js-apis-uitest.md @@ -1647,7 +1647,7 @@ async function demo() { fling(from: Point, to: Point, stepLen: number, speed: number): Promise\ -植入从给出的起始坐标点按照指定的间隔与速度滑向给出的目的坐标点的滑动操作。 +模拟手指滑动后脱离屏幕的快速滑动操作。 **系统能力**:SystemCapability.Test.UiTest @@ -1655,8 +1655,8 @@ fling(from: Point, to: Point, stepLen: number, speed: number): Promise\ | 参数名 | 类型 | 必填 | 说明 | | ------- | ---------------- | ---- | ------------------------------------------------------------ | -| from | [Point](#point9) | 是 | 起始点的坐标。 | -| to | [Point](#point9) | 是 | 目的点的坐标。 | +| from | [Point](#point9) | 是 | 手指接触屏幕的起始点坐标。 | +| to | [Point](#point9) | 是 | 手指离开屏幕时的坐标点。 | | stepLen | number | 是 | 间隔距离,单位:像素点。 | | speed | number | 是 | 滑动速率,范围:200-3000,不在范围内设为默认值为600,单位:像素点/秒。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-webgl.md b/zh-cn/application-dev/reference/apis/js-apis-webgl.md index 59e7001d787df56f44fe2ff37855d3866f06aa83..79e437f53cc4dc3b21ca70dd232eef7cf0e4d662 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-webgl.md +++ b/zh-cn/application-dev/reference/apis/js-apis-webgl.md @@ -7,6 +7,8 @@ WebGL标准图形API,对应OpenGL ES 2.0特性集。更多信息请参考[WebG > **说明:** > > 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 +> +> WebGL遵循OpenGL协议,不支持多线程调用。 ## 调用方式 diff --git a/zh-cn/application-dev/reference/apis/js-apis-webgl2.md b/zh-cn/application-dev/reference/apis/js-apis-webgl2.md index bd55508b7845035d678fc8a8dfd978092e5338b5..ab16b8697067334c78e85057dfe185f02ecd33dd 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-webgl2.md +++ b/zh-cn/application-dev/reference/apis/js-apis-webgl2.md @@ -7,6 +7,8 @@ WebGL标准图形API,对应OpenGL ES 3.0特性集。更多信息请参考[WebG > **说明:** > > 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 +> +> WebGL2遵循OpenGL协议,不支持多线程调用。 ## 调用方式 diff --git a/zh-cn/application-dev/reference/apis/js-apis-workScheduler.md b/zh-cn/application-dev/reference/apis/js-apis-workScheduler.md index 899d41aa44381b69b70098dd08de49c5e61738d8..c9012d9367bf1599c6101b51e67e55b555416a54 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-workScheduler.md +++ b/zh-cn/application-dev/reference/apis/js-apis-workScheduler.md @@ -40,12 +40,17 @@ startWork(work: WorkInfo): boolean ```js let workInfo = { workId: 1, - batteryLevel:50, batteryStatus:workScheduler.BatteryStatus.BATTERY_STATUS_LOW, isRepeat: false, isPersisted: true, bundleName: "com.example.myapplication", - abilityName: "MyExtension" + abilityName: "MyExtension", + parameters: { + mykey0: 1, + mykey1: "string value", + mykey2: true, + mykey3: 1.5 + } } var res = workScheduler.startWork(workInfo); console.info("workschedulerLog res:" + res); @@ -76,12 +81,17 @@ stopWork(work: WorkInfo, needCancel?: boolean): boolean ```js let workInfo = { workId: 1, - batteryLevel:50, batteryStatus:workScheduler.BatteryStatus.BATTERY_STATUS_LOW, isRepeat: false, isPersisted: true, bundleName: "com.example.myapplication", - abilityName: "MyExtension" + abilityName: "MyExtension", + parameters: { + mykey0: 1, + mykey1: "string value", + mykey2: true, + mykey3: 1.5 + } } var res = workScheduler.stopWork(workInfo, false); console.info("workschedulerLog res:" + res); @@ -299,6 +309,7 @@ isLastWorkTimeOut(workId: number): Promise\ | isPersisted | boolean | 否 | 是否持久化保存工作 | | isDeepIdle | boolean | 否 | 是否要求设备进入空闲状态 | | idleWaitTime | number | 否 | 空闲等待时间 | +| parameters | {[key: string]: any} | 否 | 携带参数信息 | ## NetworkType 触发工作的网络类型。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-worker.md b/zh-cn/application-dev/reference/apis/js-apis-worker.md index 662ee7143260064add5d3defcd473d823a5af274..c50af61ca67ee314cd7a5a770a57f83eac5436de 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-worker.md +++ b/zh-cn/application-dev/reference/apis/js-apis-worker.md @@ -27,10 +27,11 @@ Worker构造函数的选项信息,用于为Worker添加其他信息。 **系统能力:** 以下各项对应的系统能力均为SystemCapability.Utils.Lang。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| ---- | --------- | ---- | ---- | ---------------------- | -| type | "classic" | 是 | 是 | 按照指定方式执行脚本。 | -| name | string | 是 | 是 | Worker的名称。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| ------ | --------- | ---- | ---- | ---------------------- | +| type | "classic" | 是 | 是 | 按照指定方式执行脚本。 | +| name | string | 是 | 是 | Worker的名称。 | +| shared | boolean | 是 | 是 | Worker是否可以被分享。 | ## Worker @@ -438,7 +439,7 @@ Worker线程用于与宿主线程通信的类,通过postMessage接口发送消 ### postMessage -postMessage(message: Object, options?: PostMessageOptions): void +postMessage(messageObject: Object, options?: PostMessageOptions): void Worker向宿主线程发送消息。 diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001174104404.png b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001174104404.png new file mode 100644 index 0000000000000000000000000000000000000000..e370a44cf043fc34bd8891f57faad2cd2ca05707 Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001174104404.png differ diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001174264376.png b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001174264376.png new file mode 100644 index 0000000000000000000000000000000000000000..dfcb0c5e259b3f8d7375c21712249c1e847edd67 Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001174264376.png differ diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001174422914.png b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001174422914.png new file mode 100644 index 0000000000000000000000000000000000000000..bc28f5056c679e189543c8ad6fba67fb56db7655 Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001174422914.png differ diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001174582864.png b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001174582864.png new file mode 100644 index 0000000000000000000000000000000000000000..b54dbc2391d1a8f16312dd02dc3d65a35ea2626f Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001174582864.png differ diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001174582866.png b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001174582866.png new file mode 100644 index 0000000000000000000000000000000000000000..56d32d4cd371c5374b133cb81c9c077aaf7b110d Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001174582866.png differ diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219662661.png b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219662661.png new file mode 100644 index 0000000000000000000000000000000000000000..9c43caf5fdfd466eafc37b793f509a6bde2b885d Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219662661.png differ diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219662663.png b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219662663.png new file mode 100644 index 0000000000000000000000000000000000000000..5c5e360f249a2002ba68ad9b94bd7f66f5d6aab1 Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219662663.png differ diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219662665.png b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219662665.png new file mode 100644 index 0000000000000000000000000000000000000000..309d1c46f8bc396df5eaed381a5ffa2f0389d602 Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219662665.png differ diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219744201.png b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219744201.png new file mode 100644 index 0000000000000000000000000000000000000000..0d22570503febc7a7dcba0d1e870f49f32fe489a Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219744201.png differ diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219864153.png b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219864153.png new file mode 100644 index 0000000000000000000000000000000000000000..58293d5e874f2aa36ecaf7282ca9e4736318092f Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219864153.png differ diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_1501929990650.jpg b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_1501929990650.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ca0ec86c6c71b6c6daa60bf3ee43795f33568c64 Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_1501929990650.jpg differ diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-animatorproperty.md b/zh-cn/application-dev/reference/arkui-ts/ts-animatorproperty.md index a26ae2ca83d8601aebda814956a77c08e3b11cad..2372325ad9b0c0631aec9b003d353f14d749b6e7 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-animatorproperty.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-animatorproperty.md @@ -17,28 +17,10 @@ | 名称 | 参数类型 | 默认值 | 描述 | | ---------- | ---------------------------------------- | --------------- | ----------------------- | | duration | number | 1000 | 单位为毫秒,默认动画时长为1000毫秒。 | -| curve | Curve | Curve.Linear | 默认曲线为线性。 | +| curve | [Curve](ts-appendix-enums.md#curve) | Curve.Linear | 默认曲线为线性。 | | delay | number | 0 | 单位为毫秒,默认不延时播放。 | | iterations | number | 1 | 默认播放一次,设置为-1时表示无限次播放。 | -| playMode | [PlayMode](ts-appendix-enums.md#playmode枚举值说明) | PlayMode.Normal | 设置动画播放模式,默认播放完成后重头开始播放。 | - - -- Curve枚举说明 - | 名称 | 描述 | - | ------------------- | ---------------------------------------- | - | Linear | 表示动画从头到尾的速度都是相同的。 | - | Ease | 表示动画以低速开始,然后加快,在结束前变慢,CubicBezier(0.25, 0.1, 0.25, 1.0)。 | - | EaseIn | 表示动画以低速开始,CubicBezier(0.42, 0.0, 1.0, 1.0)。 | - | EaseOut | 表示动画以低速结束,CubicBezier(0.0, 0.0, 0.58, 1.0)。 | - | EaseInOut | 表示动画以低速开始和结束,CubicBezier(0.42, 0.0, 0.58, 1.0)。 | - | FastOutSlowIn | 标准曲线,cubic-bezier(0.4, 0.0, 0.2, 1.0)。 | - | LinearOutSlowIn | 减速曲线,cubic-bezier(0.0, 0.0, 0.2, 1.0)。 | - | FastOutLinearIn | 加速曲线,cubic-bezier(0.4, 0.0, 1.0, 1.0)。 | - | ExtremeDeceleration | 急缓曲线,cubic-bezier(0.0, 0.0, 0.0, 1.0)。 | - | Sharp | 锐利曲线,cubic-bezier(0.33, 0.0, 0.67, 1.0)。 | - | Rhythm | 节奏曲线,cubic-bezier(0.7, 0.0, 0.2, 1.0)。 | - | Smooth | 平滑曲线,cubic-bezier(0.4, 0.0, 0.4, 1.0)。 | - | Friction | 阻尼曲线,CubicBezier(0.2, 0.0, 0.2, 1.0)。 | +| playMode | [PlayMode](ts-appendix-enums.md#playmode) | PlayMode.Normal | 设置动画播放模式,默认播放完成后重头开始播放。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-appendix-enums.md b/zh-cn/application-dev/reference/arkui-ts/ts-appendix-enums.md index 597427749af2c3b2e81f4a0981b067b036ca72ce..edb8e2f69b526540d0e6a95be7981eda7071161f 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-appendix-enums.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-appendix-enums.md @@ -1,100 +1,424 @@ # 文档中涉及到的内置枚举值 -## Alignment枚举说明 +## Color -| 名称 | 描述 | -| -------- | -------- | -| TopStart | 顶部起始端。 | -| Top | 顶部横向居中。 | -| TopEnd | 顶部尾端。 | -| Start | 起始端纵向居中。 | -| Center | 横向和纵向居中。 | -| End | 尾端纵向居中。 | -| BottomStart | 底部起始端。 | -| Bottom | 底部横向居中。 | -| BottomEnd | 底部尾端。 | +| 颜色名称 | 颜色值 | 颜色示意 | +| ------------------------ | -------- | ------------------------------------------------------------ | +| Black | 0x000000 | ![zh-cn_image_0000001219864153](figures/zh-cn_image_0000001219864153.png) | +| Blue | 0x0000ff | ![zh-cn_image_0000001174104404](figures/zh-cn_image_0000001174104404.png) | +| Brown | 0xa52a2a | ![zh-cn_image_0000001219744201](figures/zh-cn_image_0000001219744201.png) | +| Gray | 0x808080 | ![zh-cn_image_0000001174264376](figures/zh-cn_image_0000001174264376.png) | +| Green | 0x008000 | ![zh-cn_image_0000001174422914](figures/zh-cn_image_0000001174422914.png) | +| Orange | 0xffa500 | ![zh-cn_image_0000001219662661](figures/zh-cn_image_0000001219662661.png) | +| Pink | 0xffc0cb | ![zh-cn_image_0000001219662663](figures/zh-cn_image_0000001219662663.png) | +| Red | 0xff0000 | ![zh-cn_image_0000001219662665](figures/zh-cn_image_0000001219662665.png) | +| White | 0xffffff | ![zh-cn_image_0000001174582866](figures/zh-cn_image_0000001174582866.png) | +| Yellow | 0xffff00 | ![zh-cn_image_0000001174582864](figures/zh-cn_image_0000001174582864.png) | +| Transparent9+ | rgba(0,0,0,0) | 透明色 | +## ImageFit -## Axis枚举说明 +| 名称 | 描述 | +| --------- | ------------------------------------------------------------ | +| Contain | 保持宽高比进行缩小或者放大,使得图片完全显示在显示边界内。 | +| Cover | 保持宽高比进行缩小或者放大,使得图片两边都大于或等于显示边界。 | +| Auto | 自适应显示 | +| Fill | 不保持宽高比进行放大缩小,使得图片充满显示边界。 | +| ScaleDown | 保持宽高比显示,图片缩小或者保持不变。 | +| None | 保持原有尺寸显示。 | -| 名称 | 描述 | -| -------- | -------- | -| Vertical | 方向为纵向。 | -| Horizontal | 方向为横向。 | +## BorderStyle +| 名称 | 描述 | +| ------ | ----------------------------------------------- | +| Dotted | 显示为一系列圆点,圆点半径为borderWidth的一半。 | +| Dashed | 显示为一系列短的方形虚线。 | +| Solid | 显示为一条实线。 | -## ItemAlign枚举说明 +## LineJoinStyle -| 名称 | 描述 | -| -------- | -------- | -| Auto | 使用Flex容器中默认配置。 | -| Start | 元素在Flex容器中,交叉轴方向首部对齐。 | -| Center | 元素在Flex容器中,交叉轴方向居中对齐。 | -| End | 元素在Flex容器中,交叉轴方向底部对齐。 | -| Stretch | 元素在Flex容器中,交叉轴方向拉伸填充,在未设置尺寸时,拉伸到容器尺寸。 | -| Baseline | 元素在Flex容器中,交叉轴方向文本基线对齐。 | +| 名称 | 描述 | +| ----- | -------------------- | +| Bevel | 使用斜角连接路径段。 | +| Miter | 使用尖角连接路径段。 | +| Round | 使用圆角连接路径段。 | +## TouchType -## LineCapStyle枚举说明 +| 名称 | 描述 | +| ------ | ------------------------------ | +| Down | 手指按下时触发。 | +| Up | 手指抬起时触发。 | +| Move | 手指按压态在屏幕上移动时触发。 | +| Cancel | 触摸事件取消时触发。 | -| 名称 | 描述 | -| -------- | -------- | -| Butt | 分割线两端为平行线。 | -| Round | 分割线两端为半圆。 | -| Square | 分割线两端为平行线。 | +## MouseButton +| 名称 | 描述 | +| ------- | ---------------- | +| Left | 鼠标左键。 | +| Right | 鼠标右键。 | +| Middle | 鼠标中键。 | +| Back | 鼠标左侧后退键。 | +| Forward | 鼠标左侧前进键。 | +| None | 无按键。 | -## PlayMode枚举值说明 +## MouseAction -| 名称 | 描述 | -| -------- | -------- | -| Normal | 动画按正常播放。 | -| Reverse | 动画反向播放。 | -| Alternate | 动画在奇数次(1、3、5...)正向播放,在偶数次(2、4、6...)反向播放。 | -| AlternateReverse | 动画在奇数次(1、3、5...)反向播放,在偶数次(2、4、6...)正向播放。 | +| 名称 | 描述 | +| ------- | -------------- | +| Press | 鼠标按键按下。 | +| Release | 鼠标按键松开。 | +| Move | 鼠标移动。 | +## Curve -## ImageRepeat枚举说明 +| 名称 | 描述 | +| ------------------- | ------------------------------------------------------------ | +| Linear | 表示动画从头到尾的速度都是相同的。 | +| Ease | 表示动画以低速开始,然后加快,在结束前变慢,CubicBezier(0.25, 0.1, 0.25, 1.0)。 | +| EaseIn | 表示动画以低速开始,CubicBezier(0.42, 0.0, 1.0, 1.0)。 | +| EaseOut | 表示动画以低速结束,CubicBezier(0.0, 0.0, 0.58, 1.0)。 | +| EaseInOut | 表示动画以低速开始和结束,CubicBezier(0.42, 0.0, 0.58, 1.0)。 | +| FastOutSlowIn | 标准曲线,cubic-bezier(0.4, 0.0, 0.2, 1.0)。 | +| LinearOutSlowIn | 减速曲线,cubic-bezier(0.0, 0.0, 0.2, 1.0)。 | +| FastOutLinearIn | 加速曲线,cubic-bezier(0.4, 0.0, 1.0, 1.0)。 | +| ExtremeDeceleration | 急缓曲线,cubic-bezier(0.0, 0.0, 0.0, 1.0)。 | +| Sharp | 锐利曲线,cubic-bezier(0.33, 0.0, 0.67, 1.0)。 | +| Rhythm | 节奏曲线,cubic-bezier(0.7, 0.0, 0.2, 1.0)。 | +| Smooth | 平滑曲线,cubic-bezier(0.4, 0.0, 0.4, 1.0)。 | +| Friction | 阻尼曲线,CubicBezier(0.2, 0.0, 0.2, 1.0)。 | -| 名称 | 描述 | -| -------- | -------- | -| X | 只在水平轴上重复绘制图片。 | -| Y | 只在竖直轴上重复绘制图片。 | -| XY | 在两个轴上重复绘制图片。 | -| NoRepeat | 不重复绘制图片。 | +## AnimationStatus +| 名称 | 描述 | +| ------- | ------------------ | +| Initial | 动画初始状态。 | +| Running | 动画处于播放状态。 | +| Paused | 动画处于暂停状态。 | +| Stopped | 动画处于停止状态。 | -## TextDecorationType枚举说明 +## FillMode -| 名称 | 描述 | -| -------- | -------- | -| Underline | 文字下划线修饰。 | -| LineThrough | 穿过文本的修饰线。 | -| Overline | 文字上划线修饰。 | -| None | 不使用文本装饰线。 | +| 名称 | 描述 | +| -------- | -------------------------------- | +| None | 播放完成后恢复初始状态。 | +| Forwards | 播放完成后保持动画结束时的状态。 | +## PlayMode -## TextCase枚举说明 +| 名称 | 描述 | +| ---------------- | ------------------------------------------------------------ | +| Normal | 动画按正常播放。 | +| Reverse | 动画反向播放。 | +| Alternate | 动画在奇数次(1、3、5...)正向播放,在偶数次(2、4、6...)反向播放。 | +| AlternateReverse | 动画在奇数次(1、3、5...)反向播放,在偶数次(2、4、6...)正向播放。 | -| 名称 | 描述 | -| -------- | -------- | -| Normal | 保持文本原有大小写。 | -| LowerCase | 文本采用全小写。 | -| UpperCase | 文本采用全大写。 | +## KeyType +| 名称 | 描述 | +| ---- | ---------- | +| Down | 按键按下。 | +| Up | 按键松开。 | -## BarState枚举说明 +## KeySource -| 名称 | 描述 | -| -------- | -------- | -| Off | 不显示。 | -| On | 常驻显示。 | -| Auto | 按需显示(触摸时显示,2s后消失)。 | -## LayoutDirection枚举说明 +| 名称 | 描述 | +| -------- | -------------------- | +| Unknown | 输入设备类型未知。 | +| Keyboard | 输入设备类型为键盘。 | -| 名称 | 描述 | -| -------- | -------- | -| Row | 主轴与行方向一致作为布局模式。 | -| Column | 主轴与列方向一致作为布局模式。 | -| RowReverse | 与Row相反方向进行布局。 | -| ColumnReverse | 与Column相反方向进行布局。 | \ No newline at end of file +## Edge + +| 名称 | 描述 | +| -------- | ---------------------- | +| Top | 竖直方向上边缘 | +| Center | 竖直方向居中位置 | +| Bottom | 竖直方向下边缘 | +| Baseline | 交叉轴方向文本基线位置 | +| Start | 水平方向起始位置 | +| Middle | 水平方向居中位置 | +| End | 水平方向末尾位置 | + +## Week + +| 名称 | 描述 | +| -------- | ---------------------- | +| Mon | 星期一 | +| Tue | 星期二 | +| Wed | 星期三 | +| Thur | 星期四 | +| Fri | 星期五 | +| Sat | 星期六 | +| Sun | 星期日 | + +## Direction + +| 名称 | 描述 | +| ---- | ---------------------- | +| Ltr | 元素从左到右布局。 | +| Rtl | 元素从右到左布局。 | +| Auto | 使用系统默认布局方向。 | + +## BarState + +| 名称 | 描述 | +| ---- | -------------------------------- | +| Off | 不显示。 | +| On | 常驻显示。 | +| Auto | 按需显示(触摸时显示,2s后消失)。 | + +## EdgeEffect + +| 名称 | 描述 | +| ------ | ------------------------------------------------------------ | +| Spring | 弹性物理动效,滑动到边缘后可以根据初始速度或通过触摸事件继续滑动一段距离,松手后回弹。 | +| Fade | 阴影效果,滑动到边缘后会有圆弧状的阴影。 | +| None | 滑动到边缘后无效果。 | + +## Alignment + +| 名称 | 描述 | +| ----------- | ---------------- | +| TopStart | 顶部起始端。 | +| Top | 顶部横向居中。 | +| TopEnd | 顶部尾端。 | +| Start | 起始端纵向居中。 | +| Center | 横向和纵向居中。 | +| End | 尾端纵向居中。 | +| BottomStart | 底部起始端。 | +| Bottom | 底部横向居中。 | +| BottomEnd | 底部尾端。 | + +## TransitionType + +| 名称 | 描述 | +| ------ | -------------------------------------------------- | +| All | 指定当前的Transition动效生效在组件的所有变化场景。 | +| Insert | 指定当前的Transition动效生效在组件的插入场景。 | +| Delete | 指定当前的Transition动效生效在组件的删除场景。 | + +## RelateType + +| 名称 | 描述 | +| ------ | ------------------------------- | +| FILL | 缩放当前子组件以填充满父组件 | +| FIT | 缩放当前子组件以自适应父组件 | + +## Visibility + +| 名称 | 描述 | +| ------- | -------------------------------- | +| Hidden | 隐藏,但参与布局进行占位。 | +| Visible | 显示。 | +| None | 隐藏,但不参与布局,不进行占位。 | + +## LineCapStyle + +| 名称 | 描述 | +| ------ | -------------------- | +| Butt | 分割线两端为平行线。 | +| Round | 分割线两端为半圆。 | +| Square | 分割线两端为平行线。 | + +## Axis + +| 名称 | 描述 | +| ---------- | ------------ | +| Vertical | 方向为纵向。 | +| Horizontal | 方向为横向。 | + +## HorizontalAlign + +| 名称 | 描述 | +| ------ | ------------------------ | +| Start | 按照语言方向起始端对齐。 | +| Center | 居中对齐,默认对齐方式。 | +| End | 按照语言方向末端对齐。 | + +## FlexAlign + +| 名称 | 描述 | +| ------------ | ------------------------------------------------------------ | +| Start | 元素在主轴方向首端对齐,第一个元素与行首对齐,同时后续的元素与前一个对齐。 | +| Center | 元素在主轴方向中心对齐,第一个元素与行首的距离与最后一个元素与行尾距离相同。 | +| End | 元素在主轴方向尾部对齐,最后一个元素与行尾对齐,其他元素与后一个对齐。 | +| SpaceBetween | Flex主轴方向均匀分配弹性元素,相邻元素之间距离相同。第一个元素与行首对齐,最后一个元素与行尾对齐。 | +| SpaceAround | Flex主轴方向均匀分配弹性元素,相邻元素之间距离相同。第一个元素到行首的距离和最后一个元素到行尾的距离是相邻元素之间距离的一半。 | +| SpaceEvenly | 距、第一个元素与行首的间距、最后一个元素到行尾的间距都完全一样。 | + +## ItemAlign + +| 名称 | 描述 | +| -------- | ------------------------------------------------------------ | +| Auto | 使用Flex容器中默认配置。 | +| Start | 元素在Flex容器中,交叉轴方向首部对齐。 | +| Center | 元素在Flex容器中,交叉轴方向居中对齐。 | +| End | 元素在Flex容器中,交叉轴方向底部对齐。 | +| Stretch | 元素在Flex容器中,交叉轴方向拉伸填充,在未设置尺寸时,拉伸到容器尺寸。 | +| Baseline | 元素在Flex容器中,交叉轴方向文本基线对齐。 | + +## FlexDirection + +| 名称 | 描述 | +| ------------- | ------------------------------ | +| Row | 主轴与行方向一致作为布局模式。 | +| RowReverse | 与Row方向相反方向进行布局。 | +| Column | 主轴与列方向一致作为布局模式。 | +| ColumnReverse | 与Column相反方向进行布局。 | + +## FlexWrap + +| 名称 | 描述 | +| ----------- | ------------------------------------------------- | +| NoWrap | Flex容器的元素单行/列布局,子项不允许超出容器。 | +| Wrap | Flex容器的元素多行/列排布,子项允许超出容器。 | +| WrapReverse | Flex容器的元素反向多行/列排布,子项允许超出容器。 | + +## VerticalAlign + +| 名称 | 描述 | +| ------ | ------------------------ | +| Top | 顶部对齐。 | +| Center | 居中对齐,默认对齐方式。 | +| Bottom | 底部对齐。 | + +## ImageRepeat + +| 名称 | 描述 | +| -------- | -------------------------- | +| X | 只在水平轴上重复绘制图片。 | +| Y | 只在竖直轴上重复绘制图片。 | +| XY | 在两个轴上重复绘制图片。 | +| NoRepeat | 不重复绘制图片。 | + +## ImageSize + +| 类型 | 描述 | +| ------- | ------------------------------------------------------------ | +| Cover | 默认值,保持宽高比进行缩小或者放大,使得图片两边都大于或等于显示边界。 | +| Contain | 保持宽高比进行缩小或者放大,使得图片完全显示在显示边界内。 | +| Auto | 保持原图的比例不变。 | + +## GradientDirection + +| 名称 | 描述 | +| ----------- | ---------- | +| Left | 从右向左。 | +| Top | 从下向上。 | +| Right | 从左向右。 | +| Bottom | 从上向下。 | +| LeftTop | 左上。 | +| LeftBottom | 左下。 | +| RightTop | 右上。 | +| RightBottom | 右下。 | +| None | 无。 | + +## SharedTransitionEffectType + +| 名称 | 描述 | +| ----------- | ---------- | +| Static | 目标页面元素的位置保持不变,可以配置透明度动画。目前,只有为重定向到目标页面而配置的静态效果才会生效。 | +| Exchange | 将源页面元素移动到目标页面元素位置并适当缩放。 | + +## FontStyle + +| 名称 | 描述 | +| ------ | ---------------- | +| Normal | 标准的字体样式。 | +| Italic | 斜体的字体样式。 | + +## FontWeight + +| 名称 | 描述 | +| ------- | -------------- | +| Lighter | 字体较细。 | +| Normal | 字体粗细正常。 | +| Regular | 字体粗细正常。 | +| Medium | 字体粗细适中。 | +| Bold | 字体较粗。 | +| Bolder | 字体非常粗。 | + +## TextAlign + +| 名称 | 描述 | +| ------ | -------------- | +| Start | 水平对齐首部。 | +| Center | 水平居中对齐。 | +| End | 水平对齐尾部。 | + +## TextOverflow + +| 名称 | 描述 | +| -------- | -------------------------------------- | +| Clip | 文本超长时进行裁剪显示。 | +| Ellipsis | 文本超长时显示不下的文本用省略号代替。 | +| None | 文本超长时不进行裁剪。 | + +## TextDecorationType + +| 名称 | 描述 | +| ----------- | ------------------ | +| Underline | 文字下划线修饰。 | +| LineThrough | 穿过文本的修饰线。 | +| Overline | 文字上划线修饰。 | +| None | 不使用文本装饰线。 | + +## TextCase + +| 名称 | 描述 | +| --------- | -------------------- | +| Normal | 保持文本原有大小写。 | +| LowerCase | 文本采用全小写。 | +| UpperCase | 文本采用全大写。 | + +## ResponseType8+ + +| 名称 | 描述 | +| ---------- | -------------------------- | +| LongPress | 通过长按触发菜单弹出。 | +| RightClick | 通过鼠标右键触发菜单弹出。 | + +## HoverEffect8+ + +| 名称 | 描述 | +| --------- | ---------------------------- | +| Auto | 使用组件的系统默认悬浮效果。 | +| Scale | 放大缩小效果。 | +| Highlight | 背景淡入淡出的强调效果。 | +| None | 不设置效果。 | + +## Placement8+ + +| 名称 | 描述 | +| ------------- | ------------------------------------------------------------ | +| Left | 气泡提示位于组件左侧,与组件左侧中心对齐。 | +| Right | 气泡提示位于组件右侧,与组件右侧中心对齐。 | +| Top | 气泡提示位于组件上侧,与组件上侧中心对齐。 | +| Bottom | 气泡提示位于组件下侧,与组件下侧中心对齐。 | +| TopLeft | 气泡提示位于组件上侧,从API Version 9开始,与组件左侧边缘对齐。 | +| TopRight | 气泡提示位于组件上侧,从API Version 9开始,与组件右侧边缘对齐。 | +| BottomLeft | 气泡提示位于组件下侧,从API Version 9开始,与组件左侧边缘对齐。 | +| BottomRight | 气泡提示位于组件下侧,从API Version 9开始,与组件右侧边缘对齐。 | +| LeftTop9+ | 气泡提示位于组件左侧,与组件上侧边缘对齐。 | +| LeftBottom9+ | 气泡提示位于组件左侧,与组件下侧边缘对齐。 | +| RightTop9+ | 气泡提示位于组件右侧,与组件上侧边缘对齐。 | +| RightBottom9+ | 气泡提示位于组件右侧,与组件下侧边缘对齐。 | + +## CopyOptions9+ + +| 名称 | 描述 | +| ----------- | -------------------- | +| None | 不支持复制粘贴。 | +| InApp | 支持应用内复制粘贴。 | +| LocalDevice | 支持设备内复制粘贴。 | +| CrossDevice | 支持跨设备复制粘贴。 | + +## HitTestMode9+ + +| 名称 | 描述 | +| ----------- | -------------------- | +| Default | 自身节点和子节点都响应触摸事件的命中测试,但会阻止被该节点屏蔽的其他节点的命中测试。 | +| Block | 自身节点响应触摸事件的命中测试,但阻止被该节点屏蔽的子节点和其他节点的命中测试。 | +| Transparent | 自身节点和子节点响应触摸事件的命中测试,并允许对被该节点屏蔽的其他节点进行命中测试。 | +| None | 自身节点不会响应触摸事件的命中测试,但子节点会对触摸事件进行命中测试。 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md index a613002c01b38521cf7d3a4f8d7d528234402a8e..21358428e35a161a66fdb16d6523a9c24d2972b5 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md @@ -45,25 +45,15 @@ Image(src: string | PixelMap | Resource) | 名称 | 参数类型 | 默认值 | 描述 | | --------------------- | ------------------------------------------------------- | ------------------------ | ------------------------------------------------------------ | | alt | string \| [Resource](../../ui/ts-types.md#resource类型) | - | 加载时显示的占位图,支持本地图片和网络图片。 | -| objectFit | ImageFit | ImageFit.Cover | 设置图片的缩放类型。 | +| objectFit | [ImageFit](ts-appendix-enums.md#imagefit) | ImageFit.Cover | 设置图片的缩放类型。 | | objectRepeat | [ImageRepeat](ts-appendix-enums.md#imagerepeat) | NoRepeat | 设置图片的重复样式。
> **说明:**
> - svg类型图源不支持该属性。 | | interpolation | [ImageInterpolation](#imageinterpolation) | ImageInterpolation.None | 设置图片的插值效果,即减轻低清晰度图片在放大显示的时候出现的锯齿问题,仅针对图片放大插值。
> **说明:**
> - svg类型图源不支持该属性。
> - PixelMap资源不支持该属性。 | | renderMode | [ImageRenderMode](#imagerendermode) | ImageRenderMode.Original | 设置图片渲染的模式。
> **说明:**
> - svg类型图源不支持该属性。 | | sourceSize | {
width: number,
height: number
} | - | 设置图片裁剪尺寸,将原始图片解码成pixelMap,指定尺寸的图片,单位为px。
> **说明:**
> PixelMap资源不支持该属性。 | | syncLoad8+ | boolean | false | 设置是否同步加载图片,默认是异步加载。同步加载时阻塞UI线程,不会显示占位图。 | -| copyOption9+ | [CopyOptions](#copyoptions) | CopyOptions.None | 设置图片是否可复制(SVG图片不支持复制)。 | +| copyOption9+ | [CopyOptions](ts-appendix-enums.md#copyoptions9) | CopyOptions.None | 设置图片是否可复制(SVG图片不支持复制)。 | | colorFilter9+ | [ColorFilter](../../ui/ts-types.md) | - | 给图像设置颜色滤镜效果。 | -### ImageFit - -| 名称 | 描述 | -| --------- | ------------------------------------------------------------ | -| Cover | 保持宽高比进行缩小或者放大,使得图片两边都大于或等于显示边界。 | -| Contain | 保持宽高比进行缩小或者放大,使得图片完全显示在显示边界内。 | -| Fill | 不保持宽高比进行放大缩小,使得图片充满显示边界。 | -| None | 保持原有尺寸显示。 | -| ScaleDown | 保持宽高比显示,图片缩小或者保持不变。 | - ### ImageInterpolation | 名称 | 描述 | @@ -80,15 +70,6 @@ Image(src: string | PixelMap | Resource) | Original | 按照原图进行渲染,包括颜色。 | | Template | 将图片渲染为模板图片,忽略图片的颜色信息。 | -### CopyOptions9+ - - | 名称 | 描述 | - | -------- | -------- | - | None | 不支持复制粘贴。 | - | InApp | 支持应用内复制粘贴。 | - | LocalDevice | 支持设备内复制粘贴。 | - | CrossDevice | 支持跨设备复制粘贴。 | - ## 事件 除支持[通用事件](ts-universal-events-click.md)外,还支持以下事件: @@ -171,6 +152,72 @@ struct ImageExample1 { ![zh-cn_image_0000001250492613](figures/zh-cn_image_0000001250492613.gif) + + +### 网络图片 + +加载网络图片时,默认网络超时是5分钟,建议使用alt配置加载时的占位图。如果需要更灵活的网络配置,可以使用SDK中提供的[HTTP](../../connectivity/http-request.md)工具包发送网络请求,接着将返回的数据解码为Image组件中的`PixelMap`,图片开发可参考[图片处理](../../media/image.md)。代码如下。 + +```tsx +// @ts-nocheck +import http from '@ohos.net.http'; +import ResponseCode from '@ohos.net.http'; +import image from '@ohos.multimedia.image' + + +@Entry +@Component +struct Index { + + // 先创建一个PixelMap状态变量用于接收网络图片 + @State image: PixelMap = undefined + + build() { + Column({space: 10}) { + Button("获取网络图片") + .onClick(() => { + this.httpRequest(); + }) + Image(this.image).height(100).width(100) + } + .width('100%') + .height('100%') + .padding(10) + } + + // 网络图片请求方法 + private httpRequest() { + let httpRequest = http.createHttp(); + + httpRequest.request( + "https://www.example.com/xxx.png", // 请填写一个具体的网络图片地址 + (error, data) => { + if(error) { + console.log("error code: " + error.code + ", msg: " + error.message) + } else { + let code = data.responseCode + if(ResponseCode.ResponseCode.OK == code) { + let imageSource = image.createImageSource(data.result) + let options = {alphaType: 0, // 透明度 + editable: false, // 是否可编辑 + pixelFormat: 3, // 像素格式 + scaleMode: 1, // 缩略值 + size: {height: 100, width: 100}} // 创建图片大小 + imageSource.createPixelMap(options).then((pixelMap) => { + this.image = pixelMap + }) + } else { + console.log("response code: " + code); + } + } + } + ) + } +} +``` + +**说明**:网络图片加载的请求方式、超时、额外请求参数等配置可以参考HTTP工具包中关于[`request()`](../../reference/apis/js-apis-http.md)请求方法的细节。 + ### 设置属性 ```ts diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md index 4a6b9cf615c2311c781b37c02cfac1a56e7017ea..7455098d02ebfd42f6752b30552540a0f031f9e0 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md @@ -27,12 +27,12 @@ ImageAnimator() | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | | images | Array<ImageFrameInfo> | [] | 是 | 设置图片帧信息集合。每一帧的帧信息(ImageFrameInfo)包含图片路径、图片大小、图片位置和图片播放时长信息,详见ImageFrameInfo属性说明。 | -| state | AnimationStatus | Initial | 否 | 默认为初始状态,用于控制播放状态。 | +| state | [AnimationStatus](ts-appendix-enums.md#animationstatus) | Initial | 否 | 默认为初始状态,用于控制播放状态。 | | duration | number | 1000 | 否 | 单位为毫秒,默认时长为1000ms;duration为0时,不播放图片;值的改变只会在下一次循环开始时生效;当images中任意一帧图片设置了单独的duration后,该属性设置无效。 | | reverse | boolean | false | 否 | 设置播放顺序。false表示从第1张图片播放到最后1张图片; true表示从最后1张图片播放到第1张图片。 | | fixedSize | boolean | true | 否 | 设置图片大小是否固定为组件大小。 true表示图片大小与组件大小一致,此时设置图片的width 、height 、top 和left属性是无效的。false表示每一张图片的width 、height 、top和left属性都要单独设置。 | | preDecode | number | 0 | 否 | 是否启用预解码,默认值为0,即不启用预解码,如该值设为2,则播放当前页时会提前加载后面两张图片至缓存以提升性能。 | -| fillMode | FillMode | Forwards | 否 | 设置动画开始前和结束后的状态,可选值参见FillMode说明。 | +| fillMode | [FillMode](ts-appendix-enums.md#fillmode) | Forwards | 否 | 设置动画开始前和结束后的状态,可选值参见FillMode说明。 | | iterations | number | 1 | 否 | 默认播放一次,设置为-1时表示无限次播放。 | - ImageFrameInfo属性说明 @@ -45,20 +45,6 @@ ImageAnimator() | left | [Length](../../ui/ts-types.md#长度类型) | 0 | 否 | 图片相对于组件左上角的横向坐标 | | duration | number | 0 | 否 | 每一帧图片的播放时长,单位毫秒 | -- AnimationStatus枚举说明 - | 名称 | 描述 | - | -------- | -------- | - | Initial | 动画初始状态。 | - | Running | 动画处于播放状态。 | - | Paused | 动画处于暂停状态。 | - | Stopped | 动画处于停止状态。 | - -- FillMode枚举值说明 - | 名称 | 描述 | - | -------- | -------- | - | None | 播放完成后恢复初始状态。 | - | Forwards | 播放完成后保持动画结束时的状态。 | - ## 事件 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-scrollbar.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-scrollbar.md index ed84c4fa91492933c5ce29f02d8e77fe02e699f7..7f389c6b596969ee99aa45d999e15de7d7732e17 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-scrollbar.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-scrollbar.md @@ -26,7 +26,7 @@ ScrollBar(value: ScrollBarOptions) | -------- | -------- | -------- | -------- | -------- | | scroller | [Scroller](ts-container-scroll.md#scroller) | 是 | - | 可滚动组件的控制器。用于与可滚动组件进行绑定。 | | direction | ScrollBarDirection | 否 | ScrollBarDirection.Vertical | 滚动条的方向,控制可滚动组件对应方向的滚动。 | - | state | BarState | 否 | BarState.Auto | 滚动条状态。 | + | state | [BarState](ts-appendix-enums.md#barstate) | 否 | BarState.Auto | 滚动条状态。 | > **说明:** > ScrollBar组件负责定义可滚动区域的行为样式,ScrollBar的子节点负责定义滚动条的行为样式。 @@ -37,14 +37,7 @@ ScrollBar(value: ScrollBarOptions) | 名称 | 描述 | | -------- | -------- | | Vertical | 纵向滚动条。 | - | Horizontal | 横向滚动条。 | - -- BarState枚举说明 - | 名称 | 描述 | - | -------- | -------- | - | On | 常驻显示。 | - | Off | 不显示。 | - | Auto | 按需显示(触摸时显示,无操作2s后消失)。 | + | Horizontal | 横向滚动条。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md index c916b4f8af89ae9baa5885fbdfa59983438fa2dd..d16a8db00031db071f89da3223ea6cb757db0277 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md @@ -30,54 +30,15 @@ Text(content?: string) | 名称 | 参数类型 | 默认值 | 描述 | | -------- | -------- | -------- | -------- | -| textAlign | TextAlign | TextAlign.Start | 设置多行文本的文本对齐方式。 | -| textOverflow | {overflow: TextOverflow} | {overflow: TextOverflow.Clip} | 设置文本超长时的显示方式。
**说明:**
文本截断是按字截断。例如,英文以单词为最小单位进行截断,若需要以字母为单位进行截断,可在字母间添加零宽空格:\u200B。
需配合`maxLines`使用,单独设置不生效。 | +| textAlign | [TextAlign](ts-appendix-enums.md#textalign) | TextAlign.Start | 设置多行文本的文本对齐方式。 | +| textOverflow | {overflow: [TextOverflow](ts-appendix-enums.md#textoverflow)} | {overflow: TextOverflow.Clip} | 设置文本超长时的显示方式。
**说明:**
文本截断是按字截断。例如,英文以单词为最小单位进行截断,若需要以字母为单位进行截断,可在字母间添加零宽空格:\u200B。
需配合`maxLines`使用,单独设置不生效。 | | maxLines | number | Infinity | 设置文本的最大行数。
**说明:**
默认情况下,文本是自动折行的,如果指定此参数,则文本最多不会超过指定的行。如果有多余的文本,可以通过 `textOverflow`来指定截断方式。 | | lineHeight | Length | - | 设置文本的文本行高,设置值不大于0时,不限制文本行高,自适应字体大小,Length为number类型时单位为fp。 | -| decoration | {
type: TextDecorationType,
color?: Color
} | {
type: TextDecorationType.None,
color: Color.Black
} | 设置文本装饰线样式及其颜色。 | +| decoration | {
type: [TextDecorationType](ts-appendix-enums.md#textdecorationtype),
color?: Color
} | {
type: TextDecorationType.None,
color: Color.Black
} | 设置文本装饰线样式及其颜色。 | | baselineOffset | Length | - | 设置文本基线的偏移量。 | -| textCase | TextCase | TextCase.Normal | 设置文本大小写。 | -| copyOption9+ | CopyOptions | CopyOptions.None | 组件支持设置文本是否可复制粘贴。 | - -- TextAlign枚举说明 - | 名称 | 描述 | - | -------- | -------- | - | Center | 文本居中对齐。 | - | Start | 根据文字书写相同的方向对齐。 | - | End | 根据文字书写相反的方向对齐。 | - -- TextOverflow枚举说明 - | 名称 | 描述 | - | -------- | -------- | - | Clip | 文本超长时进行裁剪显示。 | - | Ellipsis | 文本超长时显示不下的文本用省略号代替。 | - | None | 文本超长时不进行裁剪。 | - -- TextDecorationType枚举说明 - | 名称 | 描述 | - | -------- | -------- | - | Underline | 文字下划线修饰。 | - | LineThrough | 穿过文本的修饰线。 | - | Overline | 文字上划线修饰。 | - | None | 不使用文本装饰线。 | - -- TextCase枚举说明 +| textCase | [TextCase](ts-appendix-enums.md#textcase) | TextCase.Normal | 设置文本大小写。 | +| copyOption9+ | [CopyOptions](ts-appendix-enums.md#copyoptions9) | CopyOptions.None | 组件支持设置文本是否可复制粘贴。 | - | 名称 | 描述 | - | --------- | -------------------- | - | Normal | 保持文本原有大小写。 | - | LowerCase | 文本采用全小写。 | - | UpperCase | 文本采用全大写。 | - -- CopyOptions9+枚举说明 - - | 名称 | 描述 | - | -------- | -------- | - | None | 不支持复制粘贴。 | - | InApp | 支持应用内复制粘贴。 | - | LocalDevice | 支持设备内复制粘贴。 | - | CrossDevice | 支持跨设备复制粘贴。 | - > **说明:** > 不支持Text内同时存在文本内容和Span子组件。如果同时存在,只显示Span内的内容。 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textarea.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textarea.md index 28ea0cc9288f91c9ae26a6d54a595c7c69d84634..31b4d591397ecdb675ed1b4773e7a4afe7b81a10 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textarea.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textarea.md @@ -36,18 +36,11 @@ TextArea(value?:{placeholder?: string| Resource, text?: string| Resource, contro | ------------------------ | ---------------------------------------- | ----- | ---------------------------------------- | | placeholderColor | Color | - | 设置placeholder文本颜色。 | | placeholderFont | {
size?: number,
weight?:number \| [FontWeight](ts-universal-attributes-text-style.md),
family?: string,
style?: [FontStyle](ts-universal-attributes-text-style.md)
} | - | 设置placeholder文本样式:
- size: 设置文本尺寸,Length为number类型时,使用fp单位。
- weight: 设置文本的字体粗细,number类型取值[100, 900],取值间隔为100,默认为400,取值越大,字体越粗。
- family: 设置文本的字体列表。使用多个字体,使用','进行分割,优先级按顺序生效,例如:'Arial, sans-serif'。
- style: 设置文本的字体样式。 | -| textAlign | TextAlign | Start | 设置文本水平对齐方式。 | +| textAlign | [TextAlign](ts-appendix-enums.md#textalign) | Start | 设置文本水平对齐式。 | | caretColor | Color | - | 设置输入框光标颜色。 | | inputFilter8+ | {
value: [ResourceStr](../../ui/ts-types.md)8+,
error?: (value: string)
} | - | 通过正则表达式设置输入过滤器。满足表达式的输入允许显示,不满足的输入被忽略。仅支持单个字符匹配,不支持字符串匹配。例如:^(?=.\*\d)(?=.\*[a-z])(?=.\*[A-Z]).{8,10}$,不支持过滤8到10位的强密码。
- value:设置正则表达式。
- error:正则匹配失败时,返回被忽略的内容。 | | copyOption9+ | [CopyOptions](ts-basic-components-text.md) | CopyOptions.CrossDevice | 设置文本是否可复制。 | -- TextAlign枚举说明 - | 名称 | 描述 | - | ------ | ------- | - | Start | 水平对齐首部。 | - | Center | 水平居中对齐。 | - | End | 水平对齐尾部。 | - ## 事件 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md index 39ce8ae645b668bdc84e2283a9a5f7bfb919a177..b312f9fdf7f515188ef644d2472f79470e563c4e 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md @@ -91,10 +91,10 @@ fileAccess(fileAccess: boolean) @Entry @Component struct WebComponent { - controller:WebController = new WebController(); + controller: WebController = new WebController(); build() { Column() { - Web({ src:'www.example.com', controller:this.controller }) + Web({ src: 'www.example.com', controller: this.controller }) .fileAccess(true) } } @@ -648,10 +648,10 @@ onPrompt(callback: (event?: { url: string; message: string; value: string; resul @Entry @Component struct WebComponent { - controller:WebController = new WebController(); + controller: WebController = new WebController(); build() { Column() { - Web({ src:'www.example.com', controller:this.controller }) + Web({ src: 'www.example.com', controller: this.controller }) .onPrompt((event) => { console.log("url:" + event.url); console.log("message:" + event.message); @@ -1117,7 +1117,7 @@ onInterceptRequest9+(callback: (event?: { request: WebResourceRequest}) => WebRe @Entry @Component struct WebComponent { - controller:WebController = new WebController(); + controller: WebController = new WebController(); responseweb: WebResourceResponse = new WebResourceResponse(); heads:Header[] = new Array(); @State webdata: string = "\n" + @@ -1131,7 +1131,7 @@ onInterceptRequest9+(callback: (event?: { request: WebResourceRequest}) => WebRe "" build() { Column() { - Web({ src:'www.example.com', controller:this.controller }) + Web({ src: 'www.example.com', controller: this.controller }) .onInterceptRequest((event) => { console.log('url:' + event.request.getRequestUrl()); var head1:Header = { @@ -1181,36 +1181,37 @@ onHttpAuthRequest(callback: (event?: { handler: HttpAuthHandler, host: string, r @Entry @Component struct WebComponent { - controller:WebController = new WebController(); - httpAuth:boolean = false; + controller: WebController = new WebController(); + httpAuth: boolean = false; + build() { Column() { - Web({ src:'www.example.com', controller:this.controller }) - .onHttpAuthRequest((event) => { - AlertDialog.show({ - title: 'title', - message: 'text', - confirm: { - value: 'onConfirm', - action: () => { - this.httpAuth = event.handler.isHttpAuthInfoSaved(); - if (this.httpAuth == false) { - web.WebDataBase.saveHttpAuthCredentials( - event.host, - event.realm, - "2222", - "2222" - ) - event.handler.cancel(); + Web({ src: 'www.example.com', controller: this.controller }) + .onHttpAuthRequest((event) => { + AlertDialog.show({ + title: 'title', + message: 'text', + confirm: { + value: 'onConfirm', + action: () => { + this.httpAuth = event.handler.isHttpAuthInfoSaved(); + if (this.httpAuth == false) { + web.WebDataBase.saveHttpAuthCredentials( + event.host, + event.realm, + "2222", + "2222" + ) + event.handler.cancel(); + } } + }, + cancel: () => { + event.handler.cancel(); } - }, - cancel: () => { - event.handler.cancel(); - } + }) + return true; }) - return true; - }) } } } @@ -1232,25 +1233,25 @@ onPermissionRequest(callback: (event?: { request: PermissionRequest }) => void) @Entry @Component struct WebComponent { - controller:WebController = new WebController(); + controller: WebController = new WebController(); build() { Column() { - Web({ src:'www.example.com', controller:this.controller }) - .onPermissionRequest((event) => { - AlertDialog.show({ - title: 'title', - message: 'text', - confirm: { - value: 'onConfirm', - action: () => { - event.request.grant(event.request.getAccessibleResource()); + Web({ src: 'www.example.com', controller: this.controller }) + .onPermissionRequest((event) => { + AlertDialog.show({ + title: 'title', + message: 'text', + confirm: { + value: 'onConfirm', + action: () => { + event.request.grant(event.request.getAccessibleResource()); + } + }, + cancel: () => { + event.request.deny(); } - }, - cancel: () => { - event.request.deny(); - } + }) }) - }) } } } @@ -1282,10 +1283,10 @@ onContextMenuShow(callback: (event?: { param: WebContextMenuParam, result: WebCo @Entry @Component struct WebComponent { - controller:WebController = new WebController(); + controller: WebController = new WebController(); build() { Column() { - Web({ src:'www.example.com', controller:this.controller }) + Web({ src: 'www.example.com', controller: this.controller }) .onContextMenuShow((event) => { console.info("x coord = " + event.param.x()); console.info("link url = " + event.param.getLinkUrl()); @@ -2049,14 +2050,14 @@ backOrForward(step: number): void @Entry @Component struct WebComponent { - controller:WebController = new WebController(); + controller: WebController = new WebController(); build() { Column() { Button('backOrForward') .onClick(() => { this.controller.backOrForward(); }) - Web({ src:'www.example.com', controller:this.controller }) + Web({ src: 'www.example.com', controller: this.controller }) } } ``` diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-ability-component.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-ability-component.md index b0bfd71a88505c675658bca83cb2eda3d39851d7..c0e8b56e0b224a632cd98281e452c6da68d632b9 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-ability-component.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-ability-component.md @@ -2,7 +2,7 @@ > **说明:** > -> 该组件从API Version 9开始支持。 +> 该组件从API Version 9开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 > > 本组件均为系统接口,三方应用不支持调用。 @@ -11,28 +11,13 @@ ## 使用约束 -使用AbilityComponent必须是平台签名使用,并申请权限。 - AbilityComponent为独立层次渲染,不能再之上叠加其他显示内容。 AbilityComponent不支持处理输入事件,事件不经过当前Ability,直接分发给内部的Ability处理。 AbilityComponent需设置且只能设置width、height,且width、height不支持动态更新。 -被启动的Ability必须是resizeable。 - -被启动的Ability需要设置为多任务栏不显示。 - -## 权限列表 - -ohos.permission.INFUSE_EVENTS - -ohos.permission.CONTROL_ABILITY_STACKS - -ohos.permission.INTEGRATED_ABILITY - -ohos.permission.INTEGRATED_INTERIOR_WINDOW - +被拉起的Ability必须继承[WindowExtension](../apis/js-apis-application-WindowExtensionAbility.md)。 ## 子组件 @@ -43,19 +28,26 @@ ohos.permission.INTEGRATED_INTERIOR_WINDOW AbilityComponent(value: {want : Want}) -- 参数 - | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | - | -------- | -------- | -------- | -------- | -------- | - | want | [Want](../../reference/apis/js-apis-application-Want.md) | 是 | - | 默认加载的Ability描述。 | +**参数:** + +| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | +| -------- | -------- | -------- | -------- | -------- | +| want | [Want](../../reference/apis/js-apis-application-Want.md) | 是 | - | 默认加载的Ability描述。 | ## 事件 -| 名称 | 功能描述 | -| -------- | -------- | -| onConnect() => void | AbilityComponent环境启动完成时的回调,之后可使用AbilityComponent的方法。 | -| onDisconnect() => void | AbilityComponent环境销毁时的回调。 | +### onConnect + +onConnect() => void + +AbilityComponent环境启动完成时的回调,之后可使用AbilityComponent的方法。 + +### onDisconnect + +onDisconnect() => void +AbilityComponent环境销毁时的回调。 ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md index 57a07853dc1e3fc0f1a4162386082e5f1c19bdf0..e671bf7ad635b3ce3cf4698f68b1a5e6f5beeef7 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md @@ -30,10 +30,10 @@ AlphabetIndexer(value: {arrayValue : Array<string>, selected : number}) | 名称 | 参数类型 | 描述 | | -------- | -------- | -------- | -| selectedColor | Color | 选中文本文字颜色。 | -| popupColor | Color | 弹出提示文本字体颜色。 | -| selectedBackgroundColor | Color | 选中文本背景颜色。 | -| popupBackground | Color | 弹窗索引背景色。 | +| selectedColor | [ResourceColor](../../ui/ts-types.md) | 选中文本文字颜色。 | +| popupColor | [ResourceColor](../../ui/ts-types.md) | 弹出提示文本字体颜色。 | +| selectedBackgroundColor | [ResourceColor](../../ui/ts-types.md) | 选中文本背景颜色。 | +| popupBackground | [ResourceColor](../../ui/ts-types.md) | 弹窗索引背景色。 | | usingPopup | boolean | 是否使用弹出索引提示。 | | selectedFont | {
size?: number,
weight?: FontWeight,
family?: string,
style?: FontStyle
} | 选中文本文字样式。 | | popupFont | {
size?: number,
weight?: FontWeight,
family?: string,
style?: FontStyle
} | 弹出提示文本字体样式。 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-column.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-column.md index e618bdb2db9974a8686548e96a2bea53202ec68b..73899d2a5952044b515c76642749e3b37c0862cb 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-column.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-column.md @@ -32,16 +32,9 @@ Column(value:{space?: Length}) | 名称 | 参数类型 | 默认值 | 描述 | | -------- | -------- | -------- | -------- | -| alignItems | HorizontalAlign | HorizontalAlign.Center | 设置子组件在水平方向上的对齐格式。 | +| alignItems | [HorizontalAlign](ts-appendix-enums.md#horizontalalign) | HorizontalAlign.Center | 设置子组件在水平方向上的对齐格式。 | | justifyContent8+ | [FlexAlign](ts-container-flex.md) | FlexAlign.Start | 设置子组件在垂直方向上的对齐格式。 | -- HorizontalAlign枚举说明 - | 名称 | 描述 | - | -------- | -------- | - | Start | 按照语言方向起始端对齐。 | - | Center | 居中对齐,默认对齐方式。 | - | End | 按照语言方向末端对齐。 | - ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-flex.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-flex.md index 354136dd9454b0c5734f556e75d4f778d1a2ae33..d9379dc6f1b6b0fa4693f374bedce67f36643d1d 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-flex.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-flex.md @@ -26,36 +26,11 @@ Flex(options?: { direction?: FlexDirection, wrap?: FlexWrap, justifyContent?: F - 参数 | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | -------------- | ---------------------------------------- | ---- | ----------------- | ---------------------------------------- | - | direction | FlexDirection | 否 | FlexDirection.Row | 子组件在Flex容器上排列的方向,即主轴的方向。 | - | wrap | FlexWrap | 否 | FlexWrap.NoWrap | Flex容器是单行/列还是多行/列排列。 | - | justifyContent | FlexAlign | 否 | FlexAlign.Start | 子组件在Flex容器主轴上的对齐格式。 | - | alignItems | [ItemAlign](ts-appendix-enums.md#itemalign枚举说明) | 否 | ItemAlign.Stretch | 子组件在Flex容器交叉轴上的对齐格式。 | - | alignContent | FlexAlign | 否 | FlexAlign.Start | 交叉轴中有额外的空间时,多行内容的对齐方式。仅在wrap为Wrap或WrapReverse下生效。 | - -- FlexDirection枚举说明 - | 名称 | 描述 | - | ------------- | ---------------- | - | Row | 主轴与行方向一致作为布局模式。 | - | RowReverse | 与Row方向相反方向进行布局。 | - | Column | 主轴与列方向一致作为布局模式。 | - | ColumnReverse | 与Column相反方向进行布局。 | - -- FlexWrap枚举说明 - | 名称 | 描述 | - | ----------- | ------------------------------------------------- | - | NoWrap | Flex容器的元素单行/列布局,子项不允许超出容器。 | - | Wrap | Flex容器的元素多行/列排布,子项允许超出容器。 | - | WrapReverse | Flex容器的元素反向多行/列排布,子项允许超出容器。 | - -- FlexAlign枚举说明 - | 名称 | 描述 | - | ------------ | ------------------------------------------------------------ | - | Start | 元素在主轴方向首端对齐,第一个元素与行首对齐,同时后续的元素与前一个对齐。 | - | Center | 元素在主轴方向中心对齐,第一个元素与行首的距离与最后一个元素与行尾距离相同。 | - | End | 元素在主轴方向尾部对齐,最后一个元素与行尾对齐,其他元素与后一个对齐。 | - | SpaceBetween | Flex主轴方向均匀分配弹性元素,相邻元素之间距离相同。第一个元素与行首对齐,最后一个元素与行尾对齐。 | - | SpaceAround | Flex主轴方向均匀分配弹性元素,相邻元素之间距离相同。第一个元素到行首的距离和最后一个元素到行尾的距离是相邻元素之间距离的一半。 | - | SpaceEvenly | Flex主轴方向元素等间距布局,相邻元素之间的间距、第一个元素与行首的间距、最后一个元素到行尾的间距都完全一样。 | + | direction | [FlexDirection](ts-appendix-enums.md#flexdirection) | 否 | FlexDirection.Row | 子组件在Flex容器上排列的方向,即主轴的方向。 | + | wrap | [FlexWrap](ts-appendix-enums.md#flexwrap) | 否 | FlexWrap.NoWrap | Flex容器是单行/列还是多行/列排列。 | + | justifyContent | [FlexAlign](ts-appendix-enums.md#flexalign) | 否 | FlexAlign.Start | 子组件在Flex容器主轴上的对齐格式。 | + | alignItems | [ItemAlign](ts-appendix-enums.md#itemalign) | 否 | ItemAlign.Stretch | 子组件在Flex容器交叉轴上的对齐格式。 | + | alignContent | [FlexAlign](ts-appendix-enums.md#flexalign) | 否 | FlexAlign.Start | 交叉轴中有额外的空间时,多行内容的对齐方式。仅在wrap为Wrap或WrapReverse下生效。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md index 34102de39f2434a91437ac29a5f120119a4187aa..8e56157a7504fe5f600fcaa049e0b0685e42c44b 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md @@ -35,23 +35,16 @@ List(value:{space?: number | string, initialIndex?: number, scroller?: Scroller} | 名称 | 参数类型 | 默认值 | 描述 | | -------- | -------- | -------- | -------- | -| listDirection | [Axis](ts-appendix-enums.md#axis枚举说明) | Vertical | 设置List组件排列方向参照Axis枚举说明。 | +| listDirection | [Axis](ts-appendix-enums.md#axis) | Vertical | 设置List组件排列方向参照Axis枚举说明。 | | divider | {
strokeWidth: Length,
color?:Color,
startMargin?: Length,
endMargin?: Length
} | - | 用于设置ListItem分割线样式,默认无分割线。
strokeWidth: 分割线的线宽。
color: 分割线的颜色。
startMargin: 分割线距离列表侧边起始端的距离。
endMargin: 分割线距离列表侧边结束端的距离。 | | editMode | boolean | false | 声明当前List组件是否处于可编辑模式。 | -| edgeEffect | EdgeEffect | EdgeEffect.Spring | 滑动效果,目前支持的滑动效果参见EdgeEffect的枚举说明。 | +| edgeEffect | [EdgeEffect](ts-appendix-enums.md#edgeeffect) | EdgeEffect.Spring | 滑动效果,目前支持的滑动效果参见EdgeEffect的枚举说明。 | | chainAnimation | boolean | false | 用于设置当前list是否启用链式联动动效,开启后列表滑动以及顶部和底部拖拽时会有链式联动的效果。链式联动效果:list内的list-item间隔一定距离,在基本的滑动交互行为下,主动对象驱动从动对象进行联动,驱动效果遵循弹簧物理动效。
- false:不启用链式联动。
- true:启用链式联动。 | | multiSelectable8+ | boolean | false | 是否开启鼠标框选。
- false:关闭框选。
- true:开启框选。 | | restoreId8+ | number | - | 组件迁移标识符,标识后的组件在应用迁移时,组件状态会被迁移到被拉起方的同标识组件。
列表组件状态,包括起始位置显示的item序号。 | | lanes9+ | number \|
{
minLength: Length,
maxLength: Length
} | 1 | 以列模式为例(listDirection为Axis.Vertical):
lanes用于决定List组件在交叉轴方向按几列布局,规则如下:
- lanes为指定的数量时,根据指定的数量与List组件的交叉轴宽度来决定每列的宽度;
- lane设置了{minLength,maxLength}时,根据List组件的宽度自适应决定lanes数量(即列数),保证缩放过程中lane的宽度符合{minLength,maxLength}的限制。其中,minLength条件会被优先满足,即优先保证符合ListItem的宽度符合最小宽度限制。例如在列模式下,设置了{minLength: 40vp,maxLength: 60vp},则当List组件宽度为70vp时,ListItem为一列,并且根据alignListItem属性做靠左、居中或者靠右布局;当List组件宽度变化至80vp时,符合两倍的minLength,则ListItem自适应为两列。 | | alignListItem9+ | ListItemAlign | ListItemAlign.Center | List交叉轴方向宽度大于ListItem交叉轴宽度 * lanes时,ListItem在List交叉轴方向的布局方式,默认为居中。 | -- EdgeEffect枚举说明 - - | 名称 | 描述 | - | ------ | ------------------------------------------------------------ | - | Spring | 弹性物理动效,滑动到边缘后可以根据初始速度或通过触摸事件继续滑动一段距离,松手后回弹。 | - | None | 滑动到边缘后无效果。 | - - ListItemAlign枚举说明 | 名称 | 描述 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-listitem.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-listitem.md index b95950a3225f3da92341b06e82a50b80aad29e81..749bd049d31e648e2680b3c5a9b1a99b1e9c151a 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-listitem.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-listitem.md @@ -29,6 +29,7 @@ ListItem() | sticky | Sticky | Sticky.None | 设置ListItem吸顶效果,参见Sticky枚举描述。 | | editable | boolean | false | 当前ListItem元素是否可编辑,进入编辑模式后可删除。 | | selectable8+ | boolean | true | 当前ListItem元素是否可以被鼠标框选。
>  **说明:**
> 外层List容器的鼠标框选开启时,ListItem的框选才生效。 | +| swipeAction9+ | {
start?: CustomBuilder,
end?:CustomBuilder,
edgeEffect?: SwipeEdgeEffect,
} | - | 用于设置ListItem的划出组件。
start: ListItem向右划动时item左边的组件(List垂直布局时)或ListItem向下划动时item上方的组件(List水平布局时)。
end: ListItem向左划动时item右边的组件(List垂直布局时)或ListItem向上划动时item下方的组件(List水平布局时)。
edgeEffect: 滑动效果,参见SwipeEdgeEffect的枚举说明。
| - Sticky枚举说明 | 名称 | 描述 | @@ -36,6 +37,11 @@ ListItem() | None | 无吸顶效果。 | | Normal | 当前item吸顶。 | +- SwipeEdgeEffect9+枚举说明 + | 名称 | 描述 | + | -------- | -------- | + | Spring | ListItem划动距离超过划出组件大小后可以继续划动,松手后按照弹簧阻尼曲线回弹。 | + | None | ListItem划动距离不能超过划出组件大小。 | ## 事件 @@ -87,3 +93,54 @@ struct ListItemExample { ``` ![zh-cn_image_0000001219864159](figures/zh-cn_image_0000001219864159.gif) + +```ts +// xxx.ets +@Entry +@Component +struct ListItemExample2 { + @State message: string = 'Hello World' + + @Builder itemEnd() { + Row () { + Button("Del").margin("4vp") + Button("Set").margin("4vp") + }.padding("4vp").justifyContent(FlexAlign.SpaceEvenly) + } + + build() { + Column() { + List({space:10}) { + ListItem() { + Text(this.message) { + } + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + .swipeAction({ end:this.itemEnd}) + + ListItem() { + Text(this.message) { + } + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + .swipeAction({ start:this.itemEnd}) + } + } + .padding(10) + .backgroundColor(0xDCDCDC) + .width('100%') + .height('100%') + } +} +``` +![zh-cn_image_1501929990650](figures/zh-cn_image_1501929990650.jpg) diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-refresh.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-refresh.md index d89be4e18edec5281a8b28476ea881af73d5fa61..8c5527430e504aeb5e6bd830db7de0ae43be51ad 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-refresh.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-refresh.md @@ -58,7 +58,7 @@ struct RefreshExample { build() { Column() { - Refresh({ refreshing: this.isRefreshing, offset: 120, friction: 100 }) { + Refresh({ refreshing: $$this.isRefreshing, offset: 120, friction: 100 }) { Text('Pull Down and refresh: ' + this.counter) .fontSize(30) .margin(10) diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-row.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-row.md index 3e68e2a4d7cc369722144d2115470d39bbfd0292..a28a7e0277fe9bf309dfac23e4242c6e5aed90a5 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-row.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-row.md @@ -31,15 +31,8 @@ Row(value:{space?: Length}) | 名称 | 参数类型 | 默认值 | 描述 | | -------- | -------- | -------- | -------- | -| alignItems | VerticalAlign | VerticalAlign.Center | 在垂直方向上子组件的对齐格式。 | -| justifyContent8+ | [FlexAlign](ts-container-flex.md) | FlexAlign.Start | 设置子组件在水平方向上的对齐格式。 | - -- VerticalAlign枚举说明 - | 名称 | 描述 | - | -------- | -------- | - | Top | 顶部对齐。 | - | Center | 居中对齐,默认对齐方式。 | - | Bottom | 底部对齐。 | +| alignItems | [VerticalAlign](ts-appendix-enums.md#verticalalign) | VerticalAlign.Center | 在垂直方向上子组件的对齐格式。 | +| justifyContent8+ | [FlexAlign](ts-appendix-enums.md#flexalign) | FlexAlign.Start | 设置子组件在水平方向上的对齐格式。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-scroll.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-scroll.md index 72792ad454d0aed28fa9b4a6ae51c8fd54c48a5b..1573f14f9bd3518557156d71e6cd43921934689b 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-scroll.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-scroll.md @@ -29,7 +29,7 @@ Scroll(scroller?: Scroller) | 名称 | 参数类型 | 默认值 | 描述 | | -------------- | ---------------------------------------- | ------------------------ | --------- | | scrollable | ScrollDirection | ScrollDirection.Vertical | 设置滚动方法。 | -| scrollBar | [BarState](ts-appendix-enums.md#barstate枚举说明) | ScrollDirection.Auto | 设置滚动条状态。 | +| scrollBar | [BarState](ts-appendix-enums.md#barstate) | ScrollDirection.Auto | 设置滚动条状态。 | | scrollBarColor | Color | - | 设置滚动条的颜色。 | | scrollBarWidth | Length | - | 设置滚动条的宽度。 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-shape.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-shape.md index 50612a62b7e45725830b144f874740bb4f727c30..095ac835bafe618e2d71ca6d5f9bf33d8fd1bbc1 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-shape.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-shape.md @@ -42,21 +42,13 @@ Shape(value:{target?: PixelMap}) | stroke | Color | - | 否 | 边框颜色。 | | strokeDashArray | Array<Length> | [] | 否 | 设置边框的间隙。 | | strokeDashOffset | Length | 0 | 否 | 边框绘制起点的偏移量。 | -| strokeLineCap | [LineCapStyle](ts-appendix-enums.md#LineCapStyle枚举说明) | LineCapStyle.Butt | 否 | 路径端点绘制样式。 | -| strokeLineJoin | LineJoinStyle | LineJoinStyle.Miter | 否 | 边框拐角绘制样式。 | +| strokeLineCap | [LineCapStyle](ts-appendix-enums.md#linecapstyle) | LineCapStyle.Butt | 否 | 路径端点绘制样式。 | +| strokeLineJoin | [LineJoinStyle](ts-appendix-enums.md#linejoinstyle) | LineJoinStyle.Miter | 否 | 边框拐角绘制样式。 | | strokeMiterLimit | number | 4 | 否 | 锐角绘制成斜角的极限值。 | | strokeOpacity | number | 1 | 否 | 设置边框的不透明度。 | | strokeWidth | Length | 1 | 否 | 设置边框的宽度。 | | antiAlias | boolean | true | 否 | 是否开启抗锯齿。 | -- LineJoinStyle枚举说明 - | 名称 | 描述 | - | -------- | -------- | - | Bevel | 使用斜角连接路径段。 | - | Miter | 使用尖角连接路径段。 | - | Round | 使用圆角连接路径段。 | - - ## 示例 ```ts diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-explicit-animation.md b/zh-cn/application-dev/reference/arkui-ts/ts-explicit-animation.md index a29438b26c85c635e234f188e04c77de2b13cbfc..4a59a33dd391fbe053a231537fccef3a244170fa 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-explicit-animation.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-explicit-animation.md @@ -21,7 +21,7 @@ | curve | Curve \| Curves | Linear | 动画曲线。 | | delay | number | 0 | 单位为ms(毫秒),默认不延时播放。 | | iterations | number | 1 | 默认播放一次,设置为-1时表示无限次播放。 | - | playMode | PlayMode | Normal | 设置动画播放模式,默认播放完成后重头开始播放。 | + | playMode | [PlayMode](ts-appendix-enums.md#playmode) | Normal | 设置动画播放模式,默认播放完成后重头开始播放。 | - 接口 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md b/zh-cn/application-dev/reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md index 67c71bd0f8629e485eca456e700dddd7047c2ab2..014c46e0a07b17a03300aa52c99d881ccddf65b4 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md @@ -710,8 +710,8 @@ fillRect(x: number, y: number, w: number, h: number): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct FillRect { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -755,8 +755,8 @@ strokeRect(x: number, y: number, w: number, h: number): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct StrokeRect { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -799,8 +799,8 @@ clearRect(x: number, y: number, w: number, h: number): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct ClearRect { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -844,8 +844,8 @@ fillText(text: string, x: number, y: number): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct FillText { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -888,8 +888,8 @@ strokeText(text: string, x: number, y: number): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct StrokeText { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -940,8 +940,8 @@ measureText(text: string): TextMetrics - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct MeasureText { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -983,8 +983,8 @@ stroke(path?: Path2D): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct Stroke { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1022,8 +1022,8 @@ beginPath(): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct BeginPath { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1069,8 +1069,8 @@ moveTo(x: number, y: number): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct MoveTo { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1114,8 +1114,8 @@ lineTo(x: number, y: number): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct LineTo { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1153,8 +1153,8 @@ closePath(): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct ClosePath { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1200,8 +1200,8 @@ createPattern(image: ImageBitmap, repetition: string): CanvasPattern - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct CreatePattern { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1249,8 +1249,8 @@ bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct BezierCurveTo { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1296,8 +1296,8 @@ quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct QuadraticCurveTo { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1345,8 +1345,8 @@ arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct Arc { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1392,8 +1392,8 @@ arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct ArcTo { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1443,8 +1443,8 @@ ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct CanvasExample { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1489,8 +1489,8 @@ rect(x: number, y: number, width: number, height: number): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct CanvasExample { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1526,8 +1526,8 @@ fill(): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct Fill { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1563,8 +1563,8 @@ clip(): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct Clip { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1608,8 +1608,8 @@ rotate(rotate: number): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct Rotate { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1651,8 +1651,8 @@ scale(x: number, y: number): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct Scale { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1706,8 +1706,8 @@ transform方法对应一个变换矩阵,想对一个图形进行变化的时 - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct Transform { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1759,8 +1759,8 @@ setTransfrom方法使用的参数和transform()方法相同,但setTransform() - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct SetTransform { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1805,8 +1805,8 @@ translate(x: number, y: number): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct Translate { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1861,8 +1861,8 @@ drawImage(image: ImageBitmap | PixelMap, sx: number, sy: number, sWidth: number, - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct Index { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -1961,8 +1961,8 @@ putImageData(imageData: Object, dx: number, dy: number, dirtyX?: number, dirtyY? - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct PutImageData { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -2004,8 +2004,8 @@ restore(): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct CanvasExample { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -2038,8 +2038,8 @@ save(): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct CanvasExample { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -2080,8 +2080,8 @@ createLinearGradient(x0: number, y0: number, x1: number, y1: number): void - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct CreateLinearGradient { private settings: RenderingContextSettings = new RenderingContextSettings(true) @@ -2132,8 +2132,8 @@ createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, - 示例 ```ts -// xxx.ets -@Entry + // xxx.ets + @Entry @Component struct CreateRadialGradient { private settings: RenderingContextSettings = new RenderingContextSettings(true) diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-transition-animation-component.md b/zh-cn/application-dev/reference/arkui-ts/ts-transition-animation-component.md index 432d214f3c05bcc6c6fe2c062e7e7a3600bc71af..f439e53e9b6548de08120a7b33353d9a1fdc3cce 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-transition-animation-component.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-transition-animation-component.md @@ -16,19 +16,12 @@ - transition入参说明 | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | - | type | TransitionType | TransitionType.All | 否 | 默认包括组件新增和删除。
>  **说明:**
> 不指定Type时说明插入删除使用同一种效果。 | + | type | [TransitionType](ts-appendix-enums.md#transitiontype) | TransitionType.All | 否 | 默认包括组件新增和删除。
>  **说明:**
> 不指定Type时说明插入删除使用同一种效果。 | | opacity | number | 1 | 否 | 设置组件转场时的透明度效果,为插入时起点和删除时终点的值。 | | translate | {
x? : number,
y? : number,
z? : number
} | - | 否 | 设置组件转场时的平移效果,为插入时起点和删除时终点的值。
-x:横向的平移距离。
-y:纵向的平移距离。
-z:竖向的平移距离。 | | scale | {
x? : number,
y? : number,
z? : number,
centerX? : number,
centerY? : number
} | - | 否 | 设置组件转场时的缩放效果,为插入时起点和删除时终点的值。
-x:横向放大倍数(或缩小比例)。
-y:纵向放大倍数(或缩小比例)。
-z:竖向放大倍数(或缩小比例)。
- centerX、centerY缩放中心点。
- 中心点为0时,默认的是组件的左上角。
| | rotate | {
x?: number,
y?: number,
z?: number,
angle?: Angle,
centerX?: Length,
centerY?: Length
} | - | 否 | 设置组件转场时的旋转效果,为插入时起点和删除时终点的值。
-x:横向的旋转向量。
-y:纵向的旋转向量。
-z:竖向的旋转向量。
- centerX,centerY指旋转中心点。
- 中心点为(0,0)时,默认的是组件的左上角。 | -- TransitionType枚举说明 - | 名称 | 描述 | - | -------- | -------- | - | All | 指定当前的Transition动效生效在组件的所有变化场景。 | - | Insert | 指定当前的Transition动效生效在组件的插入场景。 | - | Delete | 指定当前的Transition动效生效在组件的删除场景。 | - ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-background.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-background.md index c0348500d73326566f6814ea31dfc20df6e79f5d..bc6dbe171b151d5fa70693139f12fac733cb9ac8 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-background.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-background.md @@ -17,17 +17,9 @@ | 名称 | 参数类型 | 默认值 | 描述 | | -------- | -------- | -------- | -------- | | backgroundColor | [ResourceColor](../../ui/ts-types.md) | - | 设置组件的背景色。 | -| backgroundImage | src: [ResourceStr](../../ui/ts-types.md),
repeat?: [ImageRepeat](ts-appendix-enums.md#imagerepeat枚举说明) | - | src参数:图片地址,支持网络图片资源和本地图片资源地址(不支持svg类型的图片)。
repeat参数:设置背景图片的重复样式,默认不重复。 | -| backgroundImageSize | {
width?: Length,
height?: Length
} \| ImageSize | Auto | 设置背景图像的高度和宽度。当输入为{width: Length, height: Length}对象时,如果只设置一个属性,则第二个属性保持图片原始宽高比进行调整。默认保持原图的比例不变。 | -| backgroundImagePosition | {
x?: Length,
y?: Length
} \| [Alignment](ts-appendix-enums.md#alignment枚举说明) | {
x: 0,
y: 0
} | 设置背景图在组件中显示位置。 | - - -- ImageSize枚举说明 - | 类型 | 描述 | - | -------- | -------- | - | Cover | 默认值,保持宽高比进行缩小或者放大,使得图片两边都大于或等于显示边界。 | - | Contain | 保持宽高比进行缩小或者放大,使得图片完全显示在显示边界内。 | - | Auto | 保持原图的比例不变。 | +| backgroundImage | src: [ResourceStr](../../ui/ts-types.md),
repeat?: [ImageRepeat](ts-appendix-enums.md#imagerepeat) | - | src参数:图片地址,支持网络图片资源和本地图片资源地址(不支持svg类型的图片)。
repeat参数:设置背景图片的重复样式,默认不重复。 | +| backgroundImageSize | {
width?: Length,
height?: Length
} \| [ImageSize](ts-appendix-enums.md#imagesize) | Auto | 设置背景图像的高度和宽度。当输入为{width: Length, height: Length}对象时,如果只设置一个属性,则第二个属性保持图片原始宽高比进行调整。默认保持原图的比例不变。 | +| backgroundImagePosition | {
x?: Length,
y?: Length
} \| [Alignment](ts-appendix-enums.md#alignment) | {
x: 0,
y: 0
} | 设置背景图在组件中显示位置。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-border.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-border.md index 155ba67a955f6785c010963c7df1df9f3888c0a6..b68b34b6ee28fdc00b4a4fc4d7b47214fc12df19 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-border.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-border.md @@ -20,7 +20,7 @@ | 名称 | 参数类型 | 默认值 | 描述 | | ------------ | ------------- | ----------------------- | ------------------------ | | border | BorderOptions | - | 统一边框样式设置接口。 | -| borderStyle | BorderStyle |  BorderStyle.Solid | 设置元素的边框样式。 | +| borderStyle | [BorderStyle](ts-appendix-enums.md#borderstyle) |  BorderStyle.Solid | 设置元素的边框样式。 | | borderWidth | Length | 0 | 设置元素的边框宽度。 | | borderColor | [ResourceColor](../../ui/ts-types.md) | - | 设置元素的边框颜色。 | | borderRadius | Length \| BorderRadiuses9+ | 0 | 设置元素的边框圆角半径。 | @@ -32,7 +32,7 @@ | width | [Length](../../ui/ts-types.md#长度类型) \| EdgeWidth9+ | 0 | 否 | 边框宽度。 | | color | [ResourceColor](../../ui/ts-types.md) \| EdgeColor9+ | 'Black' | 否 | 边框颜色。 | | radius | [Length](../../ui/ts-types.md#长度类型) \| BorderRadiuses9+ | 0 | 否 | 边框角度。 | - | style | BorderStyle \| EdgeStyle9+ | BorderStyle.Solid | 否 | 边框样式。 | + | style | [BorderStyle](ts-appendix-enums.md#borderstyle) \| EdgeStyle9+ | BorderStyle.Solid | 否 | 边框样式。 | - EdgeWidth9+对象说明 @@ -74,19 +74,10 @@ | 名称 | 参数类型 | 必填 | 默认值 | 描述 | | ------ | ----------- | ---- | ----------------- | -------------- | - | left | BorderStyle | 否 | BorderStyle.Solid | 左侧边框样式。 | - | right | BorderStyle | 否 | BorderStyle.Solid | 右侧边框样式。 | - | top | BorderStyle | 否 | BorderStyle.Solid | 上侧边框样式。 | - | bottom | BorderStyle | 否 | BorderStyle.Solid | 下侧边框样式。 | - -- BorderStyle枚举说明 - - | 名称 | 描述 | - | ------ | ----------------------------------------------- | - | Dotted | 显示为一系列圆点,圆点半径为borderWidth的一半。 | - | Dashed | 显示为一系列短的方形虚线。 | - | Solid | 显示为一条实线。 | - + | left | [BorderStyle](ts-appendix-enums.md#borderstyle) | 否 | BorderStyle.Solid | 左侧边框样式。 | + | right | [BorderStyle](ts-appendix-enums.md#borderstyle) | 否 | BorderStyle.Solid | 右侧边框样式。 | + | top | [BorderStyle](ts-appendix-enums.md#borderstyle) | 否 | BorderStyle.Solid | 上侧边框样式。 | + | bottom | [BorderStyle](ts-appendix-enums.md#borderstyle) | 否 | BorderStyle.Solid | 下侧边框样式。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-gradient-color.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-gradient-color.md index 453cb642e4494a6d0c7ab79f6fe813423306a361..7bb5c61e3019194b71102aca1d997bd03b079763 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-gradient-color.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-gradient-color.md @@ -17,27 +17,11 @@ | 名称 | 参数类型 | 默认值 | 描述 | | -------- | -------- | -------- | -------- | -| linearGradient | {
angle?: [Angle](../../ui/ts-types.md),
direction?: GradientDirection,
colors: Array<[ColorStop](../../ui/ts-types.md)>
repeating?: boolean
} | - | 线性渐变。
angle: 线性渐变的角度。
direction: 线性渐变的方向,设置angle后不生效。
colors: 为渐变的颜色描述。
repeating: 为渐变的颜色重复着色。 | +| linearGradient | {
angle?: [Angle](../../ui/ts-types.md),
direction?: [GradientDirection](ts-appendix-enums.md#gradientdirection),
colors: Array<[ColorStop](../../ui/ts-types.md)>
repeating?: boolean
} | - | 线性渐变。
angle: 线性渐变的角度。
direction: 线性渐变的方向,设置angle后不生效。
colors: 为渐变的颜色描述。
repeating: 为渐变的颜色重复着色。 | | sweepGradient | {
center: Point,
start?: angle,
end?: angle,
colors: Array<[ColorStop](../../ui/ts-types.md)>
repeating?: boolean
} | - | 角度渐变。
center:为角度渐变的中心点。
start:角度渐变的起点。
end:角度渐变的终点。
colors: 为渐变的颜色描述。
repeating: 为渐变的颜色重复着色。 | | radialGradient | {
center: Point,
radius: Length,
colors: Array<[ColorStop](../../ui/ts-types.md)>
repeating: boolean
} | - | 径向渐变。
center:径向渐变的中心点。
radius:径向渐变的半径。
colors: 为渐变的颜色描述。
repeating: 为渐变的颜色重复着色。 | -- GradientDirection枚举说明
- GradientDirection用于描述渐变方向。 - - | 名称 | 描述 | - | -------- | -------- | - | Left | 从右向左。 | - | Top | 从下向上。 | - | Right | 从左向右。 | - | Bottom | 从上向下。 | - | LeftTop | 左上。 | - | LeftBottom | 左下。 | - | RightTop | 右上。 | - | RightBottom | 右下。 | - | None | 无。 | - - ## 示例 ```ts diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-hover-effect.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-hover-effect.md index ba2fd891c3258f400766f0d51864d1d213f7a83d..e9c817aa0d974577a3964200085dbf0d72b9e4f4 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-hover-effect.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-hover-effect.md @@ -15,15 +15,7 @@ | 名称 | 参数类型 | 默认值 | 描述 | | -------- | -------- | -------- | -------- | -| hoverEffect | HoverEffect | HoverEffect.Auto | 设置当前组件悬停态下的悬浮效果。 | - -- HoverEffect 枚举说明 - | 名称 | 描述 | - | -------- | -------- | - | Auto | 使用组件的系统默认悬浮效果。 | - | Scale | 放大缩小效果。 | - | Highlight | 背景淡入淡出的强调效果。 | - | None | 不设置效果。 | +| hoverEffect | [HoverEffect](ts-appendix-enums.md#hovereffect8) | HoverEffect.Auto | 设置当前组件悬停态下的悬浮效果。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md index c6182fe332d009a5fb4d77424a5f59e6873826c4..2420c855d9ca1cc6c00ff298d718b1ec69e2f18b 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md @@ -16,21 +16,13 @@ | 名称 | 参数类型 | 默认值 | 描述 | | -------- | -------- | -------- | -------- | -| align | [Alignment](ts-appendix-enums.md#alignment枚举说明) | Center | 设置元素内容的对齐方式,只有当设置的width和height大小超过元素本身内容大小时生效。 | -| direction | Direction | Auto | 设置元素水平方向的布局,可选值参照Direction枚举说明。 | +| align | [Alignment](ts-appendix-enums.md#alignment) | Center | 设置元素内容的对齐方式,只有当设置的width和height大小超过元素本身内容大小时生效。 | +| direction | [Direction](ts-appendix-enums.md#direction) | Auto | 设置元素水平方向的布局,可选值参照Direction枚举说明。 | | position | {
x: Length,
y: Length
} | - | 使用绝对定位,设置元素锚点相对于父容器顶部起点偏移位置。在布局容器中,设置该属性不影响父容器布局,仅在绘制时进行位置调整。 | | markAnchor | {
x: Length,
y: Length
} | {
x: 0,
y: 0
} | 设置元素在位置定位时的锚点,以元素顶部起点作为基准点进行偏移。 | | offset | {
x: Length,
y: Length
} | {
x: 0,
y: 0
} | 相对布局完成位置坐标偏移量,设置该属性,不影响父容器布局,仅在绘制时进行位置调整。 | -- Direction枚举说明 - | 名称 | 描述 | - | -------- | -------- | - | Ltr | 元素从左到右布局。 | - | Rtl | 元素从右到左布局。 | - | Auto | 使用系统默认布局方向。 | - - ## 示例 ```ts diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md index e78fc1e0eb5b60153d67fff054116f9e48c5c7d4..a5261c90b6ca33c821d856efd398b5d8311fd334 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md @@ -17,7 +17,7 @@ | 名称 | 参数类型 | 默认值 | 描述 | | ---------------------------- | ---------------------------------------- | ---- | ---------------------------------- | | bindMenu | Array8+ | - | 给组件绑定菜单,点击后弹出菜单。弹出菜单项支持文本和自定义两种功能。 | -| bindContextMenu8+ | content: [CustomBuilder](../../ui/ts-types.md),
responseType: ResponseType | - | 给组件绑定菜单,触发方式为长按或者右键点击,弹出菜单项需要自定义。右键点击当前仅支持真机运行。 | +| bindContextMenu8+ | content: [CustomBuilder](../../ui/ts-types.md),
responseType: [ResponseType](ts-appendix-enums.md#responsetype8) | - | 给组件绑定菜单,触发方式为长按或者右键点击,弹出菜单项需要自定义。 | - MenuItem @@ -26,11 +26,6 @@ | value | string | 菜单项文本。 | | action | () => void | 点击菜单项的事件回调。 | -- ResponseType8+ - | 参数值 | 描述 | - | ---------- | ------------- | - | LongPress | 通过长按触发菜单弹出。 | - | RightClick | 通过鼠标右键触发菜单弹出。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md index e24a9061abb61bba245a09e10b5d9853995ead8b..1d4e2cd67a266c57d8af58ed2a347b977b8a1d33 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md @@ -33,7 +33,7 @@ | 名称 | 类型 | 必填 | 默认值 | 描述 | | -------- | -------- | -------- | -------- | -------- | | builder | () => any | 是 | - | 提示气泡内容的构造器。 | - | placement | Placement | 否 | Placement.Bottom | 气泡组件优先显示的位置,当前位置显示不下时,会自动调整位置。 | + | placement | [Placement](ts-appendix-enums.md#placement8) | 否 | Placement.Bottom | 气泡组件优先显示的位置,当前位置显示不下时,会自动调整位置。 | | arrowOffset9+ | Length | 否 | - | popup箭头在弹窗处的偏移。箭头在气泡上下方时,默认居左;箭头在气泡左右侧,默认居上。 | | maskColor | [ResourceColor](../../ui/ts-types.md) | 否 | - | 提示气泡遮障层的颜色。 | | popupColor | [ResourceColor](../../ui/ts-types.md) | 否 | - | 提示气泡的颜色。 | @@ -41,22 +41,6 @@ | autoCancel | boolean | 否 | true | 页面有操作时,是否自动关闭气泡 | | onStateChange | (isVisible: boolean) => void | 否 | - | 弹窗状态变化事件回调,参数为弹窗当前的显示状态。 | -- Placement8+枚举说明 - | 名称 | 描述 | - | -------- | -------- | - | Left | 气泡提示位于组件左侧,与组件左侧中心对齐。 | - | Right | 气泡提示位于组件右侧,与组件右侧中心对齐。 | - | Top | 气泡提示位于组件上侧,与组件上侧中心对齐。 | - | Bottom | 气泡提示位于组件下侧,与组件下侧中心对齐。 | - | TopLeft | 气泡提示位于组件上侧,从API Version 9开始,与组件左侧边缘对齐。 | - | TopRight | 气泡提示位于组件上侧,从API Version 9开始,与组件右侧边缘对齐。 | - | BottomLeft | 气泡提示位于组件下侧,从API Version 9开始,与组件左侧边缘对齐。 | - | BottomRight | 气泡提示位于组件下侧,从API Version 9开始,与组件右侧边缘对齐。 | - | LeftTop9+ | 气泡提示位于组件左侧,与组件上侧边缘对齐。 | - | LeftBottom9+ | 气泡提示位于组件左侧,与组件下侧边缘对齐。 | - | RightTop9+ | 气泡提示位于组件右侧,与组件上侧边缘对齐。 | - | RightBottom9+ | 气泡提示位于组件右侧,与组件下侧边缘对齐。 | - ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md index 940dcc2f820dd3c9ad35e862dbe1a3004a289bf2..900ed973ab009749201d7b351eef5e4c58a04008 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md @@ -20,29 +20,11 @@ | -------- | -------- | -------- | -------- | | fontColor | [ResourceColor](../../ui/ts-types.md) | - | 设置文本颜色。 | | fontSize | Length \| [Resource](../../ui/ts-types.md#resource类型) | - | 设置文本尺寸,Length为number类型时,使用fp单位。 | -| fontStyle | FontStyle | FontStyle.Normal | 设置文本的字体样式。 | -| fontWeight | number \| FontWeight \| string | FontWeight.FontWeightNormal | 设置文本的字体粗细,number类型取值[100, 900],取值间隔为100,默认为400,取值越大,字体越粗。
提供常用枚举值,参考:FontWeight枚举说明。 | +| fontStyle | [FontStyle](ts-appendix-enums.md#fontstyle) | FontStyle.Normal | 设置文本的字体样式。 | +| fontWeight | number \| [FontWeight](ts-appendix-enums.md#fontweight) \| string | FontWeight.FontWeightNormal | 设置文本的字体粗细,number类型取值[100, 900],取值间隔为100,默认为400,取值越大,字体越粗。
提供常用枚举值,参考:FontWeight枚举说明。 | | fontFamily | string \| [Resource](../../ui/ts-types.md#resource类型) | - | 设置文本的字体列表。使用多个字体,使用','进行分割,优先级按顺序生效。例如:'Arial, sans-serif'。 | -- FontStyle枚举说明 - | 名称 | 描述 | - | -------- | -------- | - | Normal | 标准的字体样式。 | - | Italic | 斜体的字体样式。 | - - -- FontWeight枚举说明 - | 名称 | 描述 | - | -------- | -------- | - | Lighter | 字体较细。 | - | Normal | 字体粗细正常。 | - | Regular | 字体粗细正常。 | - | Medium | 字体粗细适中。 | - | Bold | 字体较粗。 | - | Bolder | 字体非常粗。 | - - ## 示例 ```ts diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-visibility.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-visibility.md index 5f476bd46fe9c34d2b7dea57f89372690b374938..b0abcabf9ed01aad3ccd2a3c55b3bb92d89d2540 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-visibility.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-visibility.md @@ -16,15 +16,7 @@ | 名称 | 参数类型 | 默认值 | 描述 | | -------- | -------- | -------- | -------- | -| visibility | Visibility | Visibility.Visible | 控制当前组件显示或隐藏。注意,即使组件处于隐藏状态,在页面刷新时仍存在重新创建过程,因此当对性能有严格要求时建议使用[条件渲染](../../ui/ts-rending-control-syntax-if-else.md)代替。| - - -- Visibility枚举说明 - | 名称 | 描述 | - | -------- | -------- | - | Hidden | 隐藏,但参与布局进行占位。 | - | Visible | 显示。 | - | None | 隐藏,但不参与布局,不进行占位。 | +| visibility | [Visibility](ts-appendix-enums.md#visibility) | Visibility.Visible | 控制当前组件显示或隐藏。注意,即使组件处于隐藏状态,在页面刷新时仍存在重新创建过程,因此当对性能有严格要求时建议使用[条件渲染](../../ui/ts-rending-control-syntax-if-else.md)代替。| ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-key.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-key.md index cdcabb4b2d4b75a11d0c284074475e447be47ece..9648704c60c849956fa2d48d9ecee3f0186ecf14 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-key.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-key.md @@ -23,10 +23,10 @@ - 属性 | 属性名称 | 类型 | 描述 | | ------------------------------------- | --------------------------- | -------------------------- | - | type | [KeyType](#keytype枚举说明) | 按键的类型。 | + | type | [KeyType](ts-appendix-enums.md#keytype) | 按键的类型。 | | [keyCode](../apis/js-apis-keycode.md) | number | 按键的键码。 | | keyText | string | 按键的键值。 | - | keySource | [KeySource](#keysource枚举说明) | 触发当前按键的输入设备类型。 | + | keySource | [KeySource](ts-appendix-enums.md#keysource) | 触发当前按键的输入设备类型。 | | deviceId | number | 触发当前按键的输入设备ID。 | | metaKey | number | 按键发生时元键的状态,1表示按压态,0表示未按压态。 | | timestamp | number | 按键发生时的时间戳。 | @@ -37,21 +37,6 @@ | ---------------------------- | --------- | | stopPropagation(): void | 阻塞事件冒泡传递。 | -## KeyType枚举说明 -| 名称 | 描述 | -| ---- | ----- | -| Down | 按键按下。 | -| Up | 按键松开。 | - - -## KeySource枚举说明 -| 名称 | 描述 | -| -------- | ---------- | -| Unknown | 输入设备类型未知。 | -| Keyboard | 输入设备类型为键盘。 | - - - ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-touch.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-touch.md index 8df552afb72eb04fed908ba2d827804731a76e14..50a5e1a01227f057b2b74ef1baa4491e9fb08d85 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-touch.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-touch.md @@ -21,13 +21,13 @@ ## TouchEvent对象说明 - 属性 - | 属性名称 | 类型 | 描述 | - | ------------------- | ------------------------------------------------------------ | ---------------------------------- | - | type | TouchType | 触摸事件的类型。 | - | touches | Array<[TouchObject](#touchobject对象说明)> | 全部手指信息。 | - | changedTouches | Array<[TouchObject](#touchobject对象说明)> | 当前发生变化的手指信息。 | - | timestamp | number | 距离开机时间的时间戳,单位为毫秒。 | - | target8+ | [EventTarget](ts-universal-events-click.md#eventtarget8对象说明) | 被触摸元素对象。 | + | 属性名称 | 类型 | 描述 | + | ------------------- | ---------------------------------------- | ------------ | + | type | [TouchType](ts-appendix-enums.md#touchtype) | 触摸事件的类型。 | + | touches | Array<[TouchObject](#touchobject对象说明)> | 全部手指信息。 | + | changedTouches | Array<[TouchObject](#touchobject对象说明)> | 当前发生变化的手指信息。 | + | timestamp | number | 距离开机时间的时间戳,单位为毫秒。 | + | target8+ | [EventTarget](ts-universal-events-click.md#eventtarget8对象说明) | 被触摸元素对象。 | - 接口 @@ -39,23 +39,13 @@ ## TouchObject对象说明 | 属性名称 | 类型 | 描述 | | ------- | --------------------------- | ------------------- | -| type | [TouchType](#touchtype枚举说明) | 触摸事件的类型。 | +| type | [TouchType](ts-appendix-enums.md#touchtype) | 触摸事件的类型。 | | id | number | 手指唯一标识符。 | | screenX | number | 触摸点相对于设备屏幕左边沿的X坐标。 | | screenY | number | 触摸点相对于设备屏幕上边沿的Y坐标。 | | x | number | 触摸点相对于被触摸元素左边沿的X坐标。 | | y | number | 触摸点相对于被触摸元素上边沿的Y坐标。 | - -## TouchType枚举说明 -| 名称 | 描述 | -| ------ | ---------------------------------- | -| Down | 手指按下时触发。 | -| Up | 手指抬起时触发。 | -| Move | 手指按压态在屏幕上移动时触发。 | -| Cancel | 触摸交互过程中应用退到后台时触发。 | - - ## 示例 ```ts diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-mouse-key.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-mouse-key.md index 86299d7b4b1ee353c0b6fce533293a9f3af000b7..caa22dfdf12440230d217926f680cb6f66cbc2d9 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-mouse-key.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-mouse-key.md @@ -27,27 +27,8 @@ | screenY | number | 点击触点相对于屏幕左上角的y轴坐标。 | | x | number | 点击触点相对于当前组件左上角的x轴坐标。 | | y | number | 点击触点相对于当前组件左上角的y轴坐标。 | -| button | [MouseButton](#mousebutton类型说明) | 鼠标按键。 | -| action | [MouseAction](#mouseaction类型说明) | 事件动作。 | - - -## MouseButton类型说明 -| 属性名称 | 属性类型 | 描述 | -| ------- | ------ | -------- | -| Left | number | 鼠标左键。 | -| Right | number | 鼠标右键。 | -| Middle | number | 鼠标中键。 | -| Back | number | 鼠标左侧后退键。 | -| Forward | number | 鼠标左侧前进键。 | -| None | number | 无按键。 | - -## MouseAction类型说明 -| 属性名称 | 属性类型 | 描述 | -| ------- | ------ | ------- | -| Press | number | 鼠标按键按下。 | -| Release | number | 鼠标按键松开。 | -| Move | number | 鼠标移动。 | - +| button | [MouseButton](ts-appendix-enums.md#mousebutton) | 鼠标按键。 | +| action | [MouseAction](ts-appendix-enums.md#mouseaction) | 事件动作。 | ## 示例 diff --git a/zh-cn/application-dev/security/permission-list.md b/zh-cn/application-dev/security/permission-list.md index f15a1b52d743bd5bf5f42b1aaf62a4ff622f524b..5bf429018547b09461ad683fc4a72454356d7f13 100644 --- a/zh-cn/application-dev/security/permission-list.md +++ b/zh-cn/application-dev/security/permission-list.md @@ -20,7 +20,6 @@ | ohos.permission.REMOVE_CACHE_FILES | system_basic | system_grant | TRUE | 允许清理指定应用的缓存。 | | ohos.permission.REBOOT | system_basic | system_grant | TRUE | 允许应用重启设备。 | | ohos.permission.RUNNING_LOCK | normal | system_grant | TRUE | 允许应用获取运行锁,保证应用在后台的持续运行。 | -| ohos.permission.ACCESS_BIOMETRIC | normal | system_grant | FALSE | 允许应用使用生物特征识别能力进行身份认证。 | | ohos.permission.SET_TIME | system_basic | system_grant | TRUE | 允许应用修改系统时间。 | | ohos.permission.SET_TIME_ZONE | system_basic | system_grant | TRUE | 允许应用修改系统时区。 | | ohos.permission.
DOWNLOAD_SESSION_MANAGER | system_core | system_grant | TRUE | 允许应用管理下载任务会话。 | diff --git a/zh-cn/application-dev/task-management/background-task-dev-guide.md b/zh-cn/application-dev/task-management/background-task-dev-guide.md index 54998ed2986075f4b89942e277ef10a96ea0d6f9..67c170468111fed3a0e70ebd0fe32314eaa8ed7b 100644 --- a/zh-cn/application-dev/task-management/background-task-dev-guide.md +++ b/zh-cn/application-dev/task-management/background-task-dev-guide.md @@ -483,4 +483,4 @@ export default class BgTaskAbility extends Ability { 基于后台任务管理,有以下相关实例可供参考: -- [`BackgroundTaskManager`:后台任务管理(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ResourcesSchedule/BackgroundTaskManager) \ No newline at end of file +- [`BackgroundTaskManager`:后台任务管理(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ResourcesSchedule/BackgroundTaskManager) \ No newline at end of file diff --git a/zh-cn/application-dev/task-management/work-scheduler-dev-guide.md b/zh-cn/application-dev/task-management/work-scheduler-dev-guide.md index 412d2d2cb2cc5882fe29f1d83c39cf6eb0e3c0b5..daacaf58b8344957473b1e94bde03b7fb4a77fa9 100644 --- a/zh-cn/application-dev/task-management/work-scheduler-dev-guide.md +++ b/zh-cn/application-dev/task-management/work-scheduler-dev-guide.md @@ -50,6 +50,7 @@ storageRequest|存储状态| StorageRequest isRepeat|是否循环任务| boolean repeatCycleTime |循环间隔| number repeatCount |循环次数| number +parameters |携带参数信息| {[key: string]: any} **表3** 延迟任务回调接口 @@ -80,12 +81,17 @@ onWorkStop(work: WorkInfo): void; | 延迟调度任务结束回调 let workInfo = { workId: 1, - batteryLevel:50, batteryStatus:workScheduler.BatteryStatus.BATTERY_STATUS_LOW, isRepeat: false, isPersisted: true, bundleName: "com.example.myapplication", - abilityName: "MyExtension" + abilityName: "MyExtension", + parameters: { + mykey0: 1, + mykey1: "string value", + mykey2: true, + mykey3: 1.5 + } } var res = workScheduler.startWork(workInfo); console.info("workschedulerLog res:" + res); @@ -98,12 +104,17 @@ onWorkStop(work: WorkInfo): void; | 延迟调度任务结束回调 let workInfo = { workId: 1, - batteryLevel:50, batteryStatus:workScheduler.BatteryStatus.BATTERY_STATUS_LOW, isRepeat: false, isPersisted: true, bundleName: "com.example.myapplication", - abilityName: "MyExtension" + abilityName: "MyExtension", + parameters: { + mykey0: 1, + mykey1: "string value", + mykey2: true, + mykey3: 1.5 + } } var res = workScheduler.stopWork(workInfo, false); console.info("workschedulerLog res:" + res); diff --git a/zh-cn/application-dev/task-management/work-scheduler-overview.md b/zh-cn/application-dev/task-management/work-scheduler-overview.md index c2ce0fe7fe8203b8863fe8688131a33e9d1b0d5b..e4b8d34943147f81881be561c4649b8afeb5886c 100644 --- a/zh-cn/application-dev/task-management/work-scheduler-overview.md +++ b/zh-cn/application-dev/task-management/work-scheduler-overview.md @@ -28,4 +28,6 @@ (2)至少要设置一个满足的条件。 -(3)重复任务时间间隔至少20分钟,当设置重复任务时间间隔时,必须设置始终重复和重复次数中的一个。 \ No newline at end of file +(3)重复任务时间间隔至少20分钟,当设置重复任务时间间隔时,必须设置始终重复和重复次数中的一个。 + +(4)携带参数信息支持number、string、bool三种类型。 \ No newline at end of file diff --git a/zh-cn/application-dev/ui/ts-resource-access.md b/zh-cn/application-dev/ui/ts-resource-access.md index faa397e8dd850efa2974c4ae44a785c8865bdd5c..9415a2519b7efbd6a67cc43816672ac9ff1efb48 100644 --- a/zh-cn/application-dev/ui/ts-resource-access.md +++ b/zh-cn/application-dev/ui/ts-resource-access.md @@ -151,4 +151,4 @@ plural.json文件的内容如下: 针对访问应用资源,有以下相关实例可供参考: -- [`ResourceManager`:资源管理器(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/common/ResourceManager) +- [`ResourceManager`:资源管理器(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/common/ResourceManager) diff --git a/zh-cn/application-dev/ui/ts-types.md b/zh-cn/application-dev/ui/ts-types.md index ebbb98117fd142f5f8a4acbfbcbee944baa96f2f..dbbc20f706f64cf4ac969e9452fa1cea4afb5903 100644 --- a/zh-cn/application-dev/ui/ts-types.md +++ b/zh-cn/application-dev/ui/ts-types.md @@ -27,24 +27,7 @@ | 名称 | 类型定义 | 描述 | | ----- | ---------------------------------------- | ---------------------------------------- | -| Color | string \| number \| Color | 用于描述颜色信息,输入为string类型时,使用rgb或者rgba进行描述;输入为number类型是,使用HEX格式颜色;输入类型为Color枚举时,使用颜色枚举值。
- 'rgb(255, 255, 255)'。
- 'rgba(255, 255, 255, 1.0)'。
- HEX格式:0xrrggbb,0xaarrggbb,'\#FFFFFF'。
- 枚举格式:Color.Black,Color.White等。 | - - -当前支持的Color颜色枚举: - - -| 颜色名称 | 颜色值 | 颜色示意 | -| ------ | -------- | ---------------------------------------- | -| Black | 0x000000 | ![zh-cn_image_0000001219864153](figures/zh-cn_image_0000001219864153.png) | -| Blue | 0x0000ff | ![zh-cn_image_0000001174104404](figures/zh-cn_image_0000001174104404.png) | -| Brown | 0xa52a2a | ![zh-cn_image_0000001219744201](figures/zh-cn_image_0000001219744201.png) | -| Gray | 0x808080 | ![zh-cn_image_0000001174264376](figures/zh-cn_image_0000001174264376.png) | -| Green | 0x008000 | ![zh-cn_image_0000001174422914](figures/zh-cn_image_0000001174422914.png) | -| Orange | 0xffa500 | ![zh-cn_image_0000001219662661](figures/zh-cn_image_0000001219662661.png) | -| Pink | 0xffc0cb | ![zh-cn_image_0000001219662663](figures/zh-cn_image_0000001219662663.png) | -| Red | 0xff0000 | ![zh-cn_image_0000001219662665](figures/zh-cn_image_0000001219662665.png) | -| White | 0xffffff | ![zh-cn_image_0000001174582866](figures/zh-cn_image_0000001174582866.png) | -| Yellow | 0xffff00 | ![zh-cn_image_0000001174582864](figures/zh-cn_image_0000001174582864.png) | +| Color | string \| number \| [Color](../reference/arkui-ts/ts-appendix-enums.md#color) | 用于描述颜色信息,输入为string类型时,使用rgb或者rgba进行描述;输入为number类型是,使用HEX格式颜色;输入类型为Color枚举时,使用颜色枚举值。
- 'rgb(255, 255, 255)'。
- 'rgba(255, 255, 255, 1.0)'。
- HEX格式:0xrrggbb,0xaarrggbb,'\#FFFFFF'。
- 枚举格式:Color.Black,Color.White等。 | ## ColorStop类型 diff --git a/zh-cn/application-dev/ui/ui-js-animate-background-position-style.md b/zh-cn/application-dev/ui/ui-js-animate-background-position-style.md index b9fb5bb919b03b5c25a67a96f828c2f663527903..4019f5cd8bd4f6509a0b8904620f6f10112e8578 100644 --- a/zh-cn/application-dev/ui/ui-js-animate-background-position-style.md +++ b/zh-cn/application-dev/ui/ui-js-animate-background-position-style.md @@ -90,4 +90,4 @@ 针对background-position样式动画开发,有以下相关实例可供参考: -- [`JsImage`:基本动画(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsImage) \ No newline at end of file +- [`JsImage`:基本动画(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsImage) \ No newline at end of file diff --git a/zh-cn/application-dev/ui/ui-js-animate-transform.md b/zh-cn/application-dev/ui/ui-js-animate-transform.md index 4c642a9325fae074ba5a18b6e8d4c87b9a3c6106..c189f6380ba1191a159fcbfeccc562c73383e015 100644 --- a/zh-cn/application-dev/ui/ui-js-animate-transform.md +++ b/zh-cn/application-dev/ui/ui-js-animate-transform.md @@ -580,13 +580,13 @@ transform可以设置多个值并且多个值可同时设置,下面案例中 针对transform样式动画开发,有以下相关实例可供参考: -- [`JsAnimation`:动效示例应用(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAnimation) +- [`JsAnimation`:动效示例应用(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsAnimation) -- [`JsAnimationStyle`:动画与自定义字体(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAnimationStyle) +- [`JsAnimationStyle`:动画与自定义字体(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsAnimationStyle) -- [`Clock`:时钟(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/common/Clock) +- [`Clock`:时钟(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/common/Clock) -- [`JsAnimator`:动画(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAnimation) +- [`JsAnimator`:动画(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsAnimation) - [动画样式(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/AnimationDemo) diff --git a/zh-cn/application-dev/ui/ui-js-building-ui-component.md b/zh-cn/application-dev/ui/ui-js-building-ui-component.md index cf63923328412ea24648f56227297cc43d7d552d..6ef14c79e61a3b67a9c5b63053a80fb919c316c1 100755 --- a/zh-cn/application-dev/ui/ui-js-building-ui-component.md +++ b/zh-cn/application-dev/ui/ui-js-building-ui-component.md @@ -25,19 +25,19 @@ 针对组件开发,有以下相关实例可供参考: -- [`JsPanel`:内容展示面板(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsPanel) +- [`JsPanel`:内容展示面板(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsPanel) -- [`Popup`:气泡(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Popup) +- [`Popup`:气泡(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Popup) -- [`RefreshContainer`:下拉刷新容器(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/RefreshContainer) +- [`RefreshContainer`:下拉刷新容器(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/RefreshContainer) -- [`JSComponments`:Js组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JSComponments) +- [`JSComponments`:Js组件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JSComponments) -- [`JsUserRegistration`:用户注册(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsUserRegistration) +- [`JsUserRegistration`:用户注册(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsUserRegistration) - [`Badge`:事件标记控件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Badge) -- [`JsVideo`:视频播放(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/media/JsVideo) +- [`JsVideo`:视频播放(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/media/JsVideo) - [rating(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/RatingApplication) diff --git a/zh-cn/application-dev/ui/ui-js-building-ui-routes.md b/zh-cn/application-dev/ui/ui-js-building-ui-routes.md index 084977da6a4e67f865906d1a98e8041b6646594d..c3746e228c5869e14179969fbb4801c3425fa79f 100644 --- a/zh-cn/application-dev/ui/ui-js-building-ui-routes.md +++ b/zh-cn/application-dev/ui/ui-js-building-ui-routes.md @@ -89,4 +89,4 @@ export default { 针对页面路由开发,有以下相关实例可供参考: -- [`JsRouter`:页面路由(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsRouter) +- [`JsRouter`:页面路由(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsRouter) diff --git a/zh-cn/application-dev/ui/ui-js-component-tabs.md b/zh-cn/application-dev/ui/ui-js-component-tabs.md index f4d3ff942c7212f8e78954d83487ac6d23b3cc70..bcefedaf9826d965910f070ab753a07707de2b8c 100644 --- a/zh-cn/application-dev/ui/ui-js-component-tabs.md +++ b/zh-cn/application-dev/ui/ui-js-component-tabs.md @@ -314,4 +314,4 @@ export default { 针对tabs开发,有以下相关实例可供参考: -- [`Tabs`:页签容器(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Tabs) \ No newline at end of file +- [`Tabs`:页签容器(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Tabs) \ No newline at end of file diff --git a/zh-cn/application-dev/ui/ui-js-components-canvas.md b/zh-cn/application-dev/ui/ui-js-components-canvas.md index 36793f7a6bda601b634d748dc775be3e36318db2..c46363421b6eddd6b9c6376feb171017c0f39126 100644 --- a/zh-cn/application-dev/ui/ui-js-components-canvas.md +++ b/zh-cn/application-dev/ui/ui-js-components-canvas.md @@ -144,4 +144,4 @@ export default { 针对Canvas开发,有以下相关实例可供参考: -- [`JsCanvas`:画布组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsCanvas) +- [`JsCanvas`:画布组件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsCanvas) diff --git a/zh-cn/application-dev/ui/ui-js-components-chart.md b/zh-cn/application-dev/ui/ui-js-components-chart.md index 339f9697711518d9924aa1ac4112cece6dcdb39b..c00ce4dfb6a9acac1f460df1bd6d8a5420a06425 100644 --- a/zh-cn/application-dev/ui/ui-js-components-chart.md +++ b/zh-cn/application-dev/ui/ui-js-components-chart.md @@ -624,6 +624,6 @@ export default { 针对chart开发,有以下相关实例可供参考: -- [`chart`:图表组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/chart) +- [`chart`:图表组件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/chart) - [chart(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/SwitchApplication) diff --git a/zh-cn/application-dev/ui/ui-js-components-dialog.md b/zh-cn/application-dev/ui/ui-js-components-dialog.md index 7d01daf9b39b71b81bb41b9bd9bcda5fe2d3b01f..05e753c4412eda68a830176306585611241a3314 100644 --- a/zh-cn/application-dev/ui/ui-js-components-dialog.md +++ b/zh-cn/application-dev/ui/ui-js-components-dialog.md @@ -325,6 +325,6 @@ export default { 针对dialog开发,有以下相关实例可供参考: -- [`JsDialog`:页面弹窗(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsDialog) +- [`JsDialog`:页面弹窗(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsDialog) - [Dialog(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/DialogDemo) diff --git a/zh-cn/application-dev/ui/ui-js-components-grid.md b/zh-cn/application-dev/ui/ui-js-components-grid.md index b801fc9f30144d73e2888f3428d9f3665da09e91..77cbe83adbabdc4465859f4814d7b91db9e1731f 100644 --- a/zh-cn/application-dev/ui/ui-js-components-grid.md +++ b/zh-cn/application-dev/ui/ui-js-components-grid.md @@ -248,4 +248,4 @@ export default { 针对Grid开发,有以下相关实例可供参考: -- [`JsGrid`:栅格组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsGrid) +- [`JsGrid`:栅格组件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsGrid) diff --git a/zh-cn/application-dev/ui/ui-js-components-list.md b/zh-cn/application-dev/ui/ui-js-components-list.md index 44a12641e5574bed96564e0fc9bf9fb83663393d..f12ee8c2112ab5181d2304010e5ad7f8b0e1e1ee 100644 --- a/zh-cn/application-dev/ui/ui-js-components-list.md +++ b/zh-cn/application-dev/ui/ui-js-components-list.md @@ -314,4 +314,4 @@ export default { 针对list开发,有以下相关实例可供参考: -- [`JsList`:商品列表(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsList) \ No newline at end of file +- [`JsList`:商品列表(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsList) \ No newline at end of file diff --git a/zh-cn/application-dev/ui/ui-js-components-menu.md b/zh-cn/application-dev/ui/ui-js-components-menu.md index 94fd6501423e43f0b4e79b5e56968cc02f7f01aa..0170089d9706b71c1e259d48ffc704eb04920447 100644 --- a/zh-cn/application-dev/ui/ui-js-components-menu.md +++ b/zh-cn/application-dev/ui/ui-js-components-menu.md @@ -283,4 +283,4 @@ export default { 针对menu开发,有以下相关实例可供参考: -- [`JSMenu`:菜单(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JSMenu) +- [`JSMenu`:菜单(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JSMenu) diff --git a/zh-cn/application-dev/ui/ui-js-components-picker.md b/zh-cn/application-dev/ui/ui-js-components-picker.md index 2f8397377b8cd3456668c459f15aaeb704685ab8..646c083436684302c38eaa9c50fa41f1184af405 100644 --- a/zh-cn/application-dev/ui/ui-js-components-picker.md +++ b/zh-cn/application-dev/ui/ui-js-components-picker.md @@ -301,4 +301,4 @@ export default { 针对picker开发,有以下相关实例可供参考: -- [`Picker`:滑动选择器(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Picker) +- [`Picker`:滑动选择器(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Picker) diff --git a/zh-cn/application-dev/ui/ui-js-components-slider.md b/zh-cn/application-dev/ui/ui-js-components-slider.md index abac0828428567207a22929ee5a4bfb0912343d8..f50becce36671bb9e6309ecd3882748e9ec87fa1 100644 --- a/zh-cn/application-dev/ui/ui-js-components-slider.md +++ b/zh-cn/application-dev/ui/ui-js-components-slider.md @@ -217,6 +217,6 @@ export default{ 针对slider开发,有以下相关实例可供参考: -- [`Slider`:滑动条(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Slider) +- [`Slider`:滑动条(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Slider) - [slider(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/SliderApplication) \ No newline at end of file diff --git a/zh-cn/application-dev/ui/ui-js-components-stepper.md b/zh-cn/application-dev/ui/ui-js-components-stepper.md index 73e53835e900f45a95307676935570c64a9d6dd4..6efaf995e06f4f94cce553c980f226c8ff9460ca 100644 --- a/zh-cn/application-dev/ui/ui-js-components-stepper.md +++ b/zh-cn/application-dev/ui/ui-js-components-stepper.md @@ -408,4 +408,4 @@ export default { 针对stepper开发,有以下相关实例可供参考: -- [`StepNavigator`:步骤导航器(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/StepNavigator) +- [`StepNavigator`:步骤导航器(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/StepNavigator) diff --git a/zh-cn/application-dev/ui/ui-js-components-svg-overview.md b/zh-cn/application-dev/ui/ui-js-components-svg-overview.md index 601ff8c6d62e4d4ac08e005adfe3d14a969feef6..f3ee0f5ce2ab3bd80222e8f8bc8bdc65dfa4e965 100644 --- a/zh-cn/application-dev/ui/ui-js-components-svg-overview.md +++ b/zh-cn/application-dev/ui/ui-js-components-svg-overview.md @@ -87,4 +87,4 @@ svg{ 针对Svg开发,有以下相关实例可供参考: -- [`JsSvg`:可缩放矢量图形(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsSvg) +- [`JsSvg`:可缩放矢量图形(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsSvg) diff --git a/zh-cn/application-dev/ui/ui-js-components-swiper.md b/zh-cn/application-dev/ui/ui-js-components-swiper.md index af41ada3d1fa375720723e8f8de83ac2d0009bc8..ce1f9fbaf7e233058725596061a857c882f2b92e 100644 --- a/zh-cn/application-dev/ui/ui-js-components-swiper.md +++ b/zh-cn/application-dev/ui/ui-js-components-swiper.md @@ -370,4 +370,4 @@ export default { 针对swiper开发,有以下相关实例可供参考: -- [`Swiper`:内容滑动容器(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Swiper) +- [`Swiper`:内容滑动容器(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Swiper) diff --git a/zh-cn/application-dev/ui/ui-js-components-text.md b/zh-cn/application-dev/ui/ui-js-components-text.md index 807d43c11da95140f390f2799696e8a539ab29f3..61686969aa4028ad97b40ac11545386e61a55494 100644 --- a/zh-cn/application-dev/ui/ui-js-components-text.md +++ b/zh-cn/application-dev/ui/ui-js-components-text.md @@ -276,4 +276,4 @@ export default { 针对text开发,有以下相关实例可供参考: -- [`JstextComponents`:基础组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsBasicComponents) +- [`JstextComponents`:基础组件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsBasicComponents) diff --git a/zh-cn/application-dev/ui/ui-js-components-toolbar.md b/zh-cn/application-dev/ui/ui-js-components-toolbar.md index cf277d075e8d666a84f4ea2d23d278d39b6c30d8..0944543b5d6abf1557f9aeda2141c909fecb9537 100644 --- a/zh-cn/application-dev/ui/ui-js-components-toolbar.md +++ b/zh-cn/application-dev/ui/ui-js-components-toolbar.md @@ -235,4 +235,4 @@ export default { 针对toolbar开发,有以下相关实例可供参考: -- [`Toolbar`:工具栏(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Toolbar) +- [`Toolbar`:工具栏(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Toolbar) diff --git a/zh-cn/application-dev/ui/ui-js-custom-components.md b/zh-cn/application-dev/ui/ui-js-custom-components.md index ee18744f78afe32fd1150662abe67fe7f8b650cd..1b89f629196dd2d46d03be566c553e04429c2f0d 100755 --- a/zh-cn/application-dev/ui/ui-js-custom-components.md +++ b/zh-cn/application-dev/ui/ui-js-custom-components.md @@ -103,6 +103,6 @@ 针对自定义组件开发,有以下相关实例可供参考: -- [`JSUICustomComponent`:自定义组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JSUICustomComponent) +- [`JSUICustomComponent`:自定义组件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JSUICustomComponent) - [自定义组件(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/JSCanvasComponet) diff --git a/zh-cn/application-dev/ui/ui-js-overview.md b/zh-cn/application-dev/ui/ui-js-overview.md index 22adf599ad38ff406b93ffc1c8678760c607c059..d34a9f2cb8c946c3b0527965794e035c72f0429e 100755 --- a/zh-cn/application-dev/ui/ui-js-overview.md +++ b/zh-cn/application-dev/ui/ui-js-overview.md @@ -34,20 +34,20 @@ 基于JS扩展的类Web开发范式的方舟开发框架,有以下相关实例可供参考: -- [`AtomicLayout`:原子布局(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/AtomicLayout) +- [`AtomicLayout`:原子布局(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/AtomicLayout) -- [`JsFA`:FA示例应用(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsFA) +- [`JsFA`:FA示例应用(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsFA) -- [`JsShopping`:购物示例应用(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsShopping) +- [`JsShopping`:购物示例应用(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsShopping) - [`Stack`:堆叠容器(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Stack) -- [`JsAdaptivePortalList`:多设备自适应的效率型首页(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAdaptivePortalList) +- [`JsAdaptivePortalList`:多设备自适应的效率型首页(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsAdaptivePortalList) -- [`JsAdaptivePortalPage`:多设备自适应的FA页面(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAdaptivePortalPage) +- [`JsAdaptivePortalPage`:多设备自适应的FA页面(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsAdaptivePortalPage) -- [`JsGallery`:图库示例应用(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsGallery) +- [`JsGallery`:图库示例应用(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsGallery) -- [`Badge`:事件标记控件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Badge) +- [`Badge`:事件标记控件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Badge) - [购物应用(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/ShoppingOpenHarmony) diff --git a/zh-cn/application-dev/ui/ui-ts-building-data-model.md b/zh-cn/application-dev/ui/ui-ts-building-data-model.md index 4043e160d484f6d3f3586348e7779b4bc6bc87bb..42eec7a17592f85aa1e10a746c80997f845b96fb 100644 --- a/zh-cn/application-dev/ui/ui-ts-building-data-model.md +++ b/zh-cn/application-dev/ui/ui-ts-building-data-model.md @@ -76,3 +76,7 @@ 已完成好健康饮食应用的数据资源准备,接下来将通过加载这些数据来创建食物列表页面。 + +## 相关实例 +针对构建食物分类列表页面和食物详情页,有以下相关实例可供参考: +- [DefiningPageLayoutAndConnection:页面布局和连接(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/DefiningPageLayoutAndConnection) diff --git a/zh-cn/application-dev/ui/ui-ts-components-web.md b/zh-cn/application-dev/ui/ui-ts-components-web.md index 0386a7108587acaca55c42f5e07624fa2115a974..6a72cc647601e6f072b59a61b58805df0d16c0b8 100644 --- a/zh-cn/application-dev/ui/ui-ts-components-web.md +++ b/zh-cn/application-dev/ui/ui-ts-components-web.md @@ -198,6 +198,6 @@ struct WebComponent { 针对Web开发,有以下相关实例可供参考: -- [`Web`:Web(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Web) +- [`Web`:Web(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Web) - [Web组件加载本地H5小程序(eTS)(API9)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/WebComponent) \ No newline at end of file diff --git a/zh-cn/application-dev/ui/ui-ts-creating-simple-page.md b/zh-cn/application-dev/ui/ui-ts-creating-simple-page.md index 1a6c7469f65fc06056fed280aaebb3a3216e8c23..f9ef0596f48ebcb930dda2f94e594fa1e33788dd 100644 --- a/zh-cn/application-dev/ui/ui-ts-creating-simple-page.md +++ b/zh-cn/application-dev/ui/ui-ts-creating-simple-page.md @@ -528,6 +528,6 @@ 针对创建简单视图,有以下示例工程可供参考: -- [`BuildCommonView`:创建简单视图(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/BuildCommonView) +- [`BuildCommonView`:创建简单视图(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/BuildCommonView) 本示例为构建了简单页面展示食物番茄的图片和营养信息,主要为了展示简单页面的Stack布局和Flex布局。 diff --git a/zh-cn/application-dev/ui/ui-ts-layout-mediaquery.md b/zh-cn/application-dev/ui/ui-ts-layout-mediaquery.md index a57eebc7332161fec6af29482d70de9c769c4b70..add3021585976afbccfa75de3caf2761ef1bf50c 100644 --- a/zh-cn/application-dev/ui/ui-ts-layout-mediaquery.md +++ b/zh-cn/application-dev/ui/ui-ts-layout-mediaquery.md @@ -154,5 +154,5 @@ listener.on('change', onPortrait) 针对媒体查询开发,有以下相关实例可供参考: -- [`MediaQuery`:媒体查询(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/MediaQuery) +- [`MediaQuery`:媒体查询(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/MediaQuery) diff --git a/zh-cn/application-dev/ui/ui-ts-overview.md b/zh-cn/application-dev/ui/ui-ts-overview.md index 4bec8a1c14aada55c870218b046f87debb2ae319..8729ec39918ba2bc7687c5e3c532444171baf2b8 100644 --- a/zh-cn/application-dev/ui/ui-ts-overview.md +++ b/zh-cn/application-dev/ui/ui-ts-overview.md @@ -61,43 +61,41 @@ 基于TS扩展的声明式开发范式的方舟开发框架,有以下相关实例可供参考: -- [`Canvas`:画布组件(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Canvas) +- [`Canvas`:画布组件(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Canvas) -- [`Drag`:拖拽事件(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Drag) +- [`Drag`:拖拽事件(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Drag) -- [`ArkUIAnimation`:动画(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/ArkUIAnimation) +- [`ArkUIAnimation`:动画(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/ArkUIAnimation) -- [`Xcomponent`:XComponent(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/XComponent) +- [`Xcomponent`:XComponent(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/XComponent) -- [`MouseEvent`:鼠标事件(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/MouseEvent) +- [`MouseEvent`:鼠标事件(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/MouseEvent) -- [`Gallery`:组件集合(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Gallery) +- [`Gallery`:组件集合(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Gallery) -- [`BringApp`:拉起系统应用(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/BringApp) +- [`BringApp`:拉起系统应用(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/BringApp) -- [`Chat`:聊天示例应用(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/AppSample/Chat) +- [`Chat`:聊天示例应用(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/AppSample/Chat) -- [`Shopping`:购物示例应用(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/AppSample/Shopping) +- [`Shopping`:购物示例应用(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/AppSample/Shopping) -- [`Lottie`:Lottie(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Lottie) +- [`Lottie`:Lottie(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Lottie) -- [`Clock`:简单时钟(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/Preset/Clock) +- [`Clock`:简单时钟(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/Preset/Clock) -- [`Flybird`:小鸟避障游戏(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ResourcesSchedule/Flybird) - -- [`News`:新闻浏览(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ResourcesSchedule/News) +- [`Flybird`:小鸟避障游戏(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/ResourcesSchedule/Flybird) - [`AdaptiveCapabilities`:多设备自适应能力(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/MultiDeviceAppDev/AdaptiveCapabilities) -- [`Game2048`:2048游戏(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Game2048) +- [`Game2048`:2048游戏(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Game2048) -- [`TransitionAnimation`:转场动画(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/TransitionAnimation) +- [`TransitionAnimation`:转场动画(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/TransitionAnimation) -- [`PatternLock`:图案密码锁组件(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/PatternLock) +- [`PatternLock`:图案密码锁组件(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/PatternLock) -- [`Search`:Search组件(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Search) +- [`Search`:Search组件(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Search) -- [`QRCode`:二维码(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/QRCode) +- [`QRCode`:二维码(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/QRCode) - [极简声明式UI范式(eTS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/SimpleGalleryEts) @@ -109,4 +107,6 @@ - [弹窗(eTS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/CustomDialogEts) -- [CustomComponent:组件化(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/CustomComponent) \ No newline at end of file +- [`UpgradePopup`:自定义弹窗(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/UpgradePopup) + +- [CustomComponent:组件化(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/CustomComponent) \ No newline at end of file diff --git a/zh-cn/application-dev/windowmanager/window-overview.md b/zh-cn/application-dev/windowmanager/window-overview.md index 66592376084eccb141fa6399d9e116386bd24a5d..40d122f4bb00a706739c186d14f4cf5e4b8c5160 100644 --- a/zh-cn/application-dev/windowmanager/window-overview.md +++ b/zh-cn/application-dev/windowmanager/window-overview.md @@ -33,20 +33,10 @@ ### 窗口类型 OpenHarmony的窗口模块将窗口界面分为系统窗口、应用窗口两种基本类型。 -- **系统窗口** - - 系统窗口指完成系统特定功能的窗口。如音量条、壁纸、通知栏、状态栏、导航栏等。 -- **应用窗口** - - 应用窗口区别于系统窗口,指与应用显示相关的窗口。根据显示内容的不同,应用窗口又分为应用主窗口、应用子窗口两种类型。 - - - 应用主窗口 - - ​ 应用主窗口用于显示应用界面,会在"任务管理界面"显示。 - - - 应用子窗口 - - ​ 应用子窗口用于显示应用的弹窗、悬浮窗等辅助窗口,不会在"任务管理界面"显示。 +- **系统窗口**:系统窗口指完成系统特定功能的窗口。如音量条、壁纸、通知栏、状态栏、导航栏等。 +- **应用窗口**:应用窗口区别于系统窗口,指与应用显示相关的窗口。根据显示内容的不同,应用窗口又分为应用主窗口、应用子窗口两种类型。 + - 应用主窗口:应用主窗口用于显示应用界面,会在"任务管理界面"显示。 + - 应用子窗口:应用子窗口用于显示应用的弹窗、悬浮窗等辅助窗口,不会在"任务管理界面"显示。 @@ -56,11 +46,9 @@ OpenHarmony的窗口模块将窗口界面分为系统窗口、应用窗口两种 应用窗口模式指应用主窗口启动时的显示方式。OpenHarmony目前支持全屏、分屏、自由窗口三种应用窗口模式。这种对多种应用窗口模式的支持能力,也称为操作系统的“多窗口能力”。 -- **全屏** :应用主窗口启动时铺满整个屏幕。 - -- **分屏** :应用主窗口启动时占据屏幕的某个部分,当前支持二分屏。两个分屏窗口之间具有分界线,可通过拖拽分界线调整两个部分的窗口尺寸。 - -- **自由窗口** :自由窗口的大小和位置可自由改变。同一个屏幕上可同时显示多个自由窗口,这些自由窗口按照打开或者获取焦点的顺序在Z轴排布。当自由窗口被点击或触摸时,将导致其Z轴高度提升,并获取焦点。 +- **全屏**:应用主窗口启动时铺满整个屏幕。 +- **分屏**:应用主窗口启动时占据屏幕的某个部分,当前支持二分屏。两个分屏窗口之间具有分界线,可通过拖拽分界线调整两个部分的窗口尺寸。 +- **自由窗口**:自由窗口的大小和位置可自由改变。同一个屏幕上可同时显示多个自由窗口,这些自由窗口按照打开或者获取焦点的顺序在Z轴排布。当自由窗口被点击或触摸时,将导致其Z轴高度提升,并获取焦点。 ![windowMode](figures/windowMode.png) diff --git a/zh-cn/device-dev/subsystems/Readme-CN.md b/zh-cn/device-dev/subsystems/Readme-CN.md index 5d0b61b469c27ba8995a85cd2c060a872e8d4440..a231ca14ac77cdfcbcd7506202f593c51ddd69a8 100755 --- a/zh-cn/device-dev/subsystems/Readme-CN.md +++ b/zh-cn/device-dev/subsystems/Readme-CN.md @@ -70,7 +70,7 @@ - [应用权限管理开发指导](subsys-security-rightmanagement.md) - [IPC通信鉴权开发指导](subsys-security-communicationverify.md) - [设备安全等级管理开发指导](subsys-security-devicesecuritylevel.md) - - [OpenHarmony通用密钥库系统开发](subsys-security-huks-guide.md) + - [OpenHarmony通用密钥库系统开发指导](subsys-security-huks-guide.md) - 启动恢复 - [启动恢复子系统概述](subsys-boot-overview.md) - init启动引导组件 diff --git a/zh-cn/device-dev/subsystems/subsys-security-overview.md b/zh-cn/device-dev/subsystems/subsys-security-overview.md index 6072cca21a6ad751e5d2b059a1839d2f06e2af07..7b05880f7ca8ef398dfde2f1b32b99fee91083e3 100644 --- a/zh-cn/device-dev/subsystems/subsys-security-overview.md +++ b/zh-cn/device-dev/subsystems/subsys-security-overview.md @@ -20,6 +20,10 @@ OpenHarmony安全子系统目前提供给开发者的安全能力主要包含应 OpenHarmony设备安全等级管理(DSLM)模块,负责管理各种不同形态和种类的OpenHarmony设备的设备安全等级。对于OpenHarmony中的各类分布式业务,当其对各类用户数据进行流转或处理的时候,可以调用本模块提供的接口获取相关目标设备的安全等级,并根据获取到的等级进行相应的处理。 +- OpenHarmony通用密钥库 + + 通用密钥库(HUKS)提供系统级的密钥管理能力,实现密钥全生命周期(生成、存储、使用、销毁)的管理和安全使用,满足生态应用和上层业务的诉求。上层应用可以通过调用本模块提供的接口执行密钥操作,同时明文密钥的存储和使用不能出现在非安全环境中,需要保证在安全环境中使用。 + ## 基本概念 diff --git a/zh-cn/release-notes/OpenHarmony-v1.1.5-LTS.md b/zh-cn/release-notes/OpenHarmony-v1.1.5-LTS.md new file mode 100644 index 0000000000000000000000000000000000000000..0dfc9e23fa0c16514f8f74c9b214a371b4c4e66c --- /dev/null +++ b/zh-cn/release-notes/OpenHarmony-v1.1.5-LTS.md @@ -0,0 +1,95 @@ +# OpenHarmony 1.1.5 LTS + + +## 版本概述 + +此版本为OpenHarmony 1.0.1 Release分支上的维护版本,基于OpenHarmony-v1.1.4-LTS版本修复一些缺陷及安全问题,通过集成验证后发布最新且稳定的标签版本。 + + +## 配套关系 + + **表1** 版本软件和工具配套关系 + +| 软件 | 版本 | 备注 | +| -------- | -------- | -------- | +| OpenHarmony | 1.1.5 LTS | NA | +| HUAWEI DevEco Device Tool(可选) | 2.2 Beta2 | OpenHarmony智能设备集成开发环境推荐使用。 | + + +## 源码获取 + + +### 通过repo获取 + +**方式一(推荐)**:通过repo + ssh 下载(需注册公钥,请参考[码云帮助中心](https://gitee.com/help/articles/4191))。 + + +``` +repo init -u git@gitee.com:openharmony/manifest.git -b refs/tags/OpenHarmony-v1.1.5-LTS --no-repo-verify +repo sync -c +repo forall -c 'git lfs pull' +``` + +**方式二**:通过repo + https 下载。 + + +``` +repo init -u https://gitee.com/openharmony/manifest.git -b refs/tags/OpenHarmony-v1.1.5-LTS --no-repo-verify +repo sync -c +repo forall -c 'git lfs pull' +``` + + +### 从镜像站点获取 + + **表2** 获取源码路径 + +| 版本源码 | 版本信息 | 下载站点 | SHA256校验码 | +| -------- | -------- | -------- | -------- | +| 全量代码 | 1.1.5 | [站点](https://repo.huaweicloud.com/harmonyos/os/1.1.5/code-v1.1.5-LTS.tar.gz) | [SHA256校验码](https://repo.huaweicloud.com/harmonyos/os/1.1.5/code-v1.1.5-LTS.tar.gz.sha256) | +| 轻量级设备Hi3861解决方案(二进制) | 1.1.5 | [站点](https://repo.huaweicloud.com/harmonyos/os/1.1.5/wifiiot-1.1.5.tar.gz) | [SHA256校验码](https://repo.huaweicloud.com/harmonyos/os/1.1.5/wifiiot-1.1.5.tar.gz.sha256) | +| 小型设备Hi3518解决方案(二进制) | 1.1.5 | [站点](https://repo.huaweicloud.com/harmonyos/os/1.1.5/ipcamera_hi3518ev300-1.1.5.tar.gz) | [SHA256校验码](https://repo.huaweicloud.com/harmonyos/os/1.1.5/ipcamera_hi3518ev300-1.1.5.tar.gz.sha256) | +| 小型设备Hi3516解决方案(二进制) | 1.1.5 | [站点](https://repo.huaweicloud.com/harmonyos/os/1.1.5/ipcamera_hi3516dv300-1.1.5.tar.gz) | [SHA256校验码](https://repo.huaweicloud.com/harmonyos/os/1.1.5/ipcamera_hi3516dv300-1.1.5.tar.gz.sha256) | + + +## 更新说明 + +本版本在OpenHarmony v1.1.4 LTS的基础上有如下变更。 + + +### 特性变更 + +当前维护版本不涉及新需求及新特性的接纳与变更。 + + +### API变更 + +此版本不涉及API变更。 + + +### 芯片及开发板适配 + +芯片及开发板适配状态请参考[SIG-Devboard](https://gitee.com/openharmony/community/blob/master/sig/sig-devboard/sig_devboard_cn.md)信息。 + + +## 修复缺陷列表 + + **表3** 已修复的安全漏洞列表 + +| ISSUE单号 | 问题描述 | 合入链接 | +| -------- | -------- | -------- | +| I58X0S | 修复curl组件的CVE-2022-27781、CVE-2022-27782安全漏洞 | [PR](https://gitee.com/openharmony/third_party_curl/pulls/60) | +| I56PV4 | 修复curl组件的CVE-2022-22576、CVE-2022-27775、CVE-2022-27774、CVE-2022-27776安全漏洞 | [PR](https://gitee.com/openharmony/third_party_curl/pulls/54) | +| NA | 修复curl组件的CVE-2021-22945、CVE-2021-22946、CVE-2021-22947安全漏洞 | [PR](https://gitee.com/openharmony/third_party_curl/pulls/56) | +| I4QT0K/I56GI9 | 修复mbed tls组件的CVE-2021-44732、CVE-2021-45450安全漏洞 | [PR](https://gitee.com/openharmony/third_party_mbedtls/pulls/30) | +| I5F0WG | 修复freetype组件的CVE-2022-27404、CVE-2022-27406安全漏洞 | [PR](https://gitee.com/openharmony/third_party_freetype/pulls/22) | +| I4TLI9 | 修复freetype组件的CVE-2020-15999安全漏洞 | [PR](https://gitee.com/openharmony/third_party_freetype/pulls/7) | +| I51D98 | 修复zlib组件的CVE-2018-25032安全漏洞 | [PR](https://gitee.com/openharmony/third_party_zlib/pulls/31) | +| I5F13F/I4UHO4 | 修复ffmpeg组件的CVE-2020-35964、CVE-2022-1475、CVE-2021-38291、CVE-2020-35965、CVE-2020-22042、CVE-2020-22038、CVE-2020-22037、CVE-2020-22021、CVE-2020-22019安全漏洞 | [PR](https://gitee.com/openharmony/device_hisilicon_third_party_ffmpeg/pulls/17) | + + **表4** 已修复的缺陷列表 + +| ISSUE单号 | 问题描述 | +| -------- | -------- | +| [I4VKNM](https://gitee.com/openharmony/xts_acts/issues/I4VKNM) | 小型系统Hi3518开发板执行testSigtimedwaitBlock用例时概率性失败 | +| [I4S098](https://gitee.com/openharmony/applications_sample_camera/issues/I4S098) | 小型系统Hi3516开发板点击设置-WiFi,进入WiFi列表界面后退出,重复此操作会使开发板概率性无响应 | diff --git a/zh-cn/release-notes/OpenHarmony-v3.1.2-release.md b/zh-cn/release-notes/OpenHarmony-v3.1.2-release.md new file mode 100644 index 0000000000000000000000000000000000000000..00007e05bb715764e2ee9812238bb6531f3943f2 --- /dev/null +++ b/zh-cn/release-notes/OpenHarmony-v3.1.2-release.md @@ -0,0 +1,157 @@ +# OpenHarmony 3.1.2 Release + + +## 版本概述 + +当前版本在OpenHarmony 3.1.1 Release的基础上,做了如下更新: + +修复部分子系统acts测试用例执行失败问题,同时补齐部分子系统的acts用例覆盖。 + +修复了linux kernel、OpenSSL、curl、node等三方组件的已知漏洞,增强了系统安全性。 + +修复了备忘录、设置、通知栏等系统应用的部分已知缺陷,提升了标准系统开发板的用户体验。 + +修复了SDK已知缺陷问题并配套发布最新的SDK版本。 + + +## 配套关系 + + **表1** 版本软件和工具配套关系 + +| 软件 | 版本 | 备注 | +| -------- | -------- | -------- | +| OpenHarmony | 3.1.2 Release | NA | +| Full SDK | Ohos_sdk_full 3.1.7.5 (API Version 8 Release) | 面向OEM厂商提供,包含了需要使用系统权限的系统接口。
使用Full SDK时需要手动从镜像站点获取,并在DevEco Studio中替换,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md)。 | +| Public SDK | Ohos_sdk_public 3.1.7.5 (API Version 8 Release) | 面向应用开发者提供,不包含需要使用系统权限的系统接口。
DevEco Studio 3.0 Beta4版本起,通过DevEco Studio获取的SDK默认为Public SDK。 | +| HUAWEI DevEco Studio(可选) | 3.0 Beta4 for OpenHarmony | OpenHarmony应用开发推荐使用 | +| HUAWEI DevEco Device Tool(可选) | 3.0 Release | OpenHarmony智能设备集成开发环境推荐使用 | + + +## 源码获取 + + +### 前提条件 + +1. 注册码云gitee账号。 + +2. 注册码云SSH公钥,请参考[码云帮助中心](https://gitee.com/help/articles/4191)。 + +3. 安装[git客户端](https://gitee.com/link?target=https%3A%2F%2Fgit-scm.com%2Fbook%2Fzh%2Fv2%2F%25E8%25B5%25B7%25E6%25AD%25A5-%25E5%25AE%2589%25E8%25A3%2585-Git)和[git-lfs](https://gitee.com/vcs-all-in-one/git-lfs?_from=gitee_search#downloading)并配置用户信息。 + + ``` + git config --global user.name "yourname" + git config --global user.email "your-email-address" + git config --global credential.helper store + ``` + +4. 安装码云repo工具,可以执行如下命令。 + + ``` + curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo #如果没有权限,可下载至其他目录,并将其配置到环境变量中chmod a+x /usr/local/bin/repo + pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests + ``` + + +### 通过repo获取 + +**方式一(推荐)** + +通过repo + ssh 下载(需注册公钥,请参考[码云帮助中心](https://gitee.com/help/articles/4191))。 + + +``` +repo init -u git@gitee.com:openharmony/manifest.git -b refs/tags/OpenHarmony-v3.1.2-Release --no-repo-verify +repo sync -c +repo forall -c 'git lfs pull' +``` + +**方式二** + +通过repo + https 下载。 + + +``` +repo init -u https://gitee.com/openharmony/manifest.git -b refs/tags/OpenHarmony-v3.1.2-Release --no-repo-verify +repo sync -c +repo forall -c 'git lfs pull' +``` + + +### 从镜像站点获取 + +**表2** 获取源码路径 + +| 版本源码 | **版本信息** | **下载站点** | **SHA256校验码** | +| -------- | -------- | -------- | -------- | +| 全量代码(标准、轻量和小型系统) | 3.1.2 Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/code-v3.1.2-Release.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/code-v3.1.2-Release.tar.gz.sha256) | +| Hi3516标准系统解决方案(二进制) | 3.1.2 Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/standard_hi3516.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/standard_hi3516.tar.gz.sha256) | +| RK3568标准系统解决方案(二进制) | 3.1.2 Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/standard_rk3568.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/standard_rk3568.tar.gz.sha256) | +| Hi3861轻量系统解决方案(二进制) | 3.1.2 Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/hispark_pegasus.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/hispark_pegasus.tar.gz.sha256) | +| Hi3516轻量系统解决方案-LiteOS(二进制) | 3.1.2 Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/hispark_taurus.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/hispark_taurus.tar.gz.sha256) | +| Hi3516轻量系统解决方案-Linux(二进制) | 3.1.2 Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/hispark_taurus_linux.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/hispark_taurus_linux.tar.gz.sha256) | +| 标准系统Full SDK包(Mac) | 3.1.2 Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/ohos-sdk-mac-full.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/ohos-sdk-mac-full.tar.gz.sha256) | +| 标准系统Full SDK包(Windows\Linux) | 3.1.2 Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/ohos-sdk-full.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/ohos-sdk-full.tar.gz.sha256) | +| 标准系统Public SDK包(Mac) | 3.1.2 Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/ohos-sdk-mac-public.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/ohos-sdk-mac-public.tar.gz.sha256) | +| 标准系统Public SDK包(Windows\Linux) | 3.1.2 Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/ohos-sdk-public.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/ohos-sdk-public.tar.gz.sha256) | + + +## 更新说明 + +本版本在OpenHarmony 3.1.1 Release的基础上有如下变更。 + + +### 特性变更 + +本次版本无新增特性及变更。 + +API变更 + + +3.1.2 Release对比3.1.1 Release API接口无变更。 + + + +### 芯片及开发板适配 + +芯片及开发板适配状态请参考[SIG-Devboard](https://gitee.com/openharmony/community/blob/master/sig/sig-devboard/sig_devboard_cn.md)信息。 + + +## 修复缺陷列表 + +**表3** 修复缺陷ISSUE列表 + +| 子系统 | 问题描述 | +| -------- | -------- | +| acts子系统 | - 修复ActsFeatureAbilityTest模块1条用例执行失败的问题([I5G8Q5](https://gitee.com/openharmony/xts_acts/issues/I5G8Q5))
- 修复usb的sdk中的参数target未覆盖的问题([I5FU0F](https://gitee.com/openharmony/xts_acts/issues/I5FU0F))
- 修复graphic/webGL/src/main/js/default/test下用例未覆盖的问题([I5FMJJ](https://gitee.com/openharmony/xts_acts/issues/I5FMJJ))
- 修复ActsFeatureAbilityTest模块22条用例执行失败的问题([I5FILR](https://gitee.com/openharmony/xts_acts/issues/I5FILR))
- 删除Webgl下graphic/webGL/src/main/js/default/test测试套未使用的引用'\@ohos.napi_context'([I5FAF7](https://gitee.com/openharmony/xts_acts/issues/I5FAF7))
- 修复ActsAudioManagerJsTest的Test.json配置错误问题([I5EJPP](https://gitee.com/openharmony/xts_acts/issues/I5EJPP))
- 修复ohos.multimedia.mediaLibrary测试用例导包大小写错误问题([I5EJ3W](https://gitee.com/openharmony/xts_acts/issues/I5EJ3W))
- 修复通知子系统对应的4个测试套执行失败的问题([I5EA00](https://gitee.com/openharmony/xts_acts/issues/I5EA00))
- 修复ActsUpdateJsTest模块index.js源码引入测试套的api异常问题([I5D5BV](https://gitee.com/openharmony/xts_acts/issues/I5D5BV))
- 修复Test.json配置的命令无法创建push资源的目录问题([I5D50G](https://gitee.com/openharmony/xts_acts/issues/I5D50G))
- 修复ActsAnsActiveTest测试套用例兼容性问题([I5BQB0](https://gitee.com/openharmony/xts_acts/issues/I5BQB0))
- 修复ActsStServiceAbilityClientCaseTest模块五条用例执行失败问题([I5GHRE](https://gitee.com/openharmony/xts_acts/issues/I5GHRE))
- 修复ActsSubscriberTestUnorderSystemTest模块两条用例执行失败的问题([I5GHP5](https://gitee.com/openharmony/xts_acts/issues/I5GHP5))
- 修复ActsAudioRecorderJsTest、ActsMediaLibraryJsTest模块测试套无法执行问题([I5H431](https://gitee.com/openharmony/xts_acts/issues/I5H431)) | +| SDK子系统 | - 解决了预览器相关的一些问题。
- 解决了c++调试相关的一些问题。 | +| 应用子系统 | - 修复通知管理界面相关的问题([I5FLLB](https://gitee.com/openharmony/applications_systemui/issues/I5FLLB))
- 修复备忘录的一些缺陷问题([5FJGJ](https://gitee.com/openharmony/applications_notes/issues/I5FJGJ))([I5FJ9L](https://gitee.com/openharmony/applications_notes/issues/I5FJ9L))([I5FJCS](https://gitee.com/openharmony/applications_notes/issues/I5FJCS)) | + + +## 修复安全漏洞列表 + +**表4** 修复安全问题列表 + +| ISSUE | 问题描述 | 修复链接 | +| -------- | -------- | -------- | +| I5FZTU | 修复组件linux kernel 5.10上的CVE-2022-21125、CVE-2022-2153、CVE-2022-32296安全漏洞。 | [PR](https://gitee.com/openharmony/kernel_linux_5.10/pulls/307) | +| I5FZT0 | 修复组件linux kernel 5.10上的CVE-2022-1508、CVE-2022-1972、CVE-2022-1998、CVE-2022-21499、CVE-2022-32981安全漏洞。 | [PR](https://gitee.com/openharmony/kernel_linux_5.10/pulls/301) | +| I5FZSH | 修复组件linux kernel 5.10上的CVE-2022-1974、CVE-2022-1975、CVE-2022-20153、CVE-2022-20154、CVE-2022-20132安全漏洞。 | [PR](https://gitee.com/openharmony/kernel_linux_5.10/pulls/302) | +| I5FZQS | 修复组件linux kernel 5.10上的CVE-2022-1729、CVE-2022-29581安全漏洞。 | [PR](https://gitee.com/openharmony/kernel_linux_5.10/pulls/299) | +| I5CQMC | 修复组件third_party_chromium上的CVE-2022-2158、CVE-2022-2161、CVE-2022-2163、CVE-2022-2164、CVE-2022-2157、CVE-2022-2165、CVE-2022-2160、CVE-2022-2156、CVE-2022-1501、CVE-2022-2008、CVE-2022-2010、CVE-2022-2011、CVE-2022-1857、CVE-2022-1874、CVE-2022-0311、CVE-2022-1314安全漏洞。 | [PR](https://gitee.com/openharmony/third_party_chromium/pulls/29) | +| I5GG74 | 修复组件third_party_openssl上的CVE-2022-2097安全漏洞。 | [PR](https://gitee.com/openharmony/third_party_openssl/pulls/64) | +| I5GQI2 | 修复组件third_party_curl上的CVE-2022-22576、CVE-2022-27775、CVE-2022-27774、CVE-2022-27776安全漏洞。 | [PR](https://gitee.com/openharmony/third_party_curl/pulls/51) | +| I5H1HU | 修复组件third_party_flutter下libjpeg-turbo组件的CVE-2021-46822安全漏洞。 | [PR](https://gitee.com/openharmony/third_party_flutter/pulls/117) | +| I5KI54 | 修复组件third_party_freetype的CVE-2022-27405安全漏洞。 | [PR](https://gitee.com/openharmony/third_party_freetype/pulls/32) | +| I5J8V2 | 升级组件third_party_node到14.19.1版本,解决CVE-2022-32212、CVE-2022-32213、CVE-2022-2097、CVE-2022-32215安全漏洞。 | [PR](https://gitee.com/openharmony/third_party_node/pulls/29) | +| I59ZPI | 升级组件third_party_ntfs-3g到2022.5.17版本,修复2021.8.22版本上的已知安全漏洞。 | [PR](https://gitee.com/openharmony/third_party_ntfs-3g/pulls/18) | +| I5EEXE | 修复组件third_party_pcre2组件的CVE-2022-1586、CVE-2022-1587安全漏洞。 | [PR](https://gitee.com/openharmony/third_party_pcre2/pulls/24) | +| I5I9YX | 修复组件third_party_selinux上的CVE-2021-36085CVE-2021-36084CVE-2021-36087安全漏洞。 | [PR](https://gitee.com/openharmony/third_party_selinux/pulls/31) | + + +## 遗留缺陷列表 + +**表5** 遗留缺陷列表 + +| ISSUE | 问题描述 | 影响 | 计划解决日期 | +| -------- | -------- | -------- | -------- | +| [I5M0GH](https://gitee.com/openharmony/applications_notes/issues/I5M0GH) | 备忘录—最近删除界面选中笔记点击恢复按钮无反应。 | 备忘录demo应用,影响开发者体验。 | 2022/9/30 | diff --git a/zh-cn/release-notes/Readme.md b/zh-cn/release-notes/Readme.md index 7137141a9f54b6d62b3f9ae3afeadf75ad607e10..bcecbe9d2288800cacc9df870d35ca4fdd1e515b 100644 --- a/zh-cn/release-notes/Readme.md +++ b/zh-cn/release-notes/Readme.md @@ -1,5 +1,7 @@ # OpenHarmony Release Notes ## OpenHarmony 3.x Releases + +- [OpenHarmony v3.1.2 Release (2022-08-24)](OpenHarmony-v3.1.2-release.md) - [OpenHarmony v3.2 Beta2 (2022-07-30)](OpenHarmony-v3.2-beta2.md) - [OpenHarmony v3.2 Beta1 (2022-05-31)](OpenHarmony-v3.2-beta1.md) - [OpenHarmony v3.1.1 Release (2022-05-31)](OpenHarmony-v3.1.1-release.md) @@ -15,7 +17,9 @@ - [OpenHarmony v2.2 beta2 (2021-08-04)](OpenHarmony-v2.2-beta2.md) - [OpenHarmony 2.0 Canary (2021-06-01)](OpenHarmony-2-0-Canary.md) + ## OpenHarmony 1.x Releases +- [OpenHarmony v1.1.5 LTS (2022-08-24)](OpenHarmony-v1.1.5-LTS.md) - [OpenHarmony v1.1.4 LTS (2022-02-11)](OpenHarmony-v1-1-4-LTS.md) - [OpenHarmony v1.1.3 LTS (2021-09-30)](OpenHarmony-v1-1-3-LTS.md) - [OpenHarmony v1.1.2 LTS (2021-08-04)](OpenHarmony-v1.1.2-LTS.md)