diff --git a/en/application-dev/ability/fa-dataability.md b/en/application-dev/ability/fa-dataability.md index 81e67af18e17fb12682a2f21decd80d10ac79a9c..faad709b280730f5f96c79a905fe6385f04fce62 100644 --- a/en/application-dev/ability/fa-dataability.md +++ b/en/application-dev/ability/fa-dataability.md @@ -1,9 +1,12 @@ # Data Ability Development + ## When to Use + A Data ability helps applications manage access to data stored by themselves and other applications. It also provides APIs for sharing data with other applications either on the same device or across devices. Data ability providers can customize data access-related APIs such as data inserting, deleting, updating, and querying, as well as file opening, and share data with other applications through these open APIs. + ## Available APIs **Table 1** Data ability lifecycle APIs @@ -18,7 +21,7 @@ Data ability providers can customize data access-related APIs such as data inser |denormalizeUri?(uri: string, callback: AsyncCallback\): void|Converts a normalized URI generated by **normalizeUri** into a denormalized URI.| |insert?(uri: string, valueBucket: rdb.ValuesBucket, callback: AsyncCallback\): void|Inserts a data record into the database.| |openFile?(uri: string, mode: string, callback: AsyncCallback\): void|Opens a file.| -|getFileTypes?(uri: string, mimeTypeFilter: string, callback: AsyncCallback\>): void|Obtains the MIME type of a file.| +|getFileTypes?(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void|Obtains the MIME type of a file.| |getType?(uri: string, callback: AsyncCallback\): void|Obtains the MIME type matching the data specified by the URI.| |executeBatch?(ops: Array\, callback: AsyncCallback\>): void|Operates data in the database in batches.| |call?(method: string, arg: string, extras: PacMap, callback: AsyncCallback\): void|Calls a custom API.| @@ -115,7 +118,7 @@ Import the basic dependency packages and obtain the URI string for communicating The basic dependency packages include: - @ohos.ability.featureAbility -- @ohos.data.dataability +- @ohos.data.dataAbility - @ohos.data.rdb #### Data Ability API Development @@ -129,7 +132,7 @@ The basic dependency packages include: import featureAbility from '@ohos.ability.featureAbility' import ohos_data_ability from '@ohos.data.dataAbility' import ohos_data_rdb from '@ohos.data.rdb' - + var urivar = "dataability:///com.ix.DataAbility" var DAHelper = featureAbility.acquireDataAbilityHelper( urivar 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-ability.md b/en/application-dev/ability/stage-ability.md index 936e1c1b8942f52ec0b470ae851a10cdf0e82011..aa31c894e32ee030712aa7651f397921214d5de3 100644 --- a/en/application-dev/ability/stage-ability.md +++ b/en/application-dev/ability/stage-ability.md @@ -1,19 +1,19 @@ # Ability Development ## When to Use -Unlike the FA model, the [stage model](stage-brief.md) requires you to declare the application package structure in the `module.json` and `app.json` files during application development. For details about the configuration file, see [Application Package Structure Configuration File](../quick-start/stage-structure.md). To develop abilities based on the stage model, implement the following logic: -- Create abilities for an application that involves screen viewing and human-machine interaction. You must implement the following scenarios: ability lifecycle callbacks, obtaining ability configuration, requesting permissions, and notifying environment changes. +Ability development in the [stage model](stage-brief.md) is significantly different from that in the FA model. The stage model requires you to declare the application package structure in the `module.json` and `app.json` files during application development. For details about the configuration file, see [Application Package Structure Configuration File](../quick-start/stage-structure.md). To develop an ability based on the stage model, implement the following logic: +- Create an ability that supports screen viewing and human-machine interaction. You must implement the following scenarios: ability lifecycle callbacks, obtaining ability configuration, requesting permissions, and notifying environment changes. - Start an ability. You need to implement ability startup on the same device, on a remote device, or with a specified UI page. - Call abilities. For details, see [Call Development](stage-call.md). - Connect to and disconnect from a Service Extension ability. For details, see [Service Extension Ability Development](stage-serviceextension.md). - Continue the ability on another device. For details, see [Ability Continuation Development](stage-ability-continuation.md). ### Launch Type -The ability supports three launch types: singleton, multi-instance, and instance-specific. Each launch type, specified by `launchType` in the `module.json` file, specifies the action that can be performed when the ability is started. +An ability can be launched in the **standard**, **singleton**, or **specified** mode, as configured by `launchType` in the `module.json` file. Depending on the launch type, the action performed when the ability is started differs, as described below. -| Launch Type | Description |Description | +| Launch Type | Description |Action | | ----------- | ------- |---------------- | | standard | Multi-instance | A new instance is started each time an ability starts.| -| singleton | Singleton | Only one instance exists in the system. If an instance already exists when an ability is started, that instance is reused.| +| singleton | Singleton | The ability has only one instance in the system. If an instance already exists when an ability is started, that instance is reused.| | specified | Instance-specific| The internal service of an ability determines whether to create multiple instances during running.| By default, the singleton mode is used. The following is an example of the `module.json` file: @@ -58,7 +58,7 @@ To create Page abilities for an application in the stage model, you must impleme ``` import AbilityStage from "@ohos.application.AbilityStage" ``` -2. Implement the `AbilityStage` class. +2. Implement the `AbilityStage` class. The default relative path generated by the APIs is **entry\src\main\ets\Application\AbilityStage.ts**. ```ts export default class MyAbilityStage extends AbilityStage { onCreate() { @@ -70,7 +70,7 @@ To create Page abilities for an application in the stage model, you must impleme ```js import Ability from '@ohos.application.Ability' ``` -4. Implement the lifecycle callbacks of the `Ability` class. +4. Implement the lifecycle callbacks of the `Ability` class. The default relative path generated by the APIs is **entry\src\main\ets\MainAbility\MainAbility.ts**. In the `onWindowStageCreate(windowStage)` API, use `loadContent` to set the application page to be loaded. For details about how to use the `Window` APIs, see [Window Development](../windowmanager/window-guidelines.md). ```ts @@ -78,29 +78,29 @@ To create Page abilities for an application in the stage model, you must impleme onCreate(want, launchParam) { console.log("MainAbility onCreate") } - + onDestroy() { console.log("MainAbility onDestroy") } - + onWindowStageCreate(windowStage) { console.log("MainAbility onWindowStageCreate") - + windowStage.loadContent("pages/index").then((data) => { - console.log("MainAbility load content succeed with data: " + JSON.stringify(data)) + console.log("MainAbility load content succeed") }).catch((error) => { console.error("MainAbility load content failed with error: "+ JSON.stringify(error)) }) } - + onWindowStageDestroy() { console.log("MainAbility onWindowStageDestroy") } - + onForeground() { console.log("MainAbility onForeground") } - + onBackground() { console.log("MainAbility onBackground") } @@ -140,14 +140,14 @@ export default class MainAbility extends Ability { console.log("MainAbility ability name" + abilityInfo.name) let config = this.context.config - console.log("MyAbilityStage config language" + config.language) + console.log("MainAbility config language" + config.language) } } ``` ### Requesting Permissions -If an application needs to obtain user privacy information or use system capabilities, for example, obtaining location information or using the camera to take photos or record videos, it must request the permission from consumers. During application development, you need to specify the involved sensitive permissions, declare the required permissions in `module.json`, and use the `requestPermissionsFromUser` API to request the permission from consumers in the form of a dialog box. The following uses the permissions for calendar access as an example. +If an application needs to obtain user privacy information or use system capabilities, for example, obtaining location information or using the camera to take photos or record videos, it must request the respective permission from consumers. During application development, you need to specify the involved sensitive permissions, declare the required permissions in `module.json`, and use the `requestPermissionsFromUser` API to request the permission from consumers in the form of a dialog box. The following uses the permission for calendar access as an example. -Declare the required permissions in the `module.json` file. +Declare the required permission in the `module.json` file. ```json "requestPermissions": [ { @@ -155,7 +155,7 @@ Declare the required permissions in the `module.json` file. } ] ``` -Request the permissions from consumers in the form of a dialog box: +Request the permission from consumers in the form of a dialog box: ```ts let context = this.context let permissions: Array = ['ohos.permission.READ_CALENDAR'] @@ -166,11 +166,11 @@ context.requestPermissionsFromUser(permissions).then((data) => { }) ``` ### Notifying of Environment Changes -Environment changes include changes of global configurations and ability configurations. Currently, the global configurations include the system language and color mode. The change of global configurations is generally triggered by the configuration item in **Settings** or the icon in **Control Panel**. The ability configuration is specific to a single `Ability` instance, including the display ID, screen resolution, and screen orientation. The configuration is related to the display where the ability is located, and the change is generally triggered by the window. For details on the configuration, see [Configuration](../reference/apis/js-apis-configuration.md). +Environment changes include changes of global configurations and ability configurations. Currently, the global configurations include the system language and color mode. The change of global configurations is generally triggered by configuration items in **Settings** or icons in **Control Panel**. The ability configuration is specific to a single `Ability` instance, including the display ID, screen resolution, and screen orientation. The configuration is related to the display where the ability is located, and the change is generally triggered by the window. For details on the configuration, see [Configuration](../reference/apis/js-apis-configuration.md). For an application in the stage model, when the configuration changes, its abilities are not restarted, but the `onConfigurationUpdated(config: Configuration)` callback is triggered. If the application needs to perform processing based on the change, you can overwrite `onConfigurationUpdated`. Note that the `Configuration` object in the callback contains all the configurations of the current ability, not only the changed configurations. -The following example shows the implement of the `onConfigurationUpdated` callback in the `AbilityStage` class. The callback is triggered when the system language and color mode are changed. +The following example shows the implementation of the `onConfigurationUpdated` callback in the `AbilityStage` class. The callback is triggered when the system language and color mode are changed. ```ts import Ability from '@ohos.application.Ability' import ConfigurationConstant from '@ohos.application.ConfigurationConstant' @@ -184,7 +184,7 @@ export default class MyAbilityStage extends AbilityStage { } ``` -The following example shows the implement of the `onConfigurationUpdated` callback in the `Ability` class. The callback is triggered when the system language, color mode, or display parameters (such as the direction and density) change. +The following example shows the implementation of the `onConfigurationUpdated` callback in the `Ability` class. The callback is triggered when the system language, color mode, or display parameters (such as the direction and density) change. ```ts import Ability from '@ohos.application.Ability' import ConfigurationConstant from '@ohos.application.ConfigurationConstant' @@ -205,7 +205,7 @@ export default class MainAbility extends Ability { ``` ## Starting an Ability ### Available APIs -The `Ability` class has the `context` attribute, which belongs to the `AbilityContext` class. The `AbilityContext` class has the `abilityInfo`, `currentHapModuleInfo`, and other attributes and the APIs used for starting abilities. For details, see [AbilityContext](../reference/apis/js-apis-ability-context.md). +The `Ability` class has the `context` attribute, which belongs to the `AbilityContext` class. The `AbilityContext` class has the `abilityInfo`, `currentHapModuleInfo`, and other attributes as well as the APIs used for starting abilities. For details, see [AbilityContext](../reference/apis/js-apis-ability-context.md). **Table 3** AbilityContext APIs |API|Description| @@ -235,9 +235,8 @@ context.startAbility(want).then((data) => { ``` ### Starting an Ability on a Remote Device -This feature applies only to system applications, since the `getTrustedDeviceListSync` API of the `DeviceManager` class is open only to system applications. +>This feature applies only to system applications, since the `getTrustedDeviceListSync` API of the `DeviceManager` class is open only to system applications. In the cross-device scenario, you must specify the ID of the remote device. The sample code is as follows: - ```ts let context = this.context var want = { @@ -268,9 +267,9 @@ function getRemoteDeviceId() { } } ``` -Request the permission `ohos.permission.DISTRIBUTED_DATASYNC ` from consumers. This permission is used for data synchronization. For details about the sample code for requesting the permission, see [Requesting Permissions](##requesting-permissions). +Request the permission `ohos.permission.DISTRIBUTED_DATASYNC` from consumers. This permission is used for data synchronization. For details about the sample code for requesting the permission, see [Requesting Permissions](##requesting-permissions). ### Starting an Ability with the Specified Page -If the launch type of an ability is set to `singleton` and the ability has been started, the `onNewWant` callback is triggered when the ability is started again. You can pass start options through the `want`. For example, to start an ability with the specified page, use the `uri` or `parameters` parameter in the `want` to pass the page information. Currently, the ability in the stage model cannot directly use the `router` capability. You must pass the start options to the custom component and invoke the `router` method to display the specified page during the custom component lifecycle management. The sample code is as follows: +If the launch type of an ability is set to `singleton` and the ability has been started, the `onNewWant` callback rather than the `onCreate` callback is triggered when the ability is started again. You can pass start options through the `want`. For example, to start an ability with the specified page, use the `uri` or `parameters` parameter in the `want` to pass the page information. Currently, the ability in the stage model cannot directly use the `router` capability. You must pass the start options to the custom component and invoke the `router` method to display the specified page during the custom component lifecycle management. The sample code is as follows: When using `startAbility` to start an ability again, use the `uri` parameter in the `want` to pass the page information. ```ts @@ -312,7 +311,7 @@ struct Index { console.info('Index onPageShow') let newWant = globalThis.newWant if (newWant.hasOwnProperty("uri")) { - router.push({ uri: newWant.uri }); + router.push({ url: newWant.uri }); globalThis.newWant = undefined } } diff --git a/en/application-dev/ability/stage-serviceextension.md b/en/application-dev/ability/stage-serviceextension.md index a41526e05223b4f944f0977b715a548aa994bb12..b6fc349d0902889502e10502ca850af295b2ecc0 100644 --- a/en/application-dev/ability/stage-serviceextension.md +++ b/en/application-dev/ability/stage-serviceextension.md @@ -26,7 +26,7 @@ OpenHarmony does not support creation of a Service Extension ability for third-p 1. Create a Service Extension ability. -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 rpc from '@ohos.rpc' diff --git a/en/application-dev/device/sensor-guidelines.md b/en/application-dev/device/sensor-guidelines.md index f47656b4d744f1303356fd3ee601b43becfadec6..dcfffc55a6400f21c9180ee3306af16ae8713119 100644 --- a/en/application-dev/device/sensor-guidelines.md +++ b/en/application-dev/device/sensor-guidelines.md @@ -37,7 +37,7 @@ "reqPermissions":[ { "name":"ohos.permission.ACCELEROMETER", - "reason"":"", + "reason":"", "usedScene":{ "ability": ["sensor.index.MainAbility",".MainAbility"], "when":"inuse" @@ -45,7 +45,7 @@ }, { "name":"ohos.permission.GYROSCOPE", - "reason"":"", + "reason":"", "usedScene":{ "ability": ["sensor.index.MainAbility",".MainAbility"], "when":"inuse" @@ -53,7 +53,7 @@ }, { "name":"ohos.permission.ACTIVITY_MOTION", - "reason"":"ACTIVITY_MOTION_TEST", + "reason":"ACTIVITY_MOTION_TEST", "usedScene":{ "ability": ["sensor.index.MainAbility",".MainAbility"], "when":"inuse" @@ -61,7 +61,7 @@ }, { "name":"ohos.permission.READ_HEALTH_DATA", - "reason"":"HEALTH_DATA_TEST", + "reason":"HEALTH_DATA_TEST", "usedScene":{ "ability": ["sensor.index.MainAbility",".MainAbility"], "when":"inuse" diff --git a/en/application-dev/reference/apis/js-apis-Bundle.md b/en/application-dev/reference/apis/js-apis-Bundle.md index 1cd0c63f96aee81a6dfbcc00422afa7a55292e6e..1dcdd4b837f3f5236871445eaa88140ad8732968 100644 --- a/en/application-dev/reference/apis/js-apis-Bundle.md +++ b/en/application-dev/reference/apis/js-apis-Bundle.md @@ -1141,8 +1141,8 @@ SystemCapability.BundleManager.BundleFramework **Example** ```js -let bundleName = com.example.myapplication; -let abilityName = com.example.myapplication.MainAbility; +let bundleName = "com.example.myapplication"; +let abilityName = "com.example.myapplication.MainAbility"; bundle.getAbilityIcon(bundleName, abilityName) .then((data) => { console.info('Operation successful. Data: ' + JSON.stringify(data)); @@ -1176,8 +1176,8 @@ SystemCapability.BundleManager.BundleFramework **Example** ```js -let bundleName = com.example.myapplication; -let abilityName = com.example.myapplication.MainAbility; +let bundleName = "com.example.myapplication"; +let abilityName = "com.example.myapplication.MainAbility"; bundle.getAbilityIcon(bundleName, abilityName, (err, data) => { if (err) { console.error('Operation failed. Cause: ' + JSON.stringify(err)); 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 3d1f09e0e427c20f01a450f9b2a093d12df1ac6a..bb57c274af4cdfd01340b4a3f4f1179fc0430bcb 100644 --- a/en/application-dev/reference/apis/js-apis-ability-context.md +++ b/en/application-dev/reference/apis/js-apis-ability-context.md @@ -595,7 +595,7 @@ Uses the **AbilityInfo.AbilityType.SERVICE** template to connect this ability to | Type| Description| | -------- | -------- | -| number | ID of the connection between the two abilities.| +| number | Result code of the ability connection.| **Example** ```js @@ -606,7 +606,7 @@ var want = { } var options = { onConnect: (elementName, remote) => { - console.log('connectAbility onConnect, elementName: ' + elementName + ', remote: ' remote) + console.log('connectAbility onConnect, elementName: ' + elementName + ', remote: ' + remote) }, onDisconnect: (elementName) => { console.log('connectAbility onDisconnect, elementName: ' + elementName) @@ -615,8 +615,8 @@ var options = { console.log('connectAbility onFailed, code: ' + code) } } -this.context.connectAbility(want, options) { - console.log('code: ' + code) +let result = this.context.connectAbility(want, options) { + console.log('code: ' + result) } ``` @@ -652,7 +652,7 @@ var want = { var accountId = 111; var options = { onConnect: (elementName, remote) => { - console.log('connectAbility onConnect, elementName: ' + elementName + ', remote: ' remote) + console.log('connectAbility onConnect, elementName: ' + elementName + ', remote: ' + remote) }, onDisconnect: (elementName) => { console.log('connectAbility onDisconnect, elementName: ' + elementName) diff --git a/en/application-dev/reference/apis/js-apis-bundle-AbilityInfo.md b/en/application-dev/reference/apis/js-apis-bundle-AbilityInfo.md index 5f839cb6fcbe0109e4be2e9daa5f756ea786a1a0..cb7a8b6b093af914131be0dec737f8d130a4bc37 100644 --- a/en/application-dev/reference/apis/js-apis-bundle-AbilityInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundle-AbilityInfo.md @@ -1,16 +1,16 @@ # AbilityInfo +Unless otherwise specified, ability information is obtained through **GET_BUNDLE_DEFAULT**. + > **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. > -> API version 9 is a canary version for trial use. The APIs of this version may be unstable. - -Provides the ability information. +> API version 9 is a canary version for trial use. The APIs of this version may be unstable. ## AbilityInfo - **System capability**: SystemCapability.BundleManager.BundleFramework +**System capability**: SystemCapability.BundleManager.BundleFramework | Name | Type | Readable| Writable| Description | | --------------------- | -------------------------------------------------------- | ---- | ---- | ----------------------------------------- | @@ -23,22 +23,23 @@ Provides the ability information. | iconId | number | Yes | No | Ability icon ID. | | moduleName | string | Yes | No | Name of the HAP file to which the ability belongs. | | process | string | Yes | No | Process in which the ability runs. If this parameter is not set, the bundle name is used.| -| targetAbility | string | Yes | No | Target ability that the ability alias points to. | -| backgroundModes | number | Yes | No | Background service mode of the ability. | +| targetAbility | string | Yes | No | Target ability that the ability alias points to. | +| backgroundModes | number | Yes | No | Background service mode of the ability. | | isVisible | boolean | Yes | No | Whether the ability can be called by other applications. | -| formEnabled | boolean | Yes | No | Whether the ability provides the service widget capability. | -| type | AbilityType | Yes | No | Ability type. | +| formEnabled | boolean | Yes | No | Whether the ability provides the service widget capability. | +| type | AbilityType | Yes | No | Ability type. | | orientation | DisplayOrientation | Yes | No | Ability display orientation. | | launchMode | LaunchMode | Yes | No | Ability launch mode. | -| permissions | Array\ | Yes | No | Permissions required for other applications to call the ability.| +| permissions | Array\ | Yes | No | Permissions required for other applications to call the ability.
The value is obtained by passing **GET_ABILITY_INFO_WITH_PERMISSION**.| | deviceTypes | Array\ | Yes | No | Device types supported by the ability. | | deviceCapabilities | Array\ | Yes | No | Device capabilities required for the ability. | -| readPermission | string | Yes | No | Permission required for reading the ability data. | -| writePermission | string | Yes | No | Permission required for writing data to the ability. | -| applicationInfo | ApplicationInfo | Yes | No | Application configuration information. | -| uri | string | Yes | No | URI of the ability. | +| readPermission | string | Yes | No | Permission required for reading the ability data. | +| writePermission | string | Yes | No | Permission required for writing data to the ability. | +| applicationInfo | ApplicationInfo | Yes | No | Application configuration information.
The value is obtained by passing **GET_ABILITY_INFO_WITH_APPLICATION**.| +| uri | string | Yes | No | URI of the ability. | | labelId | number | Yes | No | Ability label ID. | -| subType | AbilitySubType | Yes | No | Subtype of the template that can be used by the ability. | -| metaData8+ | Array\<[CustomizeData](js-apis-bundle-CustomizeData.md)> | Yes | No | Custom metadata of the ability. | -| metadata9+ | Array\<[Metadata](js-apis-bundle-Metadata.md)> | Yes | No | Metadata of the ability. | +| subType | AbilitySubType | Yes | No | Subtype of the template that can be used by the ability. | +| metaData8+ | Array\<[CustomizeData](js-apis-bundle-CustomizeData.md)> | Yes | No | Custom metadata of the ability.
The value is obtained by passing **GET_ABILITY_INFO_WITH_METADATA**.| +| metadata9+ | Array\<[Metadata](js-apis-bundle-Metadata.md)> | Yes | No | Metadata of the ability.
The value is obtained by passing **GET_ABILITY_INFO_WITH_METADATA**.| | enabled8+ | boolean | Yes | No | Whether the ability is enabled. | + diff --git a/en/application-dev/reference/apis/js-apis-bundle-ApplicationInfo.md b/en/application-dev/reference/apis/js-apis-bundle-ApplicationInfo.md index e2be6e96f66acec4ba6caaf7d9aaf7891ee232ae..fb72c282c8d9e3e1845e0f27168c1a1f85c55e0e 100644 --- a/en/application-dev/reference/apis/js-apis-bundle-ApplicationInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundle-ApplicationInfo.md @@ -1,38 +1,38 @@ # ApplicationInfo +The **ApplicationInfo** module provides application information. Unless otherwise specified, all attributes are obtained through **GET_BUNDLE_DEFAULT**. + > **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. > -> API version 9 is a canary version for trial use. The APIs of this version may be unstable. - -Provides the application information. +> API version 9 is a canary version for trial use. The APIs of this version may be unstable. ## ApplicationInfo **System capability**: SystemCapability.BundleManager.BundleFramework -| Name | Type | Readable| Writable| Description | -| -------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------ | -| name | string | Yes | No | Application name. | -| description | string | Yes | No | Application description. | -| descriptionId | number | Yes | No | Application description ID. | -| systemApp | boolean | Yes | No | Whether the application is a system application. The default value is **false**. | -| enabled | boolean | Yes | No | Whether the application is enabled. The default value is **true**. | -| label | string | Yes | No | Application label. | -| labelId | string | Yes | No | Application label ID. | -| icon | string | Yes | No | Application icon. | -| iconId | string | Yes | No | Application icon ID. | -| process | string | Yes | No | Process in which the application runs. If this parameter is not set, the bundle name is used.| -| supportedModes | number | Yes | No | Running modes supported by the application. | -| moduleSourceDirs | Array\ | Yes | No | Relative paths for storing application resources. | -| permissions | Array\ | Yes | No | Permissions required for accessing the application. | -| moduleInfos | Array\<[ModuleInfo](js-apis-bundle-ModuleInfo.md)> | Yes | No | Application module information. | -| entryDir | string | Yes | No | Path for storing application files. | -| codePath8+ | string | Yes | No | Installation directory of the application. | -| metaData8+ | Map\> | Yes | No | Custom metadata of the application. | -| metadata9+ | Map\> | Yes | No | Metadata of the application. | -| removable8+ | boolean | Yes | No | Whether the application is removable. | -| accessTokenId8+ | number | Yes | No | Access token ID of the application. | -| uid8+ | number | Yes | No | UID of the application. | -| entityType8+ | string | Yes | No | Entity type of the application. | +| Name | Type | Readable| Writable| Description | +| -------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------------------------ | +| name | string | Yes | No | Application name. | +| description | string | Yes | No | Application description. | +| descriptionId | number | Yes | No | Application description ID. | +| systemApp | boolean | Yes | No | Whether the application is a system application. The default value is **false**. | +| enabled | boolean | Yes | No | Whether the application is enabled. The default value is **true**. | +| label | string | Yes | No | Application label. | +| labelId | string | Yes | No | Application label ID. | +| icon | string | Yes | No | Application icon. | +| iconId | string | Yes | No | Application icon ID. | +| process | string | Yes | No | Process in which the application runs. If this parameter is not set, the bundle name is used. | +| supportedModes | number | Yes | No | Running modes supported by the application. | +| moduleSourceDirs | Array\ | Yes | No | Relative paths for storing application resources. | +| permissions | Array\ | Yes | No | Permissions required for accessing the application.
The value is obtained by passing **GET_APPLICATION_INFO_WITH_PERMISSION**.| +| moduleInfos | Array\<[ModuleInfo](js-apis-bundle-ModuleInfo.md)> | Yes | No | Application module information. | +| entryDir | string | Yes | No | Path for storing application files. | +| codePath8+ | string | Yes | No | Installation directory of the application. | +| metaData8+ | Map\> | Yes | No | Custom metadata of the application.
The value is obtained by passing **GET_APPLICATION_INFO_WITH_METADATA**.| +| metadata9+ | Map\> | Yes | No | Metadata of the application.
The value is obtained by passing **GET_APPLICATION_INFO_WITH_METADATA**.| +| removable8+ | boolean | Yes | No | Whether the application is removable. | +| accessTokenId8+ | number | Yes | No | Access token ID of the application. | +| uid8+ | number | Yes | No | UID of the application. | +| entityType8+ | string | Yes | No | Entity type of the application. | diff --git a/en/application-dev/reference/apis/js-apis-bundle-BundleInfo.md b/en/application-dev/reference/apis/js-apis-bundle-BundleInfo.md index 6bdc0cb79fe91431780e39aabb1581e9a90ab7a2..2f5348529a0b27e4c594550f9f57219e534b2013 100644 --- a/en/application-dev/reference/apis/js-apis-bundle-BundleInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundle-BundleInfo.md @@ -1,43 +1,45 @@ # BundleInfo +The **BundleInfo** module provides bundle information. Unless otherwise specified, all attributes are obtained through **GET_BUNDLE_DEFAULT**. + > **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. > -> API version 9 is a canary version for trial use. The APIs of this version may be unstable. - -Provides the application bundle information. +> API version 9 is a canary version for trial use. The APIs of this version may be unstable. ## BundleInfo **System capability**: SystemCapability.BundleManager.BundleFramework -| Name | Type | Readable| Writable| Description | -| --------------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------ | -| name | string | Yes | No | Bundle name. | -| type | string | Yes | No | Bundle type. | -| appId | string | Yes | No | ID of the application to which the bundle belongs. | -| uid | number | Yes | No | UID of the application to which the bundle belongs. | -| installTime | number | Yes | No | Time when the HAP file was installed. | -| updateTime | number | Yes | No | Time when the HAP file was updated. | -| appInfo | ApplicationInfo | Yes | No | Application configuration information. | -| abilityInfos | Array\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)> | Yes | No | Ability configuration information. | -| reqPermissions | Array\ | Yes | No | Permissions to request from the system for running the application. | -| reqPermissionDetails | Array\<[ReqPermissionDetail](#reqpermissiondetail)> | Yes | No | Detailed information of the permissions to request from the system.| -| vendor | string | Yes | No | Vendor of the bundle. | -| versionCode | number | Yes | No | Version number of the bundle. | -| versionName | string | Yes | No | Version description of the bundle. | -| compatibleVersion | number | Yes | No | Earliest SDK version required for running the bundle. | -| targetVersion | number | Yes | No | Latest SDK version required for running the bundle. | -| isCompressNativeLibs | boolean | Yes | No | Whether to compress the native library of the bundle. The default value is **true**. | -| hapModuleInfos | Array\<[HapModuleInfo](js-apis-bundle-HapModuleInfo.md)> | Yes | No | Module configuration information. | -| entryModuleName | string | Yes | No | Name of the entry module. | -| cpuAbi | string | Yes | No | cpuAbi information of the bundle. | -| isSilentInstallation | string | Yes | No | Whether the application can be installed in silent mode. | -| minCompatibleVersionCode | number | Yes | No | Earliest version compatible with the bundle in the distributed scenario. | -| entryInstallationFree | boolean | Yes | No | Whether installation-free is supported for the entry module. | -| reqPermissionStates8+ | Array\ | Yes | No | Permission grant state. | -| extensionAbilityInfo9+ | Array\<[ExtensionAbilityInfo](js-apis-bundle-ExtensionAbilityInfo.md)> | Yes | No | Extension ability information. | +| Name | Type | Readable| Writable| Description | +| --------------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------------------------ | +| name | string | Yes | No | Bundle name. | +| type | string | Yes | No | Bundle type. | +| appId | string | Yes | No | ID of the application to which the bundle belongs. | +| uid | number | Yes | No | UID of the application to which the bundle belongs. | +| installTime | number | Yes | No | Time when the HAP file was installed. | +| updateTime | number | Yes | No | Time when the HAP file was updated. | +| appInfo | ApplicationInfo | Yes | No | Application configuration information. | +| abilityInfos | Array\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)> | Yes | No | Ability configuration information.
The value is obtained by passing **GET_BUNDLE_WITH_ABILITIES**.| +| reqPermissions | Array\ | Yes | No | Permissions to request from the system for running the application.
The value is obtained by passing **GET_BUNDLE_WITH_REQUESTED_PERMISSION**.| +| reqPermissionDetails | Array\<[ReqPermissionDetail](#reqpermissiondetail)> | Yes | No | Detailed information of the permissions to request from the system.
The value is obtained by passing **GET_BUNDLE_WITH_REQUESTED_PERMISSION**.| +| vendor | string | Yes | No | Vendor of the bundle. | +| versionCode | number | Yes | No | Version number of the bundle. | +| versionName | string | Yes | No | Version description of the bundle. | +| compatibleVersion | number | Yes | No | Earliest SDK version required for running the bundle. | +| targetVersion | number | Yes | No | Latest SDK version required for running the bundle. | +| isCompressNativeLibs | boolean | Yes | No | Whether to compress the native library of the bundle. The default value is **true**. | +| hapModuleInfos | Array\<[HapModuleInfo](js-apis-bundle-HapModuleInfo.md)> | Yes | No | Module configuration information. | +| entryModuleName | string | Yes | No | Name of the entry module. | +| cpuAbi | string | Yes | No | CPU and ABI information of the bundle. | +| isSilentInstallation | string | Yes | No | Whether the application can be installed in silent mode. | +| minCompatibleVersionCode | number | Yes | No | Earliest version compatible with the bundle in the distributed scenario. | +| entryInstallationFree | boolean | Yes | No | Whether installation-free is supported for the entry module. | +| reqPermissionStates8+ | Array\ | Yes | No | Permission grant state. | +| extensionAbilityInfo9+ | Array\<[ExtensionAbilityInfo](js-apis-bundle-ExtensionAbilityInfo.md)> | Yes | No | Extension ability information.
The value is obtained by passing **GET_BUNDLE_WITH_EXTENSION_ABILITY**.| + + ## ReqPermissionDetail @@ -51,6 +53,8 @@ Provides the detailed information of the permissions to request from the system. | reason | string | Yes | Yes | Reason for requesting the permission. | | usedScene | [UsedScene](#usedscene) | Yes | Yes | Application scenario and timing for using the permission.| + + ## UsedScene Describes the application scenario and timing for using the permission. diff --git a/en/application-dev/reference/apis/js-apis-bundle-ExtensionAbilityInfo.md b/en/application-dev/reference/apis/js-apis-bundle-ExtensionAbilityInfo.md index cb2954372b4c4e02564bcfcff06408aac773a0a4..0ceee9af9b11189035dee2406e50d6b443581b8a 100644 --- a/en/application-dev/reference/apis/js-apis-bundle-ExtensionAbilityInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundle-ExtensionAbilityInfo.md @@ -1,12 +1,12 @@ # ExtensionAbilityInfo +The **ExtensionAbilityInfo** module provides Extension ability information. Unless otherwise specified, all attributes are obtained through **GET_BUNDLE_DEFAULT**. + > **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. > -> API version 9 is a canary version for trial use. The APIs of this version may be unstable. - -Provides the Extension ability information. +> API version 9 is a canary version for trial use. The APIs of this version may be unstable. ## ExtensionAbilityInfo @@ -24,7 +24,7 @@ Provides the Extension ability information. | extensionAbilityType | bundle.ExtensionAbilityType | Yes | No | Type of the Extension ability. | | permissions | Array\ | Yes | No | Permissions required for other applications to call the Extension ability.| | applicationInfo | ApplicationInfo | Yes | No | Application information of the Extension ability. | -| metaData | Array\<[Metadata](js-apis-bundle-Metadata.md)> | Yes | No | Metadata of the Extension ability. | +| metadata | Array\<[Metadata](js-apis-bundle-Metadata.md)> | Yes | No | Metadata of the Extension ability. | | enabled | boolean | Yes | No | Whether the Extension ability is enabled. | -| readPermission | string | Yes | No | Permission required for reading the Extension ability data. | +| readPermission | string | Yes | No | Permission required for reading data from the Extension ability. | | writePermission | string | Yes | No | Permission required for writing data to the Extension ability. | diff --git a/en/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md b/en/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md index 3ed697324f926887108288c3a665311e094b9b8c..58a9e46ead747d0004ce9730d602d63db6af1c70 100644 --- a/en/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md @@ -1,12 +1,12 @@ # HapModuleInfo +The **HapModuleInfo** module provides module information. Unless otherwise specified, all attributes are obtained through **GET_BUNDLE_DEFAULT**. + > **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. > -> API version 9 is a canary version for trial use. The APIs of this version may be unstable. - -Provides the HAP module information. +> API version 9 is a canary version for trial use. The APIs of this version may be unstable. ## HapModuleInfo diff --git a/en/application-dev/reference/apis/js-apis-media.md b/en/application-dev/reference/apis/js-apis-media.md index 54f8280d96c6310f626e78d6d00d23ff8ebf15bf..2c5a40a58caa3804a260910005af85a27f2a67b8 100644 --- a/en/application-dev/reference/apis/js-apis-media.md +++ b/en/application-dev/reference/apis/js-apis-media.md @@ -60,7 +60,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 { @@ -89,7 +89,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 { @@ -307,7 +307,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; } @@ -380,7 +380,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]); } @@ -416,7 +416,7 @@ function printfDescription(obj) { } audioPlayer.getTrackDescription().then((arrlist) => { - if (typeof (arrlist) != 'undefined') { + if (arrlist != null) { arrayDescription = arrlist; } else { console.log('audio getTrackDescription fail'); @@ -491,7 +491,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; } @@ -546,7 +546,7 @@ Subscribes to the 'timeUpdate' event. ```js audioPlayer.on('timeUpdate', (seekDoneTime) => { // Set the 'timeUpdate' event callback. - if (typeof (seekDoneTime) == 'undefined') { + if (seekDoneTime == null) { console.info('audio seek fail'); return; } @@ -595,7 +595,6 @@ Enumerates the audio playback states. You can obtain the state through the **sta | stopped | string | Audio playback is stopped. | | error8+ | string | Audio playback is in the error state. | - ## VideoPlayer8+ Provides APIs to manage and play video. Before calling an API of **VideoPlayer**, you must call [createVideoPlayer()](#mediacreatevideoplayer8) to create a [VideoPlayer](#videoplayer8) instance. @@ -635,7 +634,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!'); @@ -691,7 +690,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!'); @@ -741,7 +740,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!'); @@ -791,7 +790,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!'); @@ -841,7 +840,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!'); @@ -891,7 +890,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!'); @@ -942,7 +941,7 @@ Seeks to the specified playback position. The next key frame at the specified po ```js videoPlayer.seek((seekTime, err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('seek success!'); } else { console.info('seek fail!'); @@ -970,7 +969,7 @@ Seeks to the specified playback position. This API uses a callback to return the ```js videoPlayer.seek((seekTime, seekMode, err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('seek success!'); } else { console.info('seek fail!'); @@ -1034,7 +1033,7 @@ Sets the volume. This API uses a callback to return the result. ```js videoPlayer.setVolume((vol, err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('setVolume success!'); } else { console.info('setVolume fail!'); @@ -1090,7 +1089,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!'); @@ -1148,7 +1147,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]); } @@ -1185,7 +1184,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'); @@ -1217,7 +1216,7 @@ Sets the video playback speed. This API uses a callback to return the result. ```js videoPlayer.setSpeed((speed:number, err) => { - if (typeof (err) == 'undefined') { + if (err == null) { console.info('setSpeed success!'); } else { console.info('setSpeed fail!'); @@ -1438,7 +1437,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. } diff --git a/en/application-dev/reference/apis/js-apis-router.md b/en/application-dev/reference/apis/js-apis-router.md index 3db58b1c88bc84c8201a377df426e215f5837e77..d258ac2b76fa3babf53469ee2518291919feb1dc 100644 --- a/en/application-dev/reference/apis/js-apis-router.md +++ b/en/application-dev/reference/apis/js-apis-router.md @@ -115,7 +115,7 @@ Returns to the previous page or a specified page. **Parameters** | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| options | [RouterOptions](#routeroptions) | Yes| 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) | Yes| 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** ```js diff --git a/zh-cn/application-dev/device/usb-guidelines.md b/zh-cn/application-dev/device/usb-guidelines.md index 4743a90dd8a3bd7b072054c19fd00bd5b314f2ff..8c836de6508cd2a01eeb76f4a74b93bba695db9c 100644 --- a/zh-cn/application-dev/device/usb-guidelines.md +++ b/zh-cn/application-dev/device/usb-guidelines.md @@ -17,19 +17,19 @@ USB类开放能力如下,具体请查阅[API参考文档](../reference/apis/js | 接口名 | 描述 | | -------- | -------- | -| hasRight(deviceName: string): boolean | 如果“使用者”(如各种App或系统)有权访问设备则返回true;无权访问设备则返回false。 | -| requestRight(deviceName: string): Promise<boolean> | 请求给定软件包的临时权限以访问设备。 | -| connectDevice(device: USBDevice): Readonly<USBDevicePipe> | 根据getDevices()返回的设备信息打开USB设备。 | -| getDevices(): Array<Readonly<USBDevice>> | 返回USB设备的列表。 | -| setConfiguration(pipe: USBDevicePipe, config: USBConfig): number | 设置设备的配置。 | -| setInterface(pipe: USBDevicePipe, iface: USBInterface): number | 设置设备的接口。 | -| claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number | 获取接口。 | -|bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, timeout?: number): Promise<number> | 批量传输。 | -| closePipe(pipe: USBDevicePipe): number | 关闭设备消息控制通道。 | -| releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number | 释放接口。 | -| getFileDescriptor(pipe: USBDevicePipe): number | 获取文件描述符。 | -| getRawDescriptor(pipe: USBDevicePipe): Uint8Array | 获取原始的USB描述符。 | -| controlTransfer(pipe: USBDevicePipe, contrlparam: USBControlParams, timeout?: number): Promise<number> | 控制传输。 | +| hasRight(deviceName:string):boolean | 如果“使用者”(如各种App或系统)有权访问设备则返回true;无权访问设备则返回false。 | +| requestRight(deviceName:string):Promise<boolean> | 请求给定软件包的临时权限以访问设备。 | +| connectDevice(device:USBDevice):Readonly<USBDevicePipe> | 根据`getDevices()`返回的设备信息打开USB设备。 | +| getDevices():Array<Readonly<USBDevice>> | 返回USB设备列表。 | +| setConfiguration(pipe:USBDevicePipe,config:USBConfig):number | 设置设备的配置。 | +| setInterface(pipe:USBDevicePipe,iface:USBInterface):number | 设置设备的接口。 | +| claimInterface(pipe:USBDevicePipe,iface:USBInterface,force?:boolean):number | 获取接口。 | +|bulkTransfer(pipe:USBDevicePipe,endpoint:USBEndpoint,buffer:Uint8Array,timeout?:number):Promise<number> | 批量传输。 | +| closePipe(pipe:USBDevicePipe):number | 关闭设备消息控制通道。 | +| releaseInterface(pipe:USBDevicePipe,iface:USBInterface):number | 释放接口。 | +| getFileDescriptor(pipe:USBDevicePipe):number | 获取文件描述符。 | +| getRawDescriptor(pipe:USBDevicePipe):Uint8Array | 获取原始的USB描述符。 | +| controlTransfer(pipe:USBDevicePipe,contrlparam:USBControlParams,timeout?:number):Promise<number> | 控制传输。 | ## 开发步骤 @@ -115,7 +115,7 @@ USB设备可作为Host设备连接Device设备进行数据传输。开发示例 打开对应接口,在设备信息(deviceList)中选取对应的interface。 interface1为设备配置中的一个接口。 */ - usb.claimInterface(pipe , interface1, true); + usb.claimInterface(pipe, interface1, true); ``` 4. 数据传输。 diff --git a/zh-cn/application-dev/internationalization/intl-guidelines.md b/zh-cn/application-dev/internationalization/intl-guidelines.md index 52309a061652382bd03ff417d23cceeaf439bf30..46da7279de53cc77d45db1dfca156d2c467f699f 100644 --- a/zh-cn/application-dev/internationalization/intl-guidelines.md +++ b/zh-cn/application-dev/internationalization/intl-guidelines.md @@ -326,6 +326,6 @@ Intl开发指导提供了ECMA 402中定义的国际化能力接口的使用方 针对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/notification/background-agent-scheduled-reminder-guide.md b/zh-cn/application-dev/notification/background-agent-scheduled-reminder-guide.md index a29a36a5fc857ecb83dbb0da378176eee5859730..12380b3370f08c172450ab403a5575920d471ba5 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 @@ -282,7 +282,7 @@ let alarm : reminderAgent.ReminderRequestAlarm = { 基于后台代理提醒开发,有以下相关实例可供参考: -- [`AlarmClock`:后台代理提醒(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/Notification/AlarmClock) +- [`AlarmClock`:后台代理提醒(eTS)(API8)](https://gitee.com/openharmony/applications_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) diff --git a/zh-cn/application-dev/quick-start/stage-structure.md b/zh-cn/application-dev/quick-start/stage-structure.md index e9b246568c0d6885e1a12ab43cfeded9983bfbb7..417b2e99214a58f7b5ce78b55ee455600d1380aa 100644 --- a/zh-cn/application-dev/quick-start/stage-structure.md +++ b/zh-cn/application-dev/quick-start/stage-structure.md @@ -2,7 +2,7 @@ # 应用包结构配置文件的说明 -在开发FA模型下的应用程序时,需要在config.json文件中对应用的包结构进行申明;同样的,在开发stage模型下的应用程序时,需要在module.json和app.json配置文件中对应用的包结构进行声明。 +在开发FA模型下的应用程序时,需要在config.json文件中对应用的包结构进行申明;同样的,在开发stage模型下的应用程序时,需要在module.json5和app.json配置文件中对应用的包结构进行声明。 ## 配置文件内部结构 @@ -66,7 +66,7 @@ app.json示例: ### module对象内部结构 -module.json示例: +module.json5示例: ```json { @@ -543,7 +543,7 @@ form示例 : } ``` -在module.json的extension组件下面定义metadata信息 +在module.json5的extension组件下面定义metadata信息 ```json { @@ -665,7 +665,7 @@ metadata中指定commonEvent信息,其中 : } ``` -在module.json的extension组件下面定义metadata信息,如下 : +在module.json5的extension组件下面定义metadata信息,如下 : ```json "extensionAbilities": [ @@ -757,7 +757,7 @@ distroFilter示例 : ] ``` -在module.json的extensionAbilities组件下面定义metadata信息,如下 : +在module.json5的extensionAbilities组件下面定义metadata信息,如下 : ```json "extensionAbilities": [ 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 929e3176ffe672a2c0382ee87854775fb54fdda6..8404d21f0912af47ecb183483a22fcff93d43f5d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-Context.md +++ b/zh-cn/application-dev/reference/apis/js-apis-Context.md @@ -193,6 +193,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.getApplicationInfo diff --git a/zh-cn/application-dev/reference/apis/js-apis-brightness.md b/zh-cn/application-dev/reference/apis/js-apis-brightness.md index 17676f2c3a129536fcce34ca4e5cb418676d736a..e313d9fafc58bfd6e787c37aea890833f4965c7a 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-brightness.md +++ b/zh-cn/application-dev/reference/apis/js-apis-brightness.md @@ -1,10 +1,10 @@ # 屏幕亮度 +该模块提供屏幕亮度的设置接口。 + > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 -该模块提供屏幕亮度的设置接口。 - ## 导入模块 diff --git a/zh-cn/application-dev/reference/apis/js-apis-logs.md b/zh-cn/application-dev/reference/apis/js-apis-logs.md index ed92b8b2c47d6826c1ba0c90178046cca60678ba..81203760b52838389b008cae779e23116380bff7 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-logs.md +++ b/zh-cn/application-dev/reference/apis/js-apis-logs.md @@ -1,7 +1,12 @@ # 日志打印 -> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** -> 从API Version 7 开始,该接口不再维护,推荐使用新接口[`@ohos.hilog`](js-apis-hilog.md)'。 +本模块提供基础的日志打印能力,支持按照日志级别打印日志信息。 + +如果需要使用更高级的日志打印服务,比如按照指定标识筛选日志内容,推荐使用[`@ohos.hilog`](js-apis-hilog.md)。 + +> **说明:** +> +> 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 ## console.debug @@ -9,10 +14,13 @@ debug(message: string): void 打印debug级别的日志信息。 -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | ------- | ------ | ---- | ----------- | - | message | string | 是 | 表示要打印的文本信息。 | +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ------ | ---- | ----------- | +| message | string | 是 | 表示要打印的文本信息。 | ## console.log @@ -21,10 +29,13 @@ log(message: string): void 打印debug级别的日志信息。 -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | ------- | ------ | ---- | ----------- | - | message | string | 是 | 表示要打印的文本信息。 | +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ------ | ---- | ----------- | +| message | string | 是 | 表示要打印的文本信息。 | ## console.info @@ -33,10 +44,13 @@ info(message: string): void 打印info级别的日志信息。 -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | ------- | ------ | ---- | ----------- | - | message | string | 是 | 表示要打印的文本信息。 | +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ------ | ---- | ----------- | +| message | string | 是 | 表示要打印的文本信息。 | ## console.warn @@ -45,10 +59,13 @@ warn(message: string): void 打印warn级别的日志信息。 -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | ------- | ------ | ---- | ----------- | - | message | string | 是 | 表示要打印的文本信息。 | +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ------ | ---- | ----------- | +| message | string | 是 | 表示要打印的文本信息。 | ## console.error @@ -57,10 +74,13 @@ error(message: string): void 打印error级别的日志信息。 -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | ------- | ------ | ---- | ----------- | - | message | string | 是 | 表示要打印的文本信息。 | +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ------ | ---- | ----------- | +| message | string | 是 | 表示要打印的文本信息。 | ## 示例 diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-battery.md b/zh-cn/application-dev/reference/apis/js-apis-system-battery.md index 3a52e071218063300184d674c36bafbced129641..2c4b2dedd6ad05b58909ef2018d0c7abe46743c4 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-battery.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-battery.md @@ -1,6 +1,6 @@ # 电量信息 -> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** +> **说明:** > - 从API Version 6开始,该接口不再维护,推荐使用新接口[`@ohos.batteryInfo`](js-apis-battery-info.md)。 > > - 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 @@ -26,16 +26,9 @@ getStatus(Object): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| success | Function | 否 | 接口调用成功的回调函数。 | -| fail | Function | 否 | 接口调用失败的回调函数。 | -| complete | Function | 否 | 接口调用结束的回调函数。 | - -success返回值: - -| 参数名 | 类型 | 说明 | -| -------- | -------- | -------- | -| charging | boolean | 当前电池是否在充电中。 | -| level | number | 当前电池的电量,取值范围:0.00 - 1.00 。 | +| success | (data: [BatteryResponse](#batteryresponse)) => void | 否 | 接口调用成功的回调函数。| +| fail | (data: string, code: number) => void | 否 | 接口调用失败的回调函数。| +| complete | () => void | 否 | 接口调用结束的回调函数。 | **示例:** @@ -52,4 +45,11 @@ export default { }); }, } -``` \ No newline at end of file +``` + +## BatteryResponse + +| 参数名 | 类型 | 说明 | +| -------- | -------- | -------- | +| charging | boolean | 当前电池是否在充电中。 | +| level | number | 当前电池的电量,取值范围:0.00 - 1.00 。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-brightness.md b/zh-cn/application-dev/reference/apis/js-apis-system-brightness.md index aa52115fe4f88eea6c57b03ede1731d73c11cefd..cf8e51aa4d1b60ca58443507a460b53ae55387bc 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-brightness.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-brightness.md @@ -1,6 +1,6 @@ # 屏幕亮度 -> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** +> **说明:** > - 从API Version 7 开始,该接口不再维护,推荐使用新接口[`@ohos.brightness`](js-apis-brightness.md)。 > > - 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 @@ -23,11 +23,12 @@ getValue(Object): void **系统能力:** SystemCapability.PowerManager.DisplayPowerManager **参数:** + | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| success | Function | 否 | 接口调用成功的回调函数。 | -| fail | Function | 否 | 接口调用失败的回调函数。 | -| complete | Function | 否 | 接口调用结束的回调函数。 | +| success | (data: [BrightnessResponse](#brightnessresponse)) => void | 否 | 接口调用成功的回调函数。 | +| fail | (data: string, code: number) => void | 否 | 接口调用失败的回调函数。 | +| complete | () => void | 否 | 接口调用结束的回调函数。 | success返回值: @@ -35,6 +36,7 @@ success返回值: | -------- | -------- | -------- | | value | number | 屏幕亮度,取值为1-255之间的整数。 | + **示例:** ```js @@ -62,12 +64,13 @@ setValue(Object): void **系统能力:** SystemCapability.PowerManager.DisplayPowerManager **参数:** + | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | value | number | 是 | 屏幕亮度,值为1-255之间的整数。
- 如果值小于等于0,系统按1处理。
- 如果值大于255,系统按255处理。
- 如果值为小数,系统将处理为整数。例如设置为8.1,系统按8处理。 | -| success | Function | 否 | 接口调用成功的回调函数。 | -| fail | Function | 否 | 接口调用失败的回调函数。 | -| complete | Function | 否 | 接口调用结束的回调函数。 | +| success | () => void | 否 | 接口调用成功的回调函数。 | +| fail | (data: string, code: number) => void | 否 | 接口调用失败的回调函数。 | +| complete | () => void | 否 | 接口调用结束的回调函数。 | **示例:** @@ -97,13 +100,14 @@ getMode(Object): void **系统能力:** SystemCapability.PowerManager.DisplayPowerManager **参数:** + | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| success | Function | 否 | 接口调用成功的回调函数。 | -| fail | Function | 否 | 接口调用失败的回调函数。 | -| complete | Function | 否 | 接口调用结束的回调函数。 | +| success | (data: [BrightnessModeResponse](#brightnessmoderesponse)) => void | 否 | 接口调用成功的回调函数。 | +| fail | (data: string, code: number) => void | 否 | 接口调用失败的回调函数。 | +| complete | () => void | 否 | 接口调用结束的回调函数。 | - success返回值: +success返回值: | 参数名 | 类型 | 说明 | | -------- | -------- | -------- | @@ -138,10 +142,10 @@ setMode(Object): void **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| mode | number | 是 | 值为0或1
- 0为手动调节屏幕亮度
- 1为自动调节屏幕亮度 | -| success | Function | 否 | 接口调用成功的回调函数。 | -| fail | Function | 否 | 接口调用失败的回调函数。 | -| complete | Function | 否 | 接口调用结束的回调函数。 | +| mode | number | 是 | 值为0或1
- 0为手动调节屏幕亮度。
- 1为自动调节屏幕亮度。 | +| success | () => void | 否 | 接口调用成功的回调函数。 | +| fail | (data: string, code: number) => void | 否 | 接口调用失败的回调函数。 | +| complete | () => void | 否 | 接口调用结束的回调函数。 | **示例:** @@ -174,9 +178,9 @@ setKeepScreenOn(Object): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | keepScreenOn | boolean | 是 | 是否保持屏幕常亮。 | -| success | Function | 否 | 接口调用成功的回调函数。 | -| fail | Function | 否 | 接口调用失败的回调函数。 | -| complete | Function | 否 | 接口调用结束的回调函数。 | +| success | () => void | 否 | 接口调用成功的回调函数。 | +| fail | (data: string, code: number) => void | 否 | 接口调用失败的回调函数。 | +| complete | () => void | 否 | 接口调用结束的回调函数。 | **示例:** @@ -195,3 +199,17 @@ setKeepScreenOn(Object): void }, } ``` +## + +## BrightnessResponse + +| 名称 | 类型 | 说明 | +| -------- | -------- | -------- | +| value | number | 屏幕亮度,取值为1-255之间的整数。 | + +## BrightnessModeResponse + +| 名称 | 类型 | 说明 | +| -------- | -------- | -------- | +| mode | number | 值为0或1。
-0为手动调节屏幕亮度模式。
-1为手动调节屏幕亮度模式。 | + diff --git a/zh-cn/application-dev/reference/apis/js-apis-timer.md b/zh-cn/application-dev/reference/apis/js-apis-timer.md index 8085456cf414c6b960aa2f6bc6a5ca003bc777f5..735737431ac22d891412701063b23ca254979d9b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-timer.md +++ b/zh-cn/application-dev/reference/apis/js-apis-timer.md @@ -1,5 +1,10 @@ # 定时器 +本模块提供基础的定时器能力,支持按照指定的时间执行对应函数。 + +> **说明:** +> +> 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 ## setTimeout @@ -7,19 +12,24 @@ setTimeout(handler[,delay[,…args]]): number 设置一个定时器,该定时器在定时器到期后执行一个函数。 -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | handler | Function | 是 | 定时器到期后执行函数。 | - | delay | number | 否 | 延迟的毫秒数,函数的调用会在该延迟之后发生。如果省略该参数,delay取默认值0,意味着“马上”执行,或尽快执行。 | - | ...args | Array<any> | 否 | 附加参数,一旦定时器到期,它们会作为参数传递给handler。 | +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| handler | Function | 是 | 定时器到期后执行函数。 | +| delay | number | 否 | 延迟的毫秒数,函数的调用会在该延迟之后发生。如果省略该参数,delay取默认值0,意味着“马上”执行,或尽快执行。 | +| ...args | Array<any> | 否 | 附加参数,一旦定时器到期,它们会作为参数传递给handler。 | + +**返回值:** -- 返回值 - | 类型 | 说明 | - | -------- | -------- | - | number | timeout定时器的ID。 | +| 类型 | 说明 | +| -------- | -------- | +| number | timeout定时器的ID。 | + +**示例:** -- 示例 ```js export default { setTimeOut() { @@ -37,12 +47,16 @@ clearTimeout(timeoutID: number): void 取消了先前通过调用setTimeout()建立的定时器。 -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | timeoutID | number | 是 | 要取消定时器的ID, 是由setTimeout()返回的。 | +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| timeoutID | number | 是 | 要取消定时器的ID, 是由setTimeout()返回的。 | + +**示例:** -- 示例 ```js export default { clearTimeOut() { @@ -61,19 +75,24 @@ setInterval(handler[, delay[, ...args]]): number 重复调用一个函数,在每次调用之间具有固定的时间延迟。 -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | handler | Function | 是 | 要重复调用的函数。 | - | delay | number | 否 | 延迟的毫秒数(一秒等于1000毫秒),函数的调用会在该延迟之后发生。 | - | ...args | Array<any> | 否 | 附加参数,一旦定时器到期,他们会作为参数传递给handler。 | +**系统能力:** SystemCapability.ArkUI.ArkUI.Full -- 返回值 - | 类型 | 说明 | - | -------- | -------- | - | number | intervalID重复定时器的ID。 | +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| handler | Function | 是 | 要重复调用的函数。 | +| delay | number | 否 | 延迟的毫秒数(一秒等于1000毫秒),函数的调用会在该延迟之后发生。 | +| ...args | Array<any> | 否 | 附加参数,一旦定时器到期,他们会作为参数传递给handler。 | + +**返回值:** + +| 类型 | 说明 | +| -------- | -------- | +| number | intervalID重复定时器的ID。 | + +**示例:** -- 示例 ```js export default { setInterval() { @@ -89,14 +108,18 @@ setInterval(handler[, delay[, ...args]]): number clearInterval(intervalID: number): void -可取消先前通过 setInterval() 设置的重复定时任务。 +可取消先前通过setInterval()设置的重复定时任务。 -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | intervalID | number | 是 | 要取消的重复定时器的ID,是由 setInterval() 返回的。 | +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| intervalID | number | 是 | 要取消的重复定时器的ID,是由 setInterval() 返回的。 | + +**示例:** -- 示例 ```js export default { clearInterval() { @@ -107,4 +130,3 @@ clearInterval(intervalID: number): void } } ``` - 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 f2c0b6cf7b21655ccf681ddd8fe45136c4cb1a54..204459ff0e9a17dd08fcd22bb0100cbc71bebbfb 100644 --- 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 c57f9b87dd7b0c66f7ee6bf7ac027bf71a29a4cc..be0517cdd2004bdfd8cac994f75b543b76db59a0 100644 --- 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/arkui-ts/ts-basic-components-search.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-search.md index 2e0a2af3022c4824338731a4ee1c05c25716b970..1f1038d5d03cea38ae18d0dd9f701a4a6d1aa9dd 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-search.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-search.md @@ -74,15 +74,15 @@ caretPosition(value: number): void @Entry @Component struct SearchExample { - @State changevalue: string = '' - @State submitvalue: string = '' + @State changeValue: string = '' + @State submitValue: string = '' controller: SearchController = new SearchController() build() { Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { - Text(this.submitvalue) - Text(this.changevalue) - Search({value: this.changevalue, placeholder: 'Type to search', controller: this.controller}) + Text(this.submitValue) + Text(this.changeValue) + Search({value: this.changeValue, placeholder: 'Type to search', controller: this.controller}) .searchButton('Search') .width(400) .height(35) @@ -90,10 +90,10 @@ struct SearchExample { .placeholderColor(Color.Grey) .placeholderFont({ size: 26, weight: 10, family: 'serif', style: FontStyle.Normal }) .onSubmit((value: string) => { - this.submitvalue = value + this.submitValue = value }) .onChange((value: string) => { - this.changevalue += value + this.changeValue = value }) .margin({ top: 30, left:10, right:10 }) } diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md index a9f1e5f4a69cb11a737841c2f188e0b92996daf7..be9664b302a47b6b2b5e4870f03fc11a3fb949a6 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md @@ -1,11 +1,13 @@ # Swiper - 滑动容器,提供切换子组件显示的能力。 > **说明:** > > 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 + + + ## 权限列表 无 @@ -20,11 +22,12 @@ Swiper(value?:{controller?: SwiperController}) -**参数:** +**参数:** + + | 参数名 | 参数类型 | 必填 | 参数描述 | + | ---------- | ------------------------------------- | ---- | -------------------- | + | controller | [SwiperController](#swipercontroller) | 否 | 给组件绑定一个控制器,用来控制组件翻页。
默认值:null | -| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | -| ---------- | ------------------------------------- | ---- | ---- | -------------------- | -| controller | [SwiperController](#swipercontroller) | 否 | null | 给组件绑定一个控制器,用来控制组件翻页。 | ## 属性 @@ -47,44 +50,68 @@ Swiper(value?:{controller?: SwiperController}) | effectMode8+ | EdgeEffect | EdgeEffect.Spring | 设置滑动到边缘时的显示效果。 | | curve8+ | [Curve](ts-appendix-enums.md#curve) \| string | Curve.Ease | 设置Swiper的动画曲线,默认为淡入淡出曲线,常用曲线参考[Curve枚举说明](ts-appendix-enums.md#curve),也可以通过插值计算模块提供的接口创建自定义的Curves([插值曲线对象](ts-interpolation-calculation.md))。 | | indicatorStyle8+ | {
left?: [Length](ts-types.md#length),
top?: [Length](ts-types.md#length),
right?: [Length](ts-types.md#length),
bottom?: [Length](ts-types.md#length),
size?: [Length](ts-types.md#length),
mask?: boolean,
color?: [ResourceColor](ts-types.md#resourcecolor8),
selectedColor?: [ResourceColor](ts-types.md#resourcecolor8)
} | - | 设置indicator样式:
- left: 设置导航点距离Swiper组件左边的距离。
- top: 设置导航点距离Swiper组件顶部的距离。
- right: 设置导航点距离Swiper组件右边的距离。
- bottom: 设置导航点距离Swiper组件底部的距离。
- size: 设置导航点的直径。
- mask: 设置是否显示导航点蒙层样式。
- color: 设置导航点的颜色。
- selectedColor: 设置选中的导航点的颜色。 | +## SwiperDisplayMode枚举说明 + + | 名称 | 描述 | + | ----------- | ------------------------------------------ | + | Stretch | Swiper滑动一页的宽度为Swiper组件自身的宽度。| + | AutoLinear | Swiper滑动一页的宽度为子组件宽度中的最大值。| +## EdgeEffect枚举说明 + + | 名称 | 描述 | + | ------ | ------------------------------------------------------------------------- | + | Spring | 弹性物理动效,滑动到边缘后可以通过触摸事件继续滑动一段距离,松手后回弹。 | + | Fade | 滑动到边缘后,可以通过触摸事件继续滑动一段阴影,松手后阴影回弹。 | + | None | 滑动到边缘后无效果。 | ## SwiperController Swiper容器组件的控制器,可以将此对象绑定至Swiper组件,然后通过它控制翻页。 -| 接口名称 | 功能描述 | -| ------------------- | ------ | -| showNext() | 翻至下一页。 | -| showPrevious() | 翻至上一页。 | -| finishAnimation(callback?: () => void) | 停止Swiper动画。 | +### showNext -## SwiperDisplayMode枚举说明 +showNext(): void -| 名称 | 描述 | -| ------ | ---------------------------------------- | -| Stretch | Swiper滑动一页的宽度为Swiper组件自身的宽度。 | -| AutoLinear | Swiper滑动一页的宽度为子组件宽度中的最大值。 | +翻至下一页。 -## EdgeEffect枚举说明 +### showPrevious + +showPrevious(): void -| 名称 | 描述 | -| ------ | ---------------------------------------- | -| Spring | 弹性物理动效,滑动到边缘后可以根据初始速度或通过触摸事件继续滑动一段距离,松手后回弹。 | -| Fade | 阴影效果,滑动到边缘后会有圆弧状的阴影。 | -| None | 滑动到边缘后无效果。 | +翻至上一页。 +### finishAnimation + +finishAnimation(callback?: () => void): void + +停止播放动画。 + +**参数:** + +| 参数名 | 参数类型 | 必填项 | 参数描述 | +| --------- | ---------- | ------ | -------- | +| callback | () => void | 是 | 动画结束的回调。 | ## 事件 -| 名称 | 功能描述 | -| ---------------------------------------- | ------------------ | -| onChange(event: (index: number) => void) | 当前显示的子组件索引变化时触发该事件,返回值为当前显示的子组件的索引值。 | +### onChange + +onChange( index: number) => void + +当前显示的组件索引变化时触发该事件。 + +**参数:** + +| 参数名 | 参数类型 | 必填项 | 参数描述 | +| --------- | ---------- | ------ | -------- | +| index | number | 是 | 当前显示元素的索引。 | ## 示例 -``` +```ts +// xxx.ets class MyDataSource implements IDataSource { private list: number[] = [] private listener: DataChangeListener diff --git a/zh-cn/application-dev/security/permission-list.md b/zh-cn/application-dev/security/permission-list.md index f3f5e6bdf1217edcd3f3fc70ada79f10b56a585d..d3fd29b3aadf308fcc044256299539a8b6a25d02 100644 --- a/zh-cn/application-dev/security/permission-list.md +++ b/zh-cn/application-dev/security/permission-list.md @@ -77,7 +77,6 @@ | ohos.permission.SET_ABILITY_CONTROLLER | system_basic | system_grant | TRUE | 允许设置ability组件启动和停止控制权。 | | ohos.permission.USE_USER_IDM | system_basic | system_grant | FALSE | 允许应用访问系统身份凭据信息。 | | ohos.permission.MANAGE_USER_IDM | system_basic | system_grant | FALSE | 允许应用使用系统身份凭据管理能力进行口令、人脸、指纹等录入、修改、删除等操作。 | -| ohos.permission.ACCESS_BIOMETRIC | normal | system_grant | TRUE | 允许应用使用生物特征识别能力进行身份认证。 | | ohos.permission.ACCESS_USER_AUTH_INTERNAL | system_basic | system_grant | FALSE | 允许应用使用系统身份认证能力进行用户身份认证或身份识别。 | | ohos.permission.ACCESS_PIN_AUTH | system_basic | system_grant | FALSE | 允许应用使用口令输入接口,用于系统应用完成口令输入框绘制场景。 | | ohos.permission.GET_RUNNING_INFO | system_basic | 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 5a0b2fb0c2a557d804f106151d1f432906d60923..63abf1638eea80de283fb1f4d7cc63faad2cd907 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 @@ -289,4 +289,4 @@ export default { 基于后台任务管理,有以下相关实例可供参考: -- [`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/ui/ts-resource-access.md b/zh-cn/application-dev/ui/ts-resource-access.md index a804d024efad2b63cf011fe54719c50583a8fd7a..5fa2564d1623dc39dd3da2f8a0a5a8ae280fe4e5 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/ui-js-animate-background-position-style.md b/zh-cn/application-dev/ui/ui-js-animate-background-position-style.md index c293ca9b6a00b0eb11f0fa65220b0041525a450d..6bba68df526e4954da25c42f423248c22c7e73e5 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 4c45a884ba119e91bd9cf8fdcab768fd97760ccb..b8b2c2938cffdf4bd8c4b054bab49d28f0e0222e 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..c755b700452a88948a4a8189ea58ee3bd852cf59 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,21 @@ 针对组件开发,有以下相关实例可供参考: -- [`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) +- [`ECG`:心率检测(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/common/ECG) -- [`JsVideo`:视频播放(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/media/JsVideo) +- [`Badge`:事件标记控件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Badge) + +- [`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 eaa20d1aa8db22928bbd55d19447d71168de6ea6..71645421a2a3c700a841d48914497a1a85167efc 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 59421b9fefdaba9363a61368da04b71cc6821446..a048cb8911d454fbed5b4d3020de818370362f8d 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 5eb3b7ac4d5cf0051ad0db76c87755992abe339a..cb2c9cc2fc8017cc06be470d428c9cfbdce42970 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 4b6122184055f72c9d35b58a0c535048c672f064..bf8a67cef32caa9e906a994417badc2247e37fca 100644 --- a/zh-cn/application-dev/ui/ui-js-components-chart.md +++ b/zh-cn/application-dev/ui/ui-js-components-chart.md @@ -619,6 +619,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 b068911ac4eb7133b9fa352beaf8f1fd1617f79a..780087b8b52a543e46318ab2237ee941265e8fd7 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 e17190343be5be83ce9093b5442358748db529d4..8444150dcd559dee40757a28928039c23c65ffbf 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 858e7ce407f85079702f317a2d7af9d4f6ee5085..f898b675dcf96416691f25d151a54b7006a47b10 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 3192194e488b11e7d2c179fa9c29100d4b7a9d44..0edb74d01338bbeb8fd8bfd9d4c5db4efe3d1b9b 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 eea53de79480a2ed54a58a4fdcb20dc3d5be06e4..d9b41d2a7d2ebc85836ad8d9e3518bc47cc11240 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 24c1bf161971a3cb35c07a40d4263c13d2993773..1f894d50077f6dde211cf680709430ed3c81fdb9 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 0c3489679485b33cd3f54c5a274cc9dda4b1479a..8762c6438765646e9cb3988725dc369b9bcf57ac 100644 --- a/zh-cn/application-dev/ui/ui-js-components-stepper.md +++ b/zh-cn/application-dev/ui/ui-js-components-stepper.md @@ -407,4 +407,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 1855fa80f88923e1ae17be6564183077f50f9911..71b8b97b2b37eac212034e32c2e05a00e53ee7ba 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 @@ -84,4 +84,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 3517c637a60e4adff5a982b544bc463e39825252..a67ce65389c616550be1e165d7dd61c91ea224a6 100644 --- a/zh-cn/application-dev/ui/ui-js-components-swiper.md +++ b/zh-cn/application-dev/ui/ui-js-components-swiper.md @@ -369,4 +369,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 091d3507356076328dad2794aa539135ed324d40..cb4debaee43b9ad028c63c9ce2c2162b363d705e 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 6d71893d1d35313aae2528622eb4694d96cbf889..37bc0b9e1fb5589aa1df3b160b82a87212dcd971 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,5 @@ 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 829dff91ed9646fd49061091fc7b790cc9aeff58..7e520b1aee36ebdae7fb840c87e685937e191366 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..89be29a238b9521c61b8bda3b12d855f3c3ca4da 100755 --- a/zh-cn/application-dev/ui/ui-js-overview.md +++ b/zh-cn/application-dev/ui/ui-js-overview.md @@ -34,20 +34,22 @@ 基于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) +- [`Stack`:堆叠容器(JS)(API8)](https://gitee.com/openharmony/applications_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) +- [`AirQuality`:空气质量(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/common/AirQuality) + +- [`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 8d223f77587c83475f2720b8b62d11776af7e507..177880e10b0cf8798394cc1efe5a8120aac88d78 100644 --- a/zh-cn/application-dev/ui/ui-ts-components-web.md +++ b/zh-cn/application-dev/ui/ui-ts-components-web.md @@ -198,4 +198,4 @@ struct WebComponent { 针对Web开发,有以下相关实例可供参考: -- [`Web`:Web(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Web) \ No newline at end of file +- [`Web`:Web(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Web) \ 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 c82d9a23ccdde3e1b7029b954aa4783394c16e0c..8e976dd67cf0ff1769a0057fb32b9fa4ff0472b5 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 a3c6a88db472a4450dcd933fccf1296701d83bfa..ec103e4e07a3e4e52cd9e2de53f066a321cf2137 100644 --- a/zh-cn/application-dev/ui/ui-ts-layout-mediaquery.md +++ b/zh-cn/application-dev/ui/ui-ts-layout-mediaquery.md @@ -152,5 +152,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 9351079d31ed5e8f518e2ca93e456e170199ad8d..5f7780947f8cbd6e014c98897bced69c3b6d5d60 100644 --- a/zh-cn/application-dev/ui/ui-ts-overview.md +++ b/zh-cn/application-dev/ui/ui-ts-overview.md @@ -61,25 +61,25 @@ 基于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)(API8)](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) - [极简声明式UI范式(eTS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/SimpleGalleryEts) @@ -91,4 +91,4 @@ - [弹窗(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 +- [CustomComponent:组件化(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/CustomComponent) \ No newline at end of file