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

!20905 翻译完成 20278+19990+20347

Merge pull request !20905 from ester.zhou/TR-20303
...@@ -137,11 +137,11 @@ Describes the style of captions. ...@@ -137,11 +137,11 @@ Describes the style of captions.
| Name | Type | Readable | Writable | Description | | Name | Type | Readable | Writable | Description |
| --------------- | ---------------------------------------- | ---- | ---- | ----------- | | --------------- | ---------------------------------------- | ---- | ---- | ----------- |
| fontFamily | [CaptionsFontFamily](#captionsfontfamily8) | Yes | No | Font family of captions. | | fontFamily | [CaptionsFontFamily](#captionsfontfamily8) | Yes | No | Font family of captions. |
| fontScale | number | Yes | No | Font scale of captions.| | fontScale | number | Yes | No | Font scale factor of captions, in percentage. The value ranges from 1 to 200.|
| fontColor | number \| string | Yes | No | Font color of captions. | | fontColor | number \| string | Yes | No | Font color of captions. For example, red corresponds to #FF0000. |
| fontEdgeType | [CaptionsFontEdgeType](#captionsfontedgetype8) | Yes | No | Font edge type of captions. | | fontEdgeType | [CaptionsFontEdgeType](#captionsfontedgetype8) | Yes | No | Font edge type of captions. |
| backgroundColor | number \| string | Yes | No | Background color of captions. | | backgroundColor | number \| string | Yes | No | Background color of captions. For example, red corresponds to #FF0000. |
| windowColor | number \| string | Yes | No | Window color of captions. | | windowColor | number \| string | Yes | No | Window color of captions. For example, red corresponds to #FF0000. |
## CaptionsManager<sup>8+</sup> ## CaptionsManager<sup>8+</sup>
...@@ -162,6 +162,8 @@ on(type: 'enableChange', callback: Callback&lt;boolean&gt;): void; ...@@ -162,6 +162,8 @@ on(type: 'enableChange', callback: Callback&lt;boolean&gt;): void;
Enables listening for the enabled status changes of captions configuration. This API uses an asynchronous callback to return the result. Enables listening for the enabled status changes of captions configuration. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.BarrierFree.Accessibility.Hearing
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
...@@ -188,6 +190,8 @@ on(type: 'styleChange', callback: Callback&lt;CaptionsStyle&gt;): void; ...@@ -188,6 +190,8 @@ on(type: 'styleChange', callback: Callback&lt;CaptionsStyle&gt;): void;
Enables listening for captions style changes. This API uses an asynchronous callback to return the result. Enables listening for captions style changes. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.BarrierFree.Accessibility.Hearing
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
...@@ -216,6 +220,8 @@ off(type: 'enableChange', callback?: Callback&lt;boolean&gt;): void; ...@@ -216,6 +220,8 @@ off(type: 'enableChange', callback?: Callback&lt;boolean&gt;): void;
Disables listening for the enabled status changes of captions configuration. This API uses an asynchronous callback to return the result. Disables listening for the enabled status changes of captions configuration. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.BarrierFree.Accessibility.Hearing
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
...@@ -242,6 +248,8 @@ off(type: 'styleChange', callback?: Callback&lt;CaptionsStyle&gt;): void; ...@@ -242,6 +248,8 @@ off(type: 'styleChange', callback?: Callback&lt;CaptionsStyle&gt;): void;
Disables listening for captions style changes. This API uses an asynchronous callback to return the result. Disables listening for captions style changes. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.BarrierFree.Accessibility.Hearing
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
...@@ -573,7 +581,7 @@ on(type: 'accessibilityStateChange', callback: Callback&lt;boolean&gt;): void ...@@ -573,7 +581,7 @@ on(type: 'accessibilityStateChange', callback: Callback&lt;boolean&gt;): void
Enables listening for the enabled status changes of the accessibility application. This API uses an asynchronous callback to return the result. Enables listening for the enabled status changes of the accessibility application. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.BarrierFree.Accessibility.Core
**Parameters** **Parameters**
...@@ -600,7 +608,7 @@ on(type: 'touchGuideStateChange', callback: Callback&lt;boolean&gt;): void ...@@ -600,7 +608,7 @@ on(type: 'touchGuideStateChange', callback: Callback&lt;boolean&gt;): void
Enables listening for the enabled status changes of the touch guide mode. This API uses an asynchronous callback to return the result. Enables listening for the enabled status changes of the touch guide mode. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.BarrierFree.Accessibility.Vision
**Parameters** **Parameters**
...@@ -627,13 +635,13 @@ off(type: 'accessibilityStateChange', callback?: Callback&lt;boolean&gt;): void ...@@ -627,13 +635,13 @@ off(type: 'accessibilityStateChange', callback?: Callback&lt;boolean&gt;): void
Disables listening for the enabled status changes of the accessibility application. This API uses an asynchronous callback to return the result. Disables listening for the enabled status changes of the accessibility application. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.BarrierFree.Accessibility.Core
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ----------------------- | ---- | ---------------------------------------- | | -------- | ----------------------- | ---- | ---------------------------------------- |
| type | string | No | Type of the event to listen for, which is set to **'accessibilityStateChange'** in this API.| | type | string | Yes | Type of the event to listen for, which is set to **'accessibilityStateChange'** in this API.|
| callback | Callback&lt;boolean&gt; | No | Callback for the event. | | callback | Callback&lt;boolean&gt; | No | Callback for the event. |
**Example** **Example**
...@@ -654,13 +662,13 @@ off(type: 'touchGuideStateChange', callback?: Callback&lt;boolean&gt;): void ...@@ -654,13 +662,13 @@ off(type: 'touchGuideStateChange', callback?: Callback&lt;boolean&gt;): void
Disables listening for the enabled status changes of the touch guide mode. This API uses an asynchronous callback to return the result. Disables listening for the enabled status changes of the touch guide mode. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.BarrierFree.Accessibility.Core
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ----------------------- | ---- | ---------------------------------------- | | -------- | ----------------------- | ---- | ---------------------------------------- |
| type | string | No | Type of the event to listen for, which is set to **'touchGuideStateChange'** in this API.| | type | string | Yes | Type of the event to listen for, which is set to **'touchGuideStateChange'** in this API.|
| callback | Callback&lt;boolean&gt; | No | Callback for the event. | | callback | Callback&lt;boolean&gt; | No | Callback for the event. |
**Example** **Example**
......
...@@ -241,6 +241,14 @@ Obtains the focus element. This API uses an asynchronous callback to return the ...@@ -241,6 +241,14 @@ Obtains the focus element. This API uses an asynchronous callback to return the
| isAccessibilityFocus | boolean | Yes | Whether the obtained focus element is an accessibility focus. | | isAccessibilityFocus | boolean | Yes | Whether the obtained focus element is an accessibility focus. |
| callback | AsyncCallback&lt;AccessibilityElement&gt; | Yes | Callback used to return the current focus element.| | callback | AsyncCallback&lt;AccessibilityElement&gt; | Yes | Callback used to return the current focus element.|
**Error codes**
For details about the error codes, see [Accessibility Error Codes](../errorcodes/errorcode-accessibility.md).
| ID | Error Message |
| ------- | ---------------------------------------- |
| 9300003 | Do not have accessibility right for this operation. |
**Example** **Example**
```ts ```ts
......
...@@ -39,7 +39,7 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the ...@@ -39,7 +39,7 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the
| popupFont | [Font](ts-types.md#font) | Font style of the pop-up text.<br>Default value:<br>{<br>size:10,<br> style:FontStyle.Normal,<br> weight:FontWeight.Normal,<br> family:'HarmonyOS Sans'<br>} | | popupFont | [Font](ts-types.md#font) | Font style of the pop-up text.<br>Default value:<br>{<br>size:10,<br> style:FontStyle.Normal,<br> weight:FontWeight.Normal,<br> family:'HarmonyOS Sans'<br>} |
| font | [Font](ts-types.md#font) | Default font style of the alphabetic index bar.<br>Default value:<br>{<br>size:10,<br> style:FontStyle.Normal,<br> weight:FontWeight.Normal,<br> family:'HarmonyOS Sans'<br>} | | font | [Font](ts-types.md#font) | Default font style of the alphabetic index bar.<br>Default value:<br>{<br>size:10,<br> style:FontStyle.Normal,<br> weight:FontWeight.Normal,<br> family:'HarmonyOS Sans'<br>} |
| itemSize | string \| number | Size of an item in the alphabetic index bar. The item is a square, and the side length needs to be set. This attribute cannot be set to a percentage.<br>Default value: **24.0**<br>Unit: vp| | itemSize | string \| number | Size of an item in the alphabetic index bar. The item is a square, and the side length needs to be set. This attribute cannot be set to a percentage.<br>Default value: **24.0**<br>Unit: vp|
| alignStyle | value: [IndexerAlign](#indexeralign),<br>offset<sup>10+</sup>?: [Length](ts-types.md#length) | Alignment style of the alphabetic index bar.<br>**value**: alignment of the alphabetic index bar with the pop-up window, which can be left-aligned or right-aligned.<br>Default value: **IndexerAlign.Right**<br>**offset**: spacing between the pop-up window and the alphabetic index bar. A value greater than or equal to 0 is valid. If this attribute is set to a value less than 0 or is not set, the spacing is the same as **popupPosition.x**.| | alignStyle | value: [IndexerAlign](#indexeralign),<br>offset<sup>10+</sup>?: [Length](ts-types.md#length) | Alignment style of the alphabetic index bar.<br>**value**: alignment of the alphabetic index bar with the pop-up window, which can be left-aligned or right-aligned.<br>Default value: **IndexerAlign.Right**<br>**offset**: spacing between the pop-up window and the alphabetic index bar. A value greater than or equal to 0 is valid. If this parameter is set to a value less than 0 or is not set, the spacing is the same as **popupPosition.x**. If this parameter and **popupPosition** are set at the same time, **offset** takes effect in the horizontal direction and **popupPosition.y** takes effect in the vertical direction.|
| selected | number | Index of the selected item.<br>Default value: **0**<br>Since API version 10, this parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.| | selected | number | Index of the selected item.<br>Default value: **0**<br>Since API version 10, this parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.|
| popupPosition | [Position](ts-types.md#position8) | Position of the pop-up window relative to the center of the indexer bar's top border.<br>Default value: **{x:96.0, y:48.0}**| | popupPosition | [Position](ts-types.md#position8) | Position of the pop-up window relative to the center of the indexer bar's top border.<br>Default value: **{x:96.0, y:48.0}**|
| popupSelectedColor<sup>10+</sup> | [ResourceColor](ts-types.md#resourcecolor) | Color of the selected text excluding the initial letter in the pop-up window.<br>Default value: **#FF182431**| | popupSelectedColor<sup>10+</sup> | [ResourceColor](ts-types.md#resourcecolor) | Color of the selected text excluding the initial letter in the pop-up window.<br>Default value: **#FF182431**|
...@@ -139,6 +139,10 @@ struct AlphabetIndexerSample { ...@@ -139,6 +139,10 @@ struct AlphabetIndexerSample {
.popupFont({ size: 30, weight: FontWeight.Bolder}) // Font style of the pop-up text. .popupFont({ size: 30, weight: FontWeight.Bolder}) // Font style of the pop-up text.
.itemSize(28) // Size of an item in the alphabetic index bar. .itemSize(28) // Size of an item in the alphabetic index bar.
.alignStyle(IndexerAlign.Left) // The pop-up window is displayed on the right of the alphabetic index bar. .alignStyle(IndexerAlign.Left) // The pop-up window is displayed on the right of the alphabetic index bar.
.popupSelectedColor(0x00FF00)
.popupUnselectedColor(0x0000FF)
.popupItemFont({ size: 30, style: FontStyle.Normal })
.popupItemBackgroundColor(0xCCCCCC)
.onSelect((index: number) => { .onSelect((index: number) => {
console.info(this.value[index] + ' Selected!') console.info(this.value[index] + ' Selected!')
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册