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

!11975 翻译完成:11270 3.1Release分支:问题同步修改

Merge pull request !11975 from wusongqing/TR11270
...@@ -10,6 +10,7 @@ This module provides the following common window-related functions: ...@@ -10,6 +10,7 @@ This module provides the following common window-related functions:
> >
> 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. > 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.
## Modules to Import ## Modules to Import
```js ```js
...@@ -35,7 +36,7 @@ Enumerates the types of the area where the window cannot be displayed. ...@@ -35,7 +36,7 @@ Enumerates the types of the area where the window cannot be displayed.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Value | Description | | Name | Value | Description |
|----------------------------------|-----| ----------------- | | ----------- | ---- | ------------------ |
| TYPE_SYSTEM | 0 | Default area of the system.| | TYPE_SYSTEM | 0 | Default area of the system.|
| TYPE_CUTOUT | 1 | Notch. | | TYPE_CUTOUT | 1 | Notch. |
...@@ -80,9 +81,9 @@ Describes the callback for a single system bar. ...@@ -80,9 +81,9 @@ Describes the callback for a single system bar.
| Name | Type | Readable| Writable| Description | | Name | Type | Readable| Writable| Description |
| --------------- | ------------------------- | ---- | ---- | ------------------------------------------------------------ | | --------------- | ------------------------- | ---- | ---- | ------------------------------------------------------------ |
| type | [WindowType](#windowtype) | Yes | No | Type of the system bar whose properties are changed. Only the status bar and navigation bar are supported.| | type | [WindowType](#windowtype7) | Yes | No | Type of the system bar whose properties are changed. Only the status bar and navigation bar are supported.|
| isEnable | boolean | Yes | No | Whether the system bar is displayed. | | isEnable | boolean | Yes | No | Whether the system bar is displayed. |
| region | [Rect](#rect) | Yes | No | Current position and size of the system bar. | | region | [Rect](#rect7) | Yes | No | Current position and size of the system bar. |
| backgroundColor | string | Yes | No | Background color of the system bar. The value is a hexadecimal RGB or aRGB color value and is case insensitive, for example, `#00FF00` or `#FF00FF00`.| | backgroundColor | string | Yes | No | Background color of the system bar. The value is a hexadecimal RGB or aRGB color value and is case insensitive, for example, `#00FF00` or `#FF00FF00`.|
| contentColor | string | Yes | No | Color of the text on the system bar. | | contentColor | string | Yes | No | Color of the text on the system bar. |
...@@ -120,11 +121,10 @@ Describes the area where the window cannot be displayed. ...@@ -120,11 +121,10 @@ Describes the area where the window cannot be displayed.
| Name | Type | Readable| Writable| Description | | Name | Type | Readable| Writable| Description |
| ---------- | ------------- | ---- | ---- | ------------------ | | ---------- | ------------- | ---- | ---- | ------------------ |
| leftRect | [Rect](#rect) | Yes | Yes | Rectangle on the left of the screen.| | leftRect | [Rect](#rect7) | Yes | Yes | Rectangle on the left of the screen.|
| topRect | [Rect](#rect) | Yes | Yes | Rectangle at the top of the screen.| | topRect | [Rect](#rect7) | Yes | Yes | Rectangle at the top of the screen.|
| rightRect | [Rect](#rect) | Yes | Yes | Rectangle on the right of the screen.| | rightRect | [Rect](#rect7) | Yes | Yes | Rectangle on the right of the screen.|
| bottomRect | [Rect](#rect) | Yes | Yes | Rectangle at the bottom of the screen.| | bottomRect | [Rect](#rect7) | Yes | Yes | Rectangle at the bottom of the screen.|
## Size<sup>7+</sup> ## Size<sup>7+</sup>
...@@ -144,15 +144,15 @@ Describes the window properties. ...@@ -144,15 +144,15 @@ Describes the window properties.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Type | Readable| Writable| Description | | Name | Type | Readable| Writable| Description |
| ------------------------------------- | ------------------------- | ---- | ---- | ------------------------------------------------------------ | | ------------------------------- | ------------------------- | ---- | ---- | -------------------------------------------- |
| windowRect<sup>7+</sup> | [Rect](#rect) | Yes | Yes | Window size. | | windowRect<sup>7+</sup> | [Rect](#rect7) | Yes | Yes | Window size. |
| type<sup>7+</sup> | [WindowType](#windowtype) | Yes | Yes | Window type. | | type<sup>7+</sup> | [WindowType](#windowtype7) | Yes | Yes | Window type. |
| isFullScreen | boolean | Yes | Yes | Whether the window is displayed in full screen mode. The default value is `false`. | | isFullScreen | boolean | Yes | Yes | Whether the window is displayed in full screen mode. The default value is `false`. |
| isLayoutFullScreen<sup>7+</sup> | boolean | Yes | Yes | Whether the window layout is in full-screen mode (whether the window is immersive). The default value is `false`. | | isLayoutFullScreen<sup>7+</sup> | boolean | Yes | Yes | Whether the window layout is in full-screen mode (whether the window is immersive). The default value is `false`. |
| focusable<sup>7+</sup> | boolean | Yes | No | Whether the window can gain focus. The default value is `true`. | | focusable<sup>7+</sup> | boolean | Yes | No | Whether the window can gain focus. The default value is `true`. |
| touchable<sup>7+</sup> | boolean | Yes | No | Whether the window is touchable. The default value is `true`. | | touchable<sup>7+</sup> | boolean | Yes | No | Whether the window is touchable. The default value is `true`. |
| brightness | number | Yes | Yes | Screen brightness. The value ranges from 0 to 1. The value `1` indicates the maximum brightness. | | brightness | number | Yes | Yes | Screen brightness. The value ranges from 0 to 1. The value `1` indicates the maximum brightness. |
| dimBehindValue<sup>7+</sup> | number | Yes | Yes | Dimness of the window that is not on top. The value ranges from 0 to 1. The value `1` indicates the maximum dimness. | | dimBehindValue<sup>7+</sup> | number | Yes | Yes | Dimness of the window that is not on top. The value ranges from 0 to 1. The value `1` indicates the maximum dimness.|
| isKeepScreenOn | boolean | Yes | Yes | Whether the screen is always on. The default value is `false`. | | isKeepScreenOn | boolean | Yes | Yes | Whether the screen is always on. The default value is `false`. |
| isPrivacyMode<sup>7+</sup> | boolean | Yes | Yes | Whether the window is in privacy mode. The default value is `false`. | | isPrivacyMode<sup>7+</sup> | boolean | Yes | Yes | Whether the window is in privacy mode. The default value is `false`. |
| isRoundCorner<sup>7+</sup> | boolean | Yes | Yes | Whether the window has rounded corners. The default value is `false`. | | isRoundCorner<sup>7+</sup> | boolean | Yes | Yes | Whether the window has rounded corners. The default value is `false`. |
...@@ -182,7 +182,7 @@ Creates a subwindow. This API uses an asynchronous callback to return the result ...@@ -182,7 +182,7 @@ Creates a subwindow. This API uses an asynchronous callback to return the result
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | ---- | ------------------------------------ | | -------- | -------------------------------------- | ---- | ------------------------------------ |
| id | string | Yes | Window ID. | | id | string | Yes | Window ID. |
| type | [WindowType](#windowtype) | Yes | Window type. | | type | [WindowType](#windowtype7) | Yes | Window type. |
| callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the subwindow created.| | callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the subwindow created.|
**Example** **Example**
...@@ -212,7 +212,7 @@ Creates a subwindow. This API uses a promise to return the result. ...@@ -212,7 +212,7 @@ Creates a subwindow. This API uses a promise to return the result.
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------------------------- | ---- | ---------- | | ------ | ------------------------- | ---- | ---------- |
| id | string | Yes | Window ID. | | id | string | Yes | Window ID. |
| type | [WindowType](#windowtype) | Yes | Window type.| | type | [WindowType](#windowtype7) | Yes | Window type.|
**Return value** **Return value**
...@@ -247,7 +247,7 @@ Creates a subwindow. This API uses an asynchronous callback to return the result ...@@ -247,7 +247,7 @@ Creates a subwindow. This API uses an asynchronous callback to return the result
| -------- | -------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | -------------------------------------- | ---- | ------------------------------------------------------------ |
| ctx | [Context](js-apis-Context.md) | Yes | Current application context.| | ctx | [Context](js-apis-Context.md) | Yes | Current application context.|
| id | string | Yes | Window ID. | | id | string | Yes | Window ID. |
| type | [WindowType](#windowtype) | Yes | Window type. | | type | [WindowType](#windowtype7) | Yes | Window type. |
| callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the subwindow created. | | callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the subwindow created. |
**Example** **Example**
...@@ -280,7 +280,7 @@ Creates a subwindow. This API uses a promise to return the result. ...@@ -280,7 +280,7 @@ Creates a subwindow. This API uses a promise to return the result.
| ------ | ------------------------- | ---- | ------------------------------------------------------------ | | ------ | ------------------------- | ---- | ------------------------------------------------------------ |
| ctx | [Context](js-apis-Context.md) | Yes | Current application context.| | ctx | [Context](js-apis-Context.md) | Yes | Current application context.|
| id | string | Yes | Window ID. | | id | string | Yes | Window ID. |
| type | [WindowType](#windowtype) | Yes | Window type. | | type | [WindowType](#windowtype7) | Yes | Window type. |
**Return value** **Return value**
...@@ -430,7 +430,7 @@ Obtains the top window of the current application. This API uses an asynchronous ...@@ -430,7 +430,7 @@ Obtains the top window of the current application. This API uses an asynchronous
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | -------------------------------------- | ---- | ------------------------------------------------------------ |
| ctx | [Context](js-apis-Context.md) | Yes | Current application context.| | ctx | [Context](js-apis-Context.md) | Yes | Current application context. |
| callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the top window obtained. | | callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the top window obtained. |
**Example** **Example**
...@@ -495,7 +495,7 @@ Enables listening for properties changes of the status bar and navigation bar. ...@@ -495,7 +495,7 @@ Enables listening for properties changes of the status bar and navigation bar.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | --------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The value is fixed at `systemBarTintChange`, indicating the property change event of the status bar and navigation bar.| | type | string | Yes | Event type. The value is fixed at `systemBarTintChange`, indicating the property change event of the status bar and navigation bar.|
| callback | Callback&lt;[SystemBarTintState](#systembartintstate)&gt; | Yes | Callback used to return the properties of the status bar and navigation bar. | | callback | Callback&lt;[SystemBarTintState](#systembartintstate8)&gt; | Yes | Callback used to return the properties of the status bar and navigation bar. |
**Example** **Example**
...@@ -520,7 +520,7 @@ Disables listening for properties changes of the status bar and navigation bar. ...@@ -520,7 +520,7 @@ Disables listening for properties changes of the status bar and navigation bar.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | --------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The value is fixed at `systemBarTintChange`, indicating the property change event of the status bar and navigation bar.| | type | string | Yes | Event type. The value is fixed at `systemBarTintChange`, indicating the property change event of the status bar and navigation bar.|
| callback | Callback&lt;[SystemBarTintState](#systembartintstate)&gt; | No | Callback used to return the properties of the status bar and navigation bar. | | callback | Callback&lt;[SystemBarTintState](#systembartintstate8)&gt; | No | Callback used to return the properties of the status bar and navigation bar. |
**Example** **Example**
...@@ -758,6 +758,10 @@ resetSize(width: number, height: number, callback: AsyncCallback&lt;void&gt;): v ...@@ -758,6 +758,10 @@ resetSize(width: number, height: number, callback: AsyncCallback&lt;void&gt;): v
Changes the size of this window. This API uses an asynchronous callback to return the result. Changes the size of this window. This API uses an asynchronous callback to return the result.
The main window and subwindow have the following size limits: [320, 2560] in width and [240, 2560] in height, both in units of vp.
The system window has the following size limits: [0, 2560] in width and [0, 2560] in height, both in units of vp.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters** **Parameters**
...@@ -786,6 +790,10 @@ resetSize(width: number, height: number): Promise&lt;void&gt; ...@@ -786,6 +790,10 @@ resetSize(width: number, height: number): Promise&lt;void&gt;
Changes the size of this window. This API uses a promise to return the result. Changes the size of this window. This API uses a promise to return the result.
The main window and subwindow have the following size limits: [320, 2560] in width and [240, 2560] in height, both in units of vp.
The system window has the following size limits: [0, 2560] in width and [0, 2560] in height, both in units of vp.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters** **Parameters**
...@@ -826,7 +834,7 @@ Sets the type of this window. This API uses an asynchronous callback to return t ...@@ -826,7 +834,7 @@ Sets the type of this window. This API uses an asynchronous callback to return t
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ---------- | | -------- | ------------------------- | ---- | ---------- |
| type | [WindowType](#windowtype) | Yes | Window type.| | type | [WindowType](#windowtype7) | Yes | Window type.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Example** **Example**
...@@ -856,7 +864,7 @@ Sets the type of this window. This API uses a promise to return the result. ...@@ -856,7 +864,7 @@ Sets the type of this window. This API uses a promise to return the result.
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------------------------- | ---- | ---------- | | ------ | ------------------------- | ---- | ---------- |
| type | [WindowType](#windowtype) | Yes | Window type.| | type | [WindowType](#windowtype7) | Yes | Window type.|
**Return value** **Return value**
...@@ -938,7 +946,7 @@ Obtains the area where this window cannot be displayed, for example, the system ...@@ -938,7 +946,7 @@ Obtains the area where this window cannot be displayed, for example, the system
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- |-----------------------------------------------| ---- | ------------------------------------------------------------ | | -------- | -------------------------------------------- | ---- | ------------------------------------------------------------ |
| type | [AvoidAreaType](#avoidareatype) | Yes | Type of the area. `TYPE_SYSTEM` indicates the default area of the system. `TYPE_CUTOUT` indicates the notch.| | type | [AvoidAreaType](#avoidareatype) | Yes | Type of the area. `TYPE_SYSTEM` indicates the default area of the system. `TYPE_CUTOUT` indicates the notch.|
| callback | AsyncCallback&lt;[AvoidArea](#avoidarea)&gt; | Yes | Callback used to return the area. | | callback | AsyncCallback&lt;[AvoidArea](#avoidarea)&gt; | Yes | Callback used to return the area. |
...@@ -966,13 +974,13 @@ Obtains the area where this window cannot be displayed, for example, the system ...@@ -966,13 +974,13 @@ Obtains the area where this window cannot be displayed, for example, the system
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ |----------------------------------| ---- | ------------------------------------------------------------ | | ------ | ------------------------------- | ---- | ------------------------------------------------------------ |
| type | [AvoidAreaType](#avoidareatype) | Yes | Type of the area. `TYPE_SYSTEM` indicates the default area of the system. `TYPE_CUTOUT` indicates the notch.| | type | [AvoidAreaType](#avoidareatype) | Yes | Type of the area. `TYPE_SYSTEM` indicates the default area of the system. `TYPE_CUTOUT` indicates the notch.|
**Return value** **Return value**
| Type | Description | | Type | Description |
|-----------------------------------------| ----------------------------------- | | -------------------------------------- | ----------------------------------- |
| Promise&lt;[AvoidArea](#avoidarea)&gt; | Promise used to return the area.| | Promise&lt;[AvoidArea](#avoidarea)&gt; | Promise used to return the area.|
**Example** **Example**
...@@ -1190,9 +1198,6 @@ Sets the properties of the status bar and navigation bar in this window. This AP ...@@ -1190,9 +1198,6 @@ Sets the properties of the status bar and navigation bar in this window. This AP
var SystemBarProperties={ var SystemBarProperties={
statusBarColor: '#ff00ff', statusBarColor: '#ff00ff',
navigationBarColor: '#00ff00', navigationBarColor: '#00ff00',
// The following properties are supported since API version 7.
isStatusBarLightIcon: true,
isNavigationBarLightIcon:false,
// The following properties are supported since API version 8. // The following properties are supported since API version 8.
statusBarContentColor:'#ffffff', statusBarContentColor:'#ffffff',
navigationBarContentColor:'#00ffff' navigationBarContentColor:'#00ffff'
...@@ -1232,9 +1237,6 @@ Sets the properties of the status bar and navigation bar in this window. This AP ...@@ -1232,9 +1237,6 @@ Sets the properties of the status bar and navigation bar in this window. This AP
var SystemBarProperties={ var SystemBarProperties={
statusBarColor: '#ff00ff', statusBarColor: '#ff00ff',
navigationBarColor: '#00ff00', navigationBarColor: '#00ff00',
// The following properties are supported since API version 7.
isStatusBarLightIcon: true,
isNavigationBarLightIcon:false,
// The following properties are supported since API version 8. // The following properties are supported since API version 8.
statusBarContentColor:'#ffffff', statusBarContentColor:'#ffffff',
navigationBarContentColor:'#00ffff' navigationBarContentColor:'#00ffff'
...@@ -1410,7 +1412,7 @@ Enables listening for changes to the area where the window cannot be displayed. ...@@ -1410,7 +1412,7 @@ Enables listening for changes to the area where the window cannot be displayed.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- |------------------------------------------| ---- | ------------------------------------------------------- | | -------- | --------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The value is fixed at `systemAvoidAreaChange`, indicating the event of changes to the area where the window cannot be displayed.| | type | string | Yes | Event type. The value is fixed at `systemAvoidAreaChange`, indicating the event of changes to the area where the window cannot be displayed.|
| callback | Callback&lt;[AvoidArea](#avoidarea)&gt; | Yes | Callback used to return the area. | | callback | Callback&lt;[AvoidArea](#avoidarea)&gt; | Yes | Callback used to return the area. |
...@@ -1433,7 +1435,7 @@ Disables listening for changes to the area where the window cannot be displayed. ...@@ -1433,7 +1435,7 @@ Disables listening for changes to the area where the window cannot be displayed.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- |------------------------------------------| ---- | ------------------------------------------------------- | | -------- | --------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The value is fixed at `systemAvoidAreaChange`, indicating the event of changes to the area where the window cannot be displayed.| | type | string | Yes | Event type. The value is fixed at `systemAvoidAreaChange`, indicating the event of changes to the area where the window cannot be displayed.|
| callback | Callback&lt;[AvoidArea](#avoidarea)&gt; | No | Callback used to return the area. | | callback | Callback&lt;[AvoidArea](#avoidarea)&gt; | No | Callback used to return the area. |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册