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

!18397 【3.2-Release】翻译完成 17511+17344+17536

Merge pull request !18397 from ester.zhou/C2-17511
......@@ -29,19 +29,19 @@ A description regarding system APIs will be provided in the document.
A common application is an application whose application type is **hos_normal_app** in the HarmonyAppProvision configuration file. **hos_normal_app** is the default value for project creation.
The public SDK, which does not include system APIs, is provided as standard in DevEco Studio. To use the system APIs, you must:
- Switch the public SDK to the full SDK by following the instructions provided in [Guide to Switching to Full SDK] (../../quick-start/full-sdk-switch-guide.md).
- Switch the public SDK to the full SDK by following the instructions provided in [Guide to Switching to Full SDK](../../quick-start/full-sdk-switch-guide.md).
- Change the value of **app-feature** in the HarmonyAppProvision configuration file to **hos_system_app**. For details, see [HarmonyAppProvision Configuration File](../../security/app-provision-structure.md).
## Permission Description
By default, applications can access limited system resources. However, in some cases, an application needs to access excess data (including personal data) and functions of the system or another application to implement extended functions. For details, see [Access Control Overview](../../security/accesstoken-overview.md).
By default, applications can access limited system resources. However, in some cases, an application needs to access excess data (including personal data) and functions of the system or another application to implement extended functions. For details, see [Access Control (Permission) Overview](../../security/accesstoken-overview.md).
To call APIs to access these resources, you must apply for the corresponding permissions by following the instructions provided in [Access Control Development](../../security/accesstoken-guidelines.md).
To call APIs to access these resources, you must apply for the corresponding permissions by following the instructions provided in [Applying for Permissions](../../security/accesstoken-guidelines.md).
- If an application can call an API only after it has obtained a specific permission, the following description is provided for the API: "**Required permissions**: ohos.permission.xxxx"
- If an application can call an API without any permission, no special description is provided.
To determine whether an application can request a specific permission, see [Permission Application and Use](../../security/accesstoken-overview.md#applying-for-and-using-a-permission).
To determine whether an application can request a specific permission, see [Applying for and Using a Permission](../../security/accesstoken-overview.md#applying-for-and-using-a-permission).
## System Capability Description
......
......@@ -54,8 +54,6 @@ Since API version 9, this API is supported in ArkTS widgets.
## TouchType
Since API version 9, this API is supported in ArkTS widgets.
| Name | Description |
| ------ | ------------------------------ |
| Down | A finger is pressed. |
......@@ -65,8 +63,6 @@ Since API version 9, this API is supported in ArkTS widgets.
## MouseButton
Since API version 9, this API is supported in ArkTS widgets.
| Name | Description |
| ------- | ---------------- |
| Left | Left button on the mouse. |
......@@ -78,8 +74,6 @@ Since API version 9, this API is supported in ArkTS widgets.
## MouseAction
Since API version 9, this API is supported in ArkTS widgets.
| Name | Description |
| ------- | -------------- |
| Press | The mouse button is pressed.|
......@@ -109,9 +103,7 @@ Since API version 9, this API is supported in ArkTS widgets.
## AnimationStatus
Since API version 9, this API is supported in ArkTS widgets.
| Name | Description |
| Name | Description |
| ------- | ------------------ |
| Initial | The animation is in the initial state. |
| Running | The animation is being played.|
......@@ -120,9 +112,7 @@ Since API version 9, this API is supported in ArkTS widgets.
## FillMode
Since API version 9, this API is supported in ArkTS widgets.
| Name | Description |
| Name | Description |
| --------- | ------------------------------------------------------------ |
| None | Before execution, the animation does not apply any styles to the target component. After execution, the animation restores the target component to its default state.|
| Forwards | The target component retains the state set by the last keyframe encountered during execution of the animation. |
......@@ -142,8 +132,6 @@ Since API version 9, this API is supported in ArkTS widgets.
## KeyType
Since API version 9, this API is supported in ArkTS widgets.
| Name| Description |
| ---- | ---------- |
| Down | The key is pressed.|
......@@ -151,8 +139,6 @@ Since API version 9, this API is supported in ArkTS widgets.
## KeySource
Since API version 9, this API is supported in ArkTS widgets.
| Name | Description |
| -------- | -------------------- |
| Unknown | Unknown input device. |
......@@ -172,8 +158,6 @@ Since API version 9, this API is supported in ArkTS widgets.
## Week
Since API version 9, this API is supported in ArkTS widgets.
| Name | Description |
| -------- | ---------------------- |
| Mon | Monday. |
......@@ -242,8 +226,6 @@ Since API version 9, this API is supported in ArkTS widgets.
## RelateType
Since API version 9, this API is supported in ArkTS widgets.
| Name | Description |
| ------ | ------------------------------- |
| FILL | The current child component is scaled to fill the parent component. |
......@@ -384,8 +366,6 @@ Since API version 9, this API is supported in ArkTS widgets.
## SharedTransitionEffectType
Since API version 9, this API is supported in ArkTS widgets.
| Name | Description |
| ----------- | ---------- |
| Static | The element position remains unchanged on the target page, and transition opacity can be configured. Currently, this effect is only valid in redirecting to the target page.|
......@@ -456,18 +436,14 @@ Since API version 9, this API is supported in ArkTS widgets.
## ResponseType<sup>8+</sup>
Since API version 9, this API is supported in ArkTS widgets.
| Name | Description |
| Name | Description |
| ---------- | -------------------------- |
| LongPress | The menu is displayed when the component is long-pressed. |
| RightClick | The menu is displayed when the component is right-clicked.|
## HoverEffect<sup>8+</sup>
Since API version 9, this API is supported in ArkTS widgets.
| Name | Description |
| Name | Description |
| --------- | ---------------------------- |
| Auto | Default hover effect.|
| Scale | Scale effect. |
......@@ -476,9 +452,7 @@ Since API version 9, this API is supported in ArkTS widgets.
## Placement<sup>8+</sup>
Since API version 9, this API is supported in ArkTS widgets.
| Name | Description |
| Name | Description |
| ------------- | ------------------------------------------------------------ |
| Left | The popup is on the left of the component, vertically aligned with the component on the left. |
| Right | The popup is on the right of the component, vertically aligned with the component on the right. |
......@@ -505,9 +479,7 @@ Since API version 9, this API is supported in ArkTS widgets.
## HitTestMode<sup>9+</sup>
Since API version 9, this API is supported in ArkTS widgets.
| Name | Description |
| Name | Description |
| ----------- | -------------------- |
| Default | Both the node and its child node respond to the hit test of a touch event, but its sibling node is blocked from the hit test. |
| Block | The node responds to the hit test of a touch event, but its child node and sibling node are blocked from the hit test. |
......
......@@ -43,7 +43,7 @@ Invoked when a page is hidden. This callback is used in the routing process or s
onBackPress?(): void
Invoked when a user clicks the back button. It works only for the custom components decorated by **@Entry**. The value **true** is returned if the page processes the return logic instead of performing page routing. The value **false** is returned if the default return logic is used. If the return value is not set, the value **false** is used.
Invoked when a user clicks the back button. It works only for the custom components decorated by **@Entry**.
```ts
......
......@@ -2268,7 +2268,7 @@ Draws the input [PixelMap](../apis/js-apis-image.md#pixelmap7) object on the can
**Parameters**
| Parameters | Type | Mandatory | Default Value | Description |
| Name | Type | Mandatory | Default Value | Description |
| ---- | ------ | ---- | ---- | --------------- |
| sx | number | Yes | 0 | X-coordinate of the upper left corner of the output area.|
| sy | number | Yes | 0 | Y-coordinate of the upper left corner of the output area.|
......
......@@ -13,13 +13,13 @@ The text style attributes set the style for text in a component.
| Name | Type | Description |
| -----------| ---------------------------------------- | ------------------------------------ |
| fontColor | [ResourceColor](ts-types.md#resourcecolor) | Font color. |
| fontSize | [Length](ts-types.md#length) | Font size. If the value is of the number type, the unit fp is used. The default font size is 16. This attribute cannot be set in percentage. |
| fontStyle | [FontStyle](ts-appendix-enums.md#fontstyle) | Font style.<br>Default value: **FontStyle.Normal** |
| fontWeight | number \| [FontWeight](ts-appendix-enums.md#fontweight) \| string | Font weight. For the number type, the value ranges from 100 to 900, at an interval of 100. The default value is **400**. A larger value indicates a larger font weight. The string type supports only the string of the number type, for example, **400**, **"bold"**, **"bolder"**, **"lighter"**, **"regular"**, and **"medium"**, which correspond to the enumerated values in **FontWeight**.<br>Default value: **FontWeight.Normal** |
| fontFamily | string \| [Resource](ts-types.md#resource) | Font family.<br>Default value: **'HarmonyOS Sans'**<br>Currently, only the default font is supported. |
| lineHeight | string \| number \| [Resource](ts-types.md#resource) | Text line height. If the value is less than or equal to **0**, the line height is not limited and the font size is adaptive. If the value of the number type, the unit fp is used.|
| decoration | {<br>type: [TextDecorationType](ts-appendix-enums.md#textdecorationtype),<br>color?: [ResourceColor](ts-types.md#resourcecolor)<br>} | Style and color of the text decorative line.<br>Default value: {<br>type: TextDecorationType.None,<br>color: Color.Black<br>} |
| fontColor | [ResourceColor](ts-types.md#resourcecolor) | Font color.<br>Since API version 9, this API is supported in ArkTS widgets.|
| fontSize | [Length](ts-types.md#length) | Font size. If the value is of the number type, the unit fp is used. The default font size is 16. This attribute cannot be set in percentage.<br>Since API version 9, this API is supported in ArkTS widgets.|
| fontStyle | [FontStyle](ts-appendix-enums.md#fontstyle) | Font style.<br>Default value: **FontStyle.Normal**<br>Since API version 9, this API is supported in ArkTS widgets.|
| fontWeight | number \| [FontWeight](ts-appendix-enums.md#fontweight) \| string | Font weight. For the number type, the value ranges from 100 to 900, at an interval of 100. The default value is **400**. A larger value indicates a larger font weight. The string type supports only the string of the number type, for example, **400**, **"bold"**, **"bolder"**, **"lighter"**, **"regular"**, and **"medium"**, which correspond to the enumerated values in **FontWeight**.<br>Default value: **FontWeight.Normal**<br>Since API version 9, this API is supported in ArkTS widgets.|
| fontFamily | string \| [Resource](ts-types.md#resource) | Font family.<br> Default value: **'HarmonyOS Sans'**. Currently, only the default font is supported.<br>Since API version 9, this API is supported in ArkTS widgets.|
| lineHeight | string \| number \| [Resource](ts-types.md#resource) | Text line height. If the value is less than or equal to **0**, the line height is not limited and the font size is adaptive. If the value of the number type, the unit fp is used.<br>Since API version 9, this API is supported in ArkTS widgets.|
| decoration | {<br>type: [TextDecorationType](ts-appendix-enums.md#textdecorationtype),<br>color?: [ResourceColor](ts-types.md#resourcecolor)<br>} | Style and color of the text decorative line.<br>Default value: {<br>type: TextDecorationType.None,<br>color: Color.Black<br>}<br>Since API version 9, this API is supported in ArkTS widgets.|
## Example
......
......@@ -280,7 +280,7 @@ Swiper(this.swiperController) {
## Child Components Per Page
You can set the number of child components per page for the \<Swiper> component through its [displayCount](../reference/arkui-ts/ts-container-swiper.md#attributes) attribute.
You can set the number of child components per page for the **\<Swiper>** component through its [displayCount](../reference/arkui-ts/ts-container-swiper.md#attributes) attribute.
To display two child components per page:
......
# Bubble
# Popup
You can bind the **Popup** attribute to a component, specifying its content, interaction logic, and display status. It is mainly used for screen recording and message pop-up notification.
You can bind the **Popup** attribute to a component to create a popup, specifying its content and interaction logic, and display state. It is mainly used for screen recording and message notification.
Bubbles are classified into two types: built-in bubbles with [PopupOptions](../reference/arkui-ts/ts-universal-attributes-popup.md#popupoptions) and custom bubbles with [CustomPopupOptions](../reference/arkui-ts/ts-universal-attributes-popup.md#custompopupoptions8). For PopupOptions, you can set primaryButton and secondaryButton to set bubbles with buttons. CustomPopupOptions sets the customized bubble by configuring the [builder](../quick-start/arkts-builder.md) parameter.
Popups can be defined with [PopupOptions](../reference/arkui-ts/ts-universal-attributes-popup.md#popupoptions) or [CustomPopupOptions](../reference/arkui-ts/ts-universal-attributes-popup.md#custompopupoptions8). In **PopupOptions**, you can set **primaryButton** and **secondaryButton** to include buttons in the popup. In **CustomPopupOptions**, you can create a custom popup through the [builder](../quick-start/arkts-builder.md) parameter.
## Text prompt bubble
## Text Popup
Text pop-up messages are usually used to display only text messages without any interaction. The Popup attribute needs to be bound to a component. When the show parameter in the bindPopup attribute is set to true, a pop-up message is displayed.
Text popups are usually used to display text only and do not allow for user interactions. Bind the **Popup** attribute to a component. When the **show** parameter in the **bindPopup** attribute is set to **true**, a popup is displayed.
Bind the Popup attribute to the Button component. Each time the Button button is clicked, handlePopup switches the Boolean value. When handlePopup is set to true, bindPopup pops up.
If you bind the **Popup** attribute to a **\<Button>** component, each time the **\<Button>** button is clicked, the Boolean value of **handlePopup** changes. When it changes to **true**, the popup is displayed.
......@@ -39,9 +39,9 @@ struct PopupExample {
![en-us_image_0000001511740524](figures/en-us_image_0000001511740524.png)
## Bubble with a button
## Popup with a Button
A maximum of two buttons can be set for a bubble through the primaryButton and secondaryButton attributes for simple interaction. Developers can set the action parameter to specify the operation to be triggered.
You can add a maximum of two buttons to a popup through the **primaryButton** and **secondaryButton** attributes. For each of the buttons, you can set the **action** parameter to specify the operation to be triggered.
......@@ -81,9 +81,9 @@ struct PopupExample22 {
![en-us_other_0000001500740342](figures/en-us_other_0000001500740342.jpeg)
## Custom Bubbles
## Custom Popup
Developers can use the builder CustomPopupOptions to create customized bubbles. \@Builder can store customized content. In addition, parameters such as popupColor can be used to control the bubble style.
You can create a custom popup with **CustomPopupOptions**, defining custom content in \@Builder. In addition, you can use parameters such as **popupColor** to control the popup style.
......@@ -92,7 +92,7 @@ Developers can use the builder CustomPopupOptions to create customized bubbles.
@Component
struct Index {
@State customPopup: boolean = false
// The popup constructor defines the dialog box content.
// Define the popup content in the popup builder.
@Builder popupBuilder() {
Row({ space: 2 }) {
Image($r("app.media.icon")).width(24).height(24).margin({ left: 5 })
......@@ -107,9 +107,9 @@ struct Index {
this.customPopup = !this.customPopup
})
.bindPopup(this.customPopup, {
builder: this.popupBuilder, // Content of the bubble
placement:Placement.Bottom, // Pop-up position of the bubble
popupColor:Color.Pink // Background color of the bubble
builder: this.popupBuilder, // Content of the popup.
placement:Placement.Bottom, // Position of the popup.
popupColor:Color.Pink // Background color of the popup.
})
}
.height('100%')
......@@ -118,7 +118,7 @@ struct Index {
```
You can set the placement parameter to place the pop-up bubble in the required position. The pop-up window constructor triggers a pop-up message to guide the user to complete the operation, providing better UI experience for the user.
To place the popup in a specific position, set the **placement** parameter. The popup builder triggers a popup message to instruct the user to complete the operation.
![en-us_other_0000001500900234](figures/en-us_other_0000001500900234.jpeg)
......@@ -130,19 +130,19 @@ You can set the placement parameter to place the pop-up bubble in the required p
@Component
struct Index {
@State customPopup: boolean = false
// The popup constructor defines the dialog box content.
// Define the popup content in the popup builder.
@Builder popupBuilder() {
Row({ space: 2 }) {
Image('/images/shengWhite.png').width(30).objectFit(ImageFit.Contain)
Column(){
Text('Control Life') .fontSize(14).fontWeight(900).fontColor(Color.White).width('100%')
Text('When you want to sing, tens of millions of songs can be selected and the voice can be adjusted.').fontSize(12).fontColor('#ffeeeeee').width('100%')
Text('Savor Life').fontSize(14).fontWeight(900).fontColor(Color.White).width('100%')
Text('A treasure trove of sing-along songs').fontSize(12).fontColor('#ffeeeeee').width('100%')
}
}.width(230).height(80).padding(5)
}
build() {
Row() {
Text ('I would like to sing a song')
Text ('Sing along')
Image('/images/sheng.png').width(35).objectFit(ImageFit.Contain)
.onClick(() => {
this.customPopup = !this.customPopup
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册