未验证 提交 9545dd9b 编写于 作者: O openharmony_ci 提交者: Gitee

!19810 翻译完成 18881+19054+18690+18818+18830+18355

Merge pull request !19810 from ester.zhou/TR-18881
......@@ -20,11 +20,11 @@ Below shows the AccessibilityExtensionAbility framework.
![AccessibilityFramework](figures/AccessibilityFramework.png)
1. Accessibility app: extension service application developed based on the AccessibilityExtensionAbility framework, for example, a screen reader application.
2. Target app: application assisted by the accessibility app.
3. AccessibilityAbilityManagerService (AAMS): main service of the AccessibilityExtensionAbility framework, which is used to manage the lifecycle of accessibility apps and provide a bridge for information exchange between accessibility apps and target apps.
4. AccessibilityAbility (AAkit): ability that is used by the accessibility app to build an extension service ability operating environment and that provides interfaces for the accessibility app to query and operate the target app, including performing click/long press operations.
5. AccessibilitySystemAbilityClient (ASACkit): used by the target app to send accessibility events, such as content change events, to AAMS, and respond to the instructions (such as performing click/long press operations) sent by the accessibility app through AAMS.
1. Accessibility application: extension service application developed based on the AccessibilityExtensionAbility framework, for example, a screen reader application.
2. Target application: application assisted by the accessibility application.
3. AccessibilityAbilityManagerService (AAMS): main service of the AccessibilityExtensionAbility framework, which is used to manage the lifecycle of accessibility applications and provide a bridge for information exchange between accessibility applications and target applications.
4. AccessibilityAbility (AAkit): ability that is used by the accessibility application to build an extension service ability operating environment and that provides interfaces for the accessibility application to query and operate the target application, including performing click/long press operations.
5. AccessibilitySystemAbilityClient (ASACkit): used by the target application to send accessibility events, such as content change events, to AAMS, and respond to the instructions (such as performing click/long press operations) sent by the accessibility application through AAMS.
## Creating an Accessibility Extension Service
......@@ -116,13 +116,13 @@ After developing the custom logic for an accessibility extension service, you mu
]
}
```
## Enabling a Custom Accessibility Extension Service
## Enabling or Disabling a Custom Accessibility Extension Service
To enable or disable an accessibility extension service, run the following command:
- To enable the service: **accessibility enable -a AccessibilityExtAbility -b com.example.demo -c rg**
- To disable the service: **accessibility disable -a AccessibilityExtAbility -b com.example.demo**
In the preceding commands, **AccessibilityExtAbility** indicates the name of the accessibility extension service, **com.example.demo** indicates the bundle name, and **rg** indicates the capabilities (**r** is short for retrieve).
In the preceding commands, **AccessibilityExtAbility** indicates the name of the accessibility extension service, **com.example.demo** indicates the bundle name, and **rg** indicates the capabilities (**r** is short for retrieve and **g** gesture).
If the service is enabled or disabled successfully, the message "enable ability successfully" or "disable ability successfully" is displayed.
......@@ -145,9 +145,12 @@
- [NotificationTemplate](js-apis-inner-notification-notificationTemplate.md)
- [NotificationUserInput](js-apis-inner-notification-notificationUserInput.md)
- Common Events
- [Common Events of the Ability Subsystem](common_event/commonEvent-ability.md)
- [Common Events of the Bundle Management Subsystem](common_event/commonEvent-bundleManager.md)
- [Common Events of the Notification Service](common_event/commonEvent-ans.md)
- [Common Events of the Resource Scheduler Subsystem](common_event/commonEvent-resourceschedule.md)
- [Common Events of the Telephony Subsystem](common_event/commonEvent-telephony.md)
- [Common Events of the USB Subsystem](common_event/commonEvent-usb.md)
- Bundle Management
- [@ohos.bundle.appControl (appControl)](js-apis-appControl.md)
- [@ohos.bundle.bundleManager (bundleManager)](js-apis-bundleManager.md)
......@@ -211,7 +214,7 @@
- [@ohos.multimedia.image (Image Processing)](js-apis-image.md)
- [@ohos.multimedia.media (Media)](js-apis-media.md)
- [@ohos.multimedia.systemSoundManager (System Sound Management)](js-apis-systemSoundManager.md)
- multimedia
- Multimedia
- [ringtonePlayer (Ringtone Player)](js-apis-inner-multimedia-ringtonePlayer.md)
- Resource Manager
......@@ -333,6 +336,7 @@
- [@ohos.web.webview (Webview)](js-apis-webview.md)
- [Console](js-apis-logs.md)
- [Timer](js-apis-timer.md)
- [SysCap](js-apis-syscap.md)
- application
- [AccessibilityExtensionContext (Accessibility Extension Context)](js-apis-inner-application-accessibilityExtensionContext.md)
......
......@@ -5,6 +5,8 @@ The **Animator** module provides APIs for applying animation effects, including
> **NOTE**
>
> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> This module can be used only after a component instance is created, and it cannot be used in the [UIAbility](./js-apis-app-ability-uiAbility.md).
## Modules to Import
......
......@@ -5,6 +5,8 @@ The **mediaquery** module provides different styles for different media types.
> **NOTE**
>
> The APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
>
> This module can be used only after a component instance is created, and it cannot be used in the [UIAbility](./js-apis-app-ability-uiAbility.md).
## Modules to Import
......@@ -26,7 +28,7 @@ Sets the media query condition. This API returns the corresponding media query l
| Name | Type | Mandatory | Description |
| --------- | ------ | ---- | ---------------------------------------- |
| condition | string | Yes | Media query condition. For details, see [Syntax of Media Query Conditions](../../ui/arkts-layout-development-media-query.md#syntax-of-media-query-conditions).|
| condition | string | Yes | Media query condition. For details, see [Syntax](../../ui/arkts-layout-development-media-query.md#syntax).|
**Return value**
......@@ -146,7 +148,7 @@ struct MediaQueryExample {
}
aboutToAppear() {
let portraitFunc = this.onPortrait.bind(this) // Bind the current JS instance.
let portraitFunc = this.onPortrait.bind(this) // Bind the JS instance.
this.listener.on('change', portraitFunc)
}
......@@ -158,5 +160,3 @@ struct MediaQueryExample {
}
}
```
<!--no_check-->
\ No newline at end of file
......@@ -5,6 +5,8 @@ The **PromptAction** module provides APIs for creating and showing toasts, dialo
> **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.
>
> This module can be used only after a component instance is created, and it cannot be used in the [UIAbility](./js-apis-app-ability-uiAbility.md).
## Modules to Import
......
# SysCap
SystemCapability (SysCap) refers to a standalone feature in the operating system. Different devices support different SysCap sets. Each SysCap corresponds to one or more APIs. You can determine whether an API can be used by checking SysCap support.
> **NOTE**
>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## canIUse
canIUse(syscap: string): boolean
Checks whether a SysCap is supported.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| syscap | string | Yes| Name of the SysCap to check.|
**Return value**
| Type| Description|
| -------- | -------- |
| boolean | Check result. The value **true** means that the SysCap is supported, and **false** means the opposite.|
**Example**
```js
import geolocation from '@ohos.geolocation'
const isLocationAvailable = canIUse('SystemCapability.Location.Location');
if (isLocationAvailable) {
geolocation.getCurrentLocation((location) => {
console.log(location.latitude, location.longitue);
});
} else {
console.log('Location not by this device.');
}
```
......@@ -41,7 +41,6 @@
- [Foreground Color](ts-universal-attributes-foreground-color.md)
- [Click Effect](ts-universal-attributes-click-effect.md)
- Touch Interactions
- [Click Control](ts-universal-attributes-click.md)
- [Touch Target](ts-universal-attributes-touch-target.md)
- [Hit Test Control](ts-universal-attributes-hit-test-behavior.md)
- Touch Interactions
......@@ -177,5 +176,7 @@
- [Pixel Units](ts-pixel-units.md)
- [Enums](ts-appendix-enums.md)
- [Types](ts-types.md)
- Components No Longer Maintained
- Components No Longer Maintained
- [GridContainer](ts-container-gridcontainer.md)
- APIs No Longer Maintained
- [Click Control](ts-universal-attributes-click.md)
\ No newline at end of file
......@@ -33,7 +33,7 @@ Since API version 9, this API is supported in ArkTS widgets.
| Name | Type| Description |
| ---------- | -------- | ------------------------------------------------------------ |
| allowScale | boolean | Whether to allow text to scale.<br>Default value: **false**<br>Since API version 9, this API is supported in ArkTS widgets.|
| allowScale | boolean | Whether to allow text to scale.<br>This attribute is not supported currently.<br>Default value: **false** |
## Events
......
......@@ -15,7 +15,7 @@ The **\<RelativeContainer>** component is used for element alignment in complex
* Alignment modes in the vertical direction can be top, center, or bottom, achieved by the **VerticalAlign.Top**, **VerticalAlign.Center**, and **VerticalAlign.Bottom** attributes of the container, respectively.
* A child component can set the container or another child component as the anchor.
* To show in the **\<RelativeContainer>**, child components must have an ID. The container ID is fixed at **__container__**.
* Three positions of the child component in a direction can use three positions of the container or another child components in the same direction as anchors. If anchors are set for more than two positions in a single direction, the third position is skipped.
* Three positions on the child component in a specific direction can use as anchors three positions on the container or another child component in the same direction. If anchors are set for more than two positions in a single direction, then: Start and Center are preferred in the horizontal direction, and Top and Center are preferred in the vertical direction.
* The child component size set on the frontend page is not affected by the **\<RelativeContainer>** rules. If two or more **alignRules** values are set for one direction of the child component, you are not advised to set the size for this direction.
* If offset is required after the alignment, it can be set through **offset**.
* Exceptions
......
......@@ -21,7 +21,7 @@ Tabs(value?: {barPosition?: BarPosition, index?: number, controller?: [TabsContr
| Name | Type | Mandatory| Description |
| ----------- | --------------------------------- | ---- | ------------------------------------------------------------ |
| barPosition | BarPosition | No | Position of the **\<Tabs>** component.<br>Default value: **BarPosition.Start** |
| index | number | No | Initial tab index.<br>Default value: **0**<br>**NOTE**<br>A value less than 0 evaluates to the default value.<br>The value ranges from 0 to the number of **\<TabContent>** subnodes minus 1.<br>When this parameter is set to different values, the slide animation for tab switching is enabled by default. To disable the animation, set **animationDuration** to **0**.<br>Since API version 10, this parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.|
| index | number | No | Initial tab index.<br>Default value: **0**<br>**NOTE**<br>A value less than 0 evaluates to the default value.<br>The value ranges from 0 to the number of **\<TabContent>** subnodes minus 1.<br>When this parameter is set to different values, the slide animation for tab switching is enabled by default. To disable the animation, set **animationDuration** to **0**.<br>Since API version 10, this parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables. |
| controller | [TabsController](#tabscontroller) | No | Tab controller. |
## BarPosition
......@@ -41,11 +41,13 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the
| vertical | boolean | Whether to use vertical tabs. The value **true** means to use vertical tabs, and **false** means to use horizontal tabs.<br>Default value: **false**|
| scrollable | boolean | Whether the tabs are scrollable. The value **true** means that the tabs are scrollable, and **false** means the opposite.<br>Default value: **true**|
| barMode | BarMode | Tab bar layout mode. For details, see **BarMode**.<br>Default value: **BarMode.Fixed**|
| barWidth | number \| Length<sup>8+</sup> | Width of the tab bar.<br>**NOTE**<br><br>A value less than 0 or greater than the width of the **\<Tabs>** component evaluates to the default value.|
| barHeight | number \| Length<sup>8+</sup> | Height of the tab bar.<br>**NOTE**<br>A value less than 0 or greater than the width of the **\<Tabs>** component evaluates to the default value. |
| animationDuration | number | Duration of the slide animation for tab switching. If this parameter is set, the tab switching animation is played when the user switches between tabs by sliding or clicking. If this parameter is not set, the tab switching animation is played only when the user switches between tabs by sliding.<br>Default value: **300**<br>**NOTE**<br>A value less than 0 or in percentage evaluates to the default value.|
| barWidth | number \| Length<sup>8+</sup> | Width of the tab bar.<br>The default value varies.<br>If the tab bar has the **vertical** attribute set to **false** and does not have a style specified, the default value is the width of the **\<Tabs>** component.<br>If the tab bar has the **vertical** attribute set to **true** and does not have a style specified, the default value is **56vp**.<br>If the tab bar has the **vertical** attribute set to **false** and **SubTabbarStyle** specified, the default value is the width of the **\<Tabs>** component.<br>If the tab bar has the **vertical** attribute set to **true** and **SubTabbarStyle** specified, the default value is **56vp**.<br>If the tab bar has the **vertical** attribute set to **true** and **BottomTabbarStyle** specified, the default value is **96vp**.<br>If the tab bar has the **vertical** attribute set to **false** and **BottomTabbarStyle** specified, the default value is the width of the **\<Tabs>** component.<br>**NOTE**<br><br>A value less than 0 or greater than the width of the **\<Tabs>** component evaluates to the default value.|
| barHeight | number \| Length<sup>8+</sup> | Height of the tab bar.<br>The default value varies.<br>If the tab bar has the **vertical** attribute set to **false** and does not have a style specified, the default value is **56vp**.<br>If the tab bar has the **vertical** attribute set to **true** and does not have a style specified, the default value is the height of the **\<Tabs>** component.<br>If the tab bar has the **vertical** attribute set to **false** and **SubTabbarStyle** specified, the default value is **56vp**.<br>If the tab bar has the **vertical** attribute set to **true** and **SubTabbarStyle** specified, the default value is the height of the **\<Tabs>** component.<br>If the tab bar has the **vertical** attribute set to **true** and **BottomTabbarStyle** specified, the default value is the height of the **\<Tabs>** component.<br>If the tab bar has the **vertical** attribute set to **false** and **BottomTabbarStyle** specified, the default value is **56vp**.<br>**NOTE**<br>A value less than 0 or greater than the height of the **\<Tabs>** component evaluates to the default value. |
| animationDuration | number | Duration of the slide animation for tab switching. If this parameter is set, the tab switching animation is played when the user switches between tabs by sliding or clicking. If this parameter is not set, the tab switching animation is played only when the user switches between tabs by sliding.<br>Default value: **300**<br>**NOTE**<br>A value less than 0 or in percentage evaluates to the default value. |
| divider<sup>10+</sup> | [DividerStyle](#dividerstyle10) \| null | Whether the divider is displayed for the **\<TabBar>** and **\<TabContent>** components and the divider style. By default, the divider is not displayed.<br> **DividerStyle**: divider style.<br> **null**: The divider is not displayed.|
| fadingEdge<sup>10+</sup> | boolean | Whether the tab fades out when it exceeds the container width.<br>Default value: **true** |
| barOverlap<sup>10+</sup> | boolean | Whether the tab bar is superimposed on the **\<TabContent>** component after having its background blurred.<br>Default value: **false** |
| barBackgroundColor<sup>10+</sup> | [ResourceColor](ts-types.md#resourcecolor) | Background color of the tab bar.<br>Default value: transparent|
## DividerStyle<sup>10+</sup>
......@@ -91,7 +93,7 @@ Switches to the specified tab.
| Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ---------------------------------------- |
| value | number | Yes | Index of the tab. The value starts from 0.<br>**NOTE**<br><br>If this parameter is set to a value less than 0 or greater than the maximum number, the event will be invalid.|
| value | number | Yes | Index of the tab. The value starts from 0.<br>**NOTE**<br>If this parameter is set to a value less than 0 or greater than the maximum number, the event will be invalid. |
## Example
......
......@@ -112,9 +112,10 @@ struct CustomDialogUser {
customStyle: false
})
// Delete the dialogController instance and set it to undefined when the custom component is about to be destroyed.
aboutToDisappear() {
delete this.dialogController,
this.dialogController = undefined
delete this.dialogController, // Delete the dialogController instance.
this.dialogController = undefined //Set dialogController to undefined.
}
onCancel() {
......
......@@ -18,6 +18,7 @@
- [HuksKeyApi](_huks_key_api.md)
- [HuksParamSetApi](_huks_param_set_api.md)
- [HuksTypeApi](_huks_type_api.md)
- [Init](init.md)
- [Memory](memory.md)
- Header Files
- [drawing_bitmap.h](drawing__bitmap_8h.md)
......@@ -57,6 +58,7 @@
- [native_huks_api.h](native__huks__api_8h.md)
- [native_huks_param.h](native__huks__param_8h.md)
- [native_huks_type.h](native__huks__type_8h.md)
- [syscap_ndk.h](syscap__ndk_8h.md)
- [purgeable_memory.h](purgeable__memory_8h.md)
- Structs
- [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md)
......
# Init
## Overview
Provides APIs for checking SystemCapability (SycCap) support.
You can use the provided APIs to read the SycCap parameter file to check whether a specific SycCap is supported.
**Since:**
8
## Summary
### Files
| Name| Description|
| -------- | -------- |
| [syscap_ndk.h](syscap__ndk_8h.md) | Defines the APIs for checking SycCap support.|
### Functions
| Name| Description|
| -------- | -------- |
| [canIUse](#caniuse) (const char \*cap) | Checks whether a SysCap is supported. SystemCapability (SysCap) refers to a standalone feature in the operating system. Different devices support different SysCap sets. Each SysCap corresponds to one or more APIs. You can determine whether an API can be used by checking SysCap support.|
## Function Description
### canIUse()
```
bool canIUse (const char * cap)
```
**Description**
Checks whether a SysCap is supported. SystemCapability (SysCap) refers to a standalone feature in the operating system. Different devices support different SysCap sets. Each SysCap corresponds to one or more APIs. You can determine whether an API can be used by checking SysCap support.
**Parameters**
| Name| Description|
| -------- | -------- |
| cap | Name of the SysCap to check.|
**Returns**
Check result. The value **true** means that the SysCap is supported, and **false** means the opposite.
# syscap_ndk.h
## Overview
Declares the APIs for checking SycCap support.
**Since:**
8
**Related Modules:**
[Init](init.md)
## Summary
### Functions
| Name| Description|
| -------- | -------- |
| [canIUse](init.md#caniuse) (const char \*cap) | Checks whether a SysCap is supported.<br>SystemCapability (SysCap) refers to a standalone feature in the operating system. Different devices support different SysCap sets. Each SysCap corresponds to one or more APIs. You can determine whether an API can be used by checking SysCap support.|
......@@ -93,29 +93,49 @@ By default, the associated SysCap set of an application is the union of multiple
### Checking Whether an API Is Available
- Method 1: Use the **canIUse()** API to check whether a SysCap is supported.
```ts
if (canIUse("SystemCapability.ArkUI.ArkUI.Full")) {
console.log("This device supports SystemCapability.ArkUI.ArkUI.Full.");
} else {
console.log("This device does not support SystemCapability.ArkUI.ArkUI.Full.");
}
```
- Method 2: Import a module using the **import** API. If the current device does not support the module, the import result is **undefined**. Before using an API, you must make sure the API is available.
```ts
import geolocation from '@ohos.geolocation';
if (geolocation) {
geolocation.getCurrentLocation((location) => {
console.log(location.latitude, location.longitude);
});
} else {
console.log('This device does not support location information.');
}
```
You can use either the ArtTS or native API to determine whether an API is available.
- ArkTS API
- Method 1: Use the **canIUse()** API to check whether a SysCap is supported.
```ts
if (canIUse("SystemCapability.ArkUI.ArkUI.Full")) {
console.log("This device supports SystemCapability.ArkUI.ArkUI.Full.");
} else {
console.log("This device does not support SystemCapability.ArkUI.ArkUI.Full.");
}
```
- Method 2: Import a module using the **import** API. If the current device does not support the module, the import result is **undefined**. Before using an API, you must make sure the API is available.
```ts
import geolocation from '@ohos.geolocation';
if (geolocation) {
geolocation.getCurrentLocation((location) => {
console.log(location.latitude, location.longitude);
});
} else {
console.log('This device does not support location information.');
}
```
- Native API
```c
#include <stdio.h>
#include <stdlib.h>
#include "syscap_ndk.h"
char syscap[] = "SystemCapability.ArkUI.ArkUI.Full";
bool result = canIUse(syscap);
if (result) {
printf("SysCap: %s is supported!\n", syscap);
} else {
printf("SysCap: %s is not supported!\n", syscap);
}
```
You can also find out the SysCap to which an API belongs by referring to the API reference document.
### Checking the Differences Between Devices with a Specific SysCap
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册