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

!17910 翻译完成:17464+16822 修改translate接口描述+新增手势导航禁用相关接口说明文档

Merge pull request !17910 from wusongqing/TR14764
......@@ -54,7 +54,7 @@ Defines the parameters for creating a subwindow or system window.
| ---------- | -------------------------- | -- | ----------------------------------- |
| name | string | Yes| Name of the window. |
| windowType | [WindowType](#windowtype7) | Yes| Type of the window. |
| ctx | [BaseContext](js-apis-inner-application-baseContext.md) | No| Current application context. If this parameter is not set, no context is used.<br>You do not need to set this parameter to create a subwindow in the FA model or a system window in the stage model. |
| ctx | [BaseContext](js-apis-inner-application-baseContext.md) | No| Current application context. If this parameter is not set, no context is used.<br>You do not need to set this parameter to create a subwindow in the FA model<br>or a system window in the stage model.|
| displayId | number | No| ID of the current physical screen. If this parameter is not set, the default value **-1** is used.|
| parentId | number | No| ID of the parent window. If this parameter is not set, the default value **-1** is used. |
......@@ -66,7 +66,7 @@ Enumerates the types of the area where the window cannot be displayed.
| Name | Value | Description |
| -------------------------------- | ---- | ------------------------------------------------------------ |
| TYPE_SYSTEM | 0 | Default area of the system. Generally, the status bar, navigation bar, and Dock bar are included. The default area may vary according to the device in use.|
| TYPE_SYSTEM | 0 | Default area of the system. Generally, the status bar and navigation bar are included. The default area may vary according to the device in use.|
| TYPE_CUTOUT | 1 | Notch. |
| TYPE_SYSTEM_GESTURE<sup>9+</sup> | 2 | Gesture area. |
| TYPE_KEYBOARD<sup>9+</sup> | 3 | Soft keyboard area. |
......@@ -108,10 +108,10 @@ Describes the properties of the status bar and navigation bar.
| Name | Type| Mandatory| Description |
| -------------------------------------- | -------- | ---- | ------------------------------------------------------------ |
| statusBarColor | string | No | Background color of the status bar. The value is a hexadecimal RGB or aRGB color value and is case insensitive, for example, **#00FF00** or **#FF00FF00**. The default value is **#0x66000000**.|
| statusBarColor | string | No | Background color of the status bar. The value is a hexadecimal RGB or ARGB color code and is case insensitive, for example, **#00FF00** or **#FF00FF00**. The default value is **#0x66000000**.|
| isStatusBarLightIcon<sup>7+</sup> | boolean | No | Whether any icon on the status bar is highlighted. The value **true** means that the icon is highlighted, and **false** means the opposite. The default value is **false**.|
| statusBarContentColor<sup>8+</sup> | string | No | Color of the text on the status bar. After this property is set, the setting of **isStatusBarLightIcon** is invalid. The default value is **0xE5FFFFFF**.|
| navigationBarColor | string | No | Background color of the navigation bar. The value is a hexadecimal RGB or aRGB color value and is case insensitive, for example, **#00FF00** or **#FF00FF00**. The default value is **#0x66000000**.|
| navigationBarColor | string | No | Background color of the navigation bar. The value is a hexadecimal RGB or ARGB color code and is case insensitive, for example, **#00FF00** or **#FF00FF00**. The default value is **#0x66000000**.|
| isNavigationBarLightIcon<sup>7+</sup> | boolean | No | Whether any icon on the navigation bar is highlighted. The value **true** means that the icon is highlighted, and **false** means the opposite. The default value is **false**.|
| navigationBarContentColor<sup>8+</sup> | string | No | Color of the text on the navigation bar. After this property is set, the setting of **isNavigationBarLightIcon** is invalid. The default value is **0xE5FFFFFF**.|
......@@ -164,7 +164,7 @@ Describes the callback for a single system bar.
| 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. The value **true** means that the system bar is displayed, and **false** means the opposite.|
| 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 code and is case insensitive, for example, **#00FF00** or **#FF00FF00**.|
| contentColor | string | Yes | No | Color of the text on the system bar. |
## SystemBarTintState<sup>8+</sup>
......@@ -300,8 +300,6 @@ Describes the translation parameters.
Enumerates the window lifecycle states.
**System API**: This is a system API.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Value| Description |
......@@ -832,6 +830,148 @@ try {
}
```
## window.on('gestureNavigationEnabledChange')<sup>10+</sup>
on(type: 'gestureNavigationEnabledChange', callback: Callback&lt;boolean&gt;): void
Enables listening for gesture navigation status changes.
**System API**: This is a system API.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ----------------------- | ---- | ----------------------------------------------------------------------------- |
| type | string | Yes | Event type. The value is fixed at **'gestureNavigationEnabledChange'**, indicating the gesture navigation status change event. |
| callback | Callback&lt;boolean&gt; | Yes | Callback used to return the gesture navigation status. The value **true** means that the gesture navigation status is changed to enabled, and **false** means that the gesture navigation status is changed to disabled.|
**Example**
```js
try {
window.on('gestureNavigationEnabledChange', (data) => {
console.info('Succeeded in enabling the listener for gesture navigation status changes. Data: ' + JSON.stringify(data));
});
} catch (exception) {
console.error('Failed to enable the listener for gesture navigation status changes. Cause: ' + JSON.stringify(exception));
}
```
## window.off('gestureNavigationEnabledChange')<sup>10+</sup>
off(type: 'gestureNavigationEnabledChange', callback?: Callback&lt;boolean&gt;): void
Disables the listening for gesture navigation status changes.
**System API**: This is a system API.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ----------------------- | -- | ------------------------------------------------------------ |
| type | string | Yes| Event type. The value is fixed at **'gestureNavigationEnabledChange'**, indicating the gesture navigation status change event.|
| callback | Callback&lt;boolean&gt; | No| Callback function that has been used for registering the listener. If this parameter is passed in, only the listener registered using this callback function is removed; otherwise, all gesture navigation status change listeners are removed.|
**Example**
```js
try {
window.off('gestureNavigationEnabledChange');
} catch (exception) {
console.error('Failed to disable the listener for gesture navigation status changes. Cause: ' + JSON.stringify(exception));
}
```
## window.setGestureNavigationEnabled<sup>10+</sup>
setGestureNavigationEnabled(enable: boolean, callback: AsyncCallback&lt;void&gt;): void
Enables or disables gesture navigation. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | -------------- |
| enable | boolean | Yes | Whether to enable gesture navigation. The value **true** means to enable gesture navigation, and **false** means the opposite.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the error codes, see [Window Error Codes](../errorcodes/errorcode-window.md).
| ID| Error Message|
| ------- | --------------------------------------------- |
| 1300002 | This window state is abnormal. |
| 1300003 | This window manager service works abnormally. |
**Example**
```js
try {
window.setGestureNavigationEnabled(true, (err) => {
if(err.code) {
console.error('Failed to set gesture navigation enabled. Cause: ' + JSON.stringify(err));
return;
}
console.info('Succeeded in setting gesture navigation enabled.');
});
} catch (exception) {
console.error('Failed to set gesture navigation enabled. Cause: ' + JSON.stringify(exception));
}
```
## window.setGestureNavigationEnabled<sup>10+</sup>
setGestureNavigationEnabled(enable: boolean): Promise&lt;void&gt;
Enables or disables gesture navigation. This API uses a promise to return the result.
**System API**: This is a system API.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters**
| Name| Type | Mandatory | Description |
| ------ | ------- | ---- | -------------------- |
| enable | boolean | Yes | Whether to enable gesture navigation. The value **true** means to enable gesture navigation, and **false** means the opposite.|
**Return value**
| Type | Description |
| ------------------- | ------------------------- |
| Promise&lt;void&gt; | Promise that returns no value.|
**Error codes**
For details about the error codes, see [Window Error Codes](../errorcodes/errorcode-window.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
| 1300002 | This window state is abnormal. |
| 1300003 | This window manager service works abnormally. |
**Example**
```js
try {
let promise = window.setGestureNavigationEnabled(true);
promise.then(()=> {
console.info('Succeeded in setting gesture navigation enabled.');
}).catch((err)=>{
console.error('Failed to set gesture navigation enabled. Cause: ' + JSON.stringify(err));
});
} catch (exception) {
console.error('Failed to set gesture navigation enabled. Cause: ' + JSON.stringify(exception));
}
```
## window.create<sup>(deprecated)</sup>
create(id: string, type: WindowType, callback: AsyncCallback&lt;Window&gt;): void
......@@ -1910,7 +2050,9 @@ try {
setWindowLayoutFullScreen(isLayoutFullScreen: boolean, callback: AsyncCallback&lt;void&gt;): void
Sets whether to enable the full-screen mode for the window layout. This API uses an asynchronous callback to return the result.
Sets whether the window layout is immersive. This API uses an asynchronous callback to return the result.
An immersive layout means that the layout does not avoid the status bar and navigation bar, and components may overlap with them.
A non-immersive layout means that the layout avoids the status bar and navigation bar, and components do not overlap with them.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -1918,7 +2060,7 @@ Sets whether to enable the full-screen mode for the window layout. This API uses
| Name| Type| Mandatory| Description|
| ------------------ | ------------------------- | -- | --------- |
| isLayoutFullScreen | boolean | Yes| Whether to enable the full-screen mode for the window layout, in which the status bar and navigation bar are displayed. The value **true** means to enable the full-screen mode for the window layout, and **false** means the opposite.|
| isLayoutFullScreen | boolean | Yes| Whether the window layout is immersive. (The status bar and navigation bar of the immersive layout are still displayed.) The value **true** means that the window layout is immersive, and **false** means the opposite.|
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
**Error codes**
......@@ -1951,7 +2093,9 @@ try {
setWindowLayoutFullScreen(isLayoutFullScreen: boolean): Promise&lt;void&gt;
Sets whether to enable the full-screen mode for the window layout. This API uses a promise to return the result.
Sets whether the window layout is immersive. This API uses a promise to return the result.
An immersive layout means that the layout does not avoid the status bar and navigation bar, and components may overlap with them.
A non-immersive layout means that the layout avoids the status bar and navigation bar, and components do not overlap with them.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -1959,7 +2103,7 @@ Sets whether to enable the full-screen mode for the window layout. This API uses
| Name| Type| Mandatory| Description|
| ------------------ | ------- | -- | ------------------------------------------------------------------------------------------------ |
| isLayoutFullScreen | boolean | Yes| Whether to enable the full-screen mode for the window layout, in which the status bar and navigation bar are displayed. The value **true** means to enable the full-screen mode for the window layout, and **false** means the opposite.|
| isLayoutFullScreen | boolean | Yes| Whether the window layout is immersive. (The status bar and navigation bar of the immersive layout are still displayed.) The value **true** means that the window layout is immersive, and **false** means the opposite.|
**Return value**
......@@ -2361,7 +2505,7 @@ Loads content from a page associated with a local storage to this window. This A
| Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------- | ---- | ------------------------------------------------------------ |
| path | string | Yes | Path of the page from which the content will be loaded. |
| storage | [LocalStorage](../../quick-start/arkts-state-mgmt-application-level.md#localstorage) | Yes | A storage unit, which provides storage for variable state properties and non-variable state properties of an application.|
| storage | [LocalStorage](../../quick-start/arkts-localstorage.md) | Yes | A storage unit, which provides storage for variable state properties and non-variable state properties of an application.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
......@@ -2407,7 +2551,7 @@ Loads content from a page associated with a local storage to this window. This A
| Name | Type | Mandatory| Description |
| ------- | ----------------------------------------------- | ---- | ------------------------------------------------------------ |
| path | string | Yes | Path of the page from which the content will be loaded. |
| storage | [LocalStorage](../../quick-start/arkts-state-mgmt-application-level.md#localstorage) | Yes | A storage unit, which provides storage for variable state properties and non-variable state properties of an application.|
| storage | [LocalStorage](../../quick-start/arkts-localstorage.md) | Yes | A storage unit, which provides storage for variable state properties and non-variable state properties of an application.|
**Return value**
......@@ -3335,7 +3479,7 @@ Sets the background color for this window. In the stage model, this API must be
| Name| Type| Mandatory| Description|
| ----- | ------ | -- | ----------------------------------------------------------------------- |
| color | string | Yes| Background color to set. The value is a hexadecimal RGB or aRGB color code and is case insensitive, for example, **#00FF00** or **#FF00FF00**.|
| color | string | Yes| Background color to set. The value is a hexadecimal RGB or ARGB color code and is case insensitive, for example, **#00FF00** or **#FF00FF00**.|
**Error codes**
......@@ -4019,7 +4163,7 @@ promise.then((pixelMap)=> {
opacity(opacity: number): void
Sets the opacity for this window.
Sets the opacity for this window. This API can be used only when you [customize an animation to be played during the display or hiding of a system window](../../windowmanager/system-window-stage.md#customizing-an-animation-to-be-played-during-the-display-or-hiding-of-a-system-window).
**System API**: This is a system API.
......@@ -4027,9 +4171,9 @@ Sets the opacity for this window.
**Parameters**
| Name | Type | Mandatory | Description |
| ------- | ------ | --------- | ------------------------------------------------- |
| opacity | number | Yes | Opacity to set. The value ranges from 0.0 to 1.0. |
| Name | Type | Mandatory | Description |
| ------- | ------ | --------- | ------------------------------------------------------------ |
| opacity | number | Yes | Opacity to set. The value ranges from 0.0 to 1.0. The value **0.0** means completely transparent, and **1.0** means completely opaque. |
**Error codes**
......@@ -4054,7 +4198,7 @@ try {
scale(scaleOptions: ScaleOptions): void
Sets the scale parameters for this window.
Sets the scale parameters for this window. This API can be used only when you [customize an animation to be played during the display or hiding of a system window](../../windowmanager/system-window-stage.md#customizing-an-animation-to-be-played-during-the-display-or-hiding-of-a-system-window).
**System API**: This is a system API.
......@@ -4095,7 +4239,7 @@ try {
rotate(rotateOptions: RotateOptions): void
Sets the rotation parameters for this window.
Sets the rotation parameters for this window. This API can be used only when you [customize an animation to be played during the display or hiding of a system window](../../windowmanager/system-window-stage.md#customizing-an-animation-to-be-played-during-the-display-or-hiding-of-a-system-window).
**System API**: This is a system API.
......@@ -4137,7 +4281,7 @@ try {
translate(translateOptions: TranslateOptions): void
Sets the translation parameters for this window.
Sets the translation parameters for this window. This API can be used only when you [customize an animation to be played during the display or hiding of a system window](../../windowmanager/system-window-stage.md#customizing-an-animation-to-be-played-during-the-display-or-hiding-of-a-system-window).
**System API**: This is a system API.
......@@ -4145,9 +4289,9 @@ Sets the translation parameters for this window.
**Parameters**
| Name | Type | Mandatory | Description |
| ---------------- | -------------------------------------- | --------- | ------------------------------ |
| translateOptions | [TranslateOptions](#translateoptions9) | Yes | Translation parameters to set. |
| Name | Type | Mandatory | Description |
| ---------------- | -------------------------------------- | --------- | ------------------------------------------- |
| translateOptions | [TranslateOptions](#translateoptions9) | Yes | Translation parameters. The unit is pixels. |
**Error codes**
......@@ -4303,7 +4447,6 @@ try {
} catch (exception) {
console.error('Failed to set backdrop blur. Cause: ' + JSON.stringify(exception));
}
```
### setBackdropBlurStyle<sup>9+</sup>
......@@ -4339,7 +4482,6 @@ try {
} catch (exception) {
console.error('Failed to set backdrop blur style. Cause: ' + JSON.stringify(exception));
}
```
### setShadow<sup>9+</sup>
......@@ -4357,7 +4499,7 @@ Sets the shadow for the window borders.
| Name | Type | Mandatory | Description |
| ------- | ------ | --------- | ------------------------------------------------------------ |
| radius | number | Yes | Radius of the shadow. The value is greater than or equal to 0. The value **0** means that the shadow is disabled for the window borders. |
| color | string | No | Color of the shadow. The value is a hexadecimal RGB or aRGB color code and is case insensitive, for example, **#00FF00** or **#FF00FF00**. |
| color | string | No | Color of the shadow. The value is a hexadecimal RGB or ARGB color code and is case insensitive, for example, **#00FF00** or **#FF00FF00**. |
| offsetX | number | No | Offset of the shadow along the x-axis, in pixels. |
| offsetY | number | No | Offset of the shadow along the y-axis, in pixels. |
......@@ -4378,7 +4520,6 @@ try {
} catch (exception) {
console.error('Failed to set shadow. Cause: ' + JSON.stringify(exception));
}
```
### setCornerRadius<sup>9+</sup>
......@@ -4414,7 +4555,6 @@ try {
} catch (exception) {
console.error('Failed to set corner radius. Cause: ' + JSON.stringify(exception));
}
```
### raiseToAppTop<sup>10+</sup>
......@@ -4454,7 +4594,6 @@ windowClass.raiseToAppTop((err) => {
}
console.info('Succeeded in raising the window to app top.');
});
```
### raiseToAppTop<sup>10+</sup>
......@@ -4493,9 +4632,7 @@ promise.then(()=> {
}).catch((err)=>{
console.error('Failed to raise the window to app top. Cause: ' + JSON.stringify(err));
});
```
### setAspectRatio<sup>10+</sup>
setAspectRatio(ratio: number): Promise&lt;void&gt;
......@@ -4541,7 +4678,6 @@ try {
} catch (exception) {
console.error('Failed to set the aspect ratio of window. Cause: ' + JSON.stringify(exception));
}
```
### setAspectRatio<sup>10+</sup>
......@@ -4585,7 +4721,6 @@ try {
} catch (exception) {
console.error('Failed to set the aspect ratio of window. Cause: ' + JSON.stringify(exception));
}
```
### resetAspectRatio<sup>10+</sup>
......@@ -4626,7 +4761,6 @@ try {
} catch (exception) {
console.error('Failed to reset the aspect ratio of window. Cause: ' + JSON.stringify(exception));
}
```
### resetAspectRatio<sup>10+</sup>
......@@ -4668,7 +4802,6 @@ try {
} catch (exception) {
console.error('Failed to reset the aspect ratio of window. Cause: ' + JSON.stringify(exception));
}
```
### setWaterMarkFlag<sup>10+</sup>
......@@ -4717,7 +4850,6 @@ try {
} catch (exception) {
console.error('Failed to set water mark flag of window. Cause: ' + JSON.stringify(exception));
}
```
### setWaterMarkFlag<sup>10+</sup>
......@@ -4762,7 +4894,6 @@ try {
} catch (exception) {
console.error('Failed to set water mark flag of window. Cause: ' + JSON.stringify(exception));
}
```
### show<sup>(deprecated)</sup>
......@@ -4793,7 +4924,6 @@ windowClass.show((err) => {
}
console.info('Succeeded in showing the window.');
});
```
### show<sup>(deprecated)</sup>
......@@ -4823,7 +4953,6 @@ promise.then(()=> {
}).catch((err)=>{
console.error('Failed to show the window. Cause: ' + JSON.stringify(err));
});
```
### destroy<sup>(deprecated)</sup>
......@@ -4854,7 +4983,6 @@ windowClass.destroy((err) => {
}
console.info('Succeeded in destroying the window.');
});
```
### destroy<sup>(deprecated)</sup>
......@@ -4884,7 +5012,6 @@ promise.then(()=> {
}).catch((err)=>{
console.error('Failed to destroy the window. Cause: ' + JSON.stringify(err));
});
```
### moveTo<sup>(deprecated)</sup>
......@@ -4919,7 +5046,6 @@ windowClass.moveTo(300, 300, (err)=>{
}
console.info('Succeeded in moving the window.');
});
```
### moveTo<sup>(deprecated)</sup>
......@@ -4958,7 +5084,6 @@ promise.then(()=> {
}).catch((err)=>{
console.error('Failed to move the window. Cause: ' + JSON.stringify(err));
});
```
### resetSize<sup>(deprecated)</sup>
......@@ -4999,7 +5124,6 @@ windowClass.resetSize(500, 1000, (err) => {
}
console.info('Succeeded in changing the window size.');
});
```
### resetSize<sup>(deprecated)</sup>
......@@ -5044,7 +5168,6 @@ promise.then(()=> {
}).catch((err)=>{
console.error('Failed to change the window size. Cause: ' + JSON.stringify(err));
});
```
### setWindowType<sup>(deprecated)</sup>
......@@ -5079,7 +5202,6 @@ windowClass.setWindowType(type, (err) => {
}
console.info('Succeeded in setting the window type.');
});
```
### setWindowType<sup>(deprecated)</sup>
......@@ -5118,7 +5240,6 @@ promise.then(()=> {
}).catch((err)=>{
console.error('Failed to set the window type. Cause: ' + JSON.stringify(err));
});
```
### getProperties<sup>(deprecated)</sup>
......@@ -5149,7 +5270,6 @@ windowClass.getProperties((err, data) => {
}
console.info('Succeeded in obtaining the window properties. Data: ' + JSON.stringify(data));
});
```
### getProperties<sup>(deprecated)</sup>
......@@ -5179,7 +5299,6 @@ promise.then((data)=> {
}).catch((err)=>{
console.error('Failed to obtain the window properties. Cause: ' + JSON.stringify(err));
});
```
### getAvoidArea<sup>(deprecated)</sup>
......@@ -5212,7 +5331,6 @@ windowClass.getAvoidArea(type, (err, data) => {
}
console.info('Succeeded in obtaining the area. Data:' + JSON.stringify(data));
});
```
### getAvoidArea<sup>(deprecated)</sup>
......@@ -5249,7 +5367,6 @@ promise.then((data)=> {
}).catch((err)=>{
console.error('Failed to obtain the area. Cause:' + JSON.stringify(err));
});
```
### setFullScreen<sup>(deprecated)</sup>
......@@ -5282,7 +5399,6 @@ windowClass.setFullScreen(isFullScreen, (err) => {
}
console.info('Succeeded in enabling the full-screen mode.');
});
```
### setFullScreen<sup>(deprecated)</sup>
......@@ -5319,14 +5435,15 @@ promise.then(()=> {
}).catch((err)=>{
console.error('Failed to enable the full-screen mode. Cause: ' + JSON.stringify(err));
});
```
### setLayoutFullScreen<sup>(deprecated)</sup>
setLayoutFullScreen(isLayoutFullScreen: boolean, callback: AsyncCallback&lt;void&gt;): void
Sets whether to enable the full-screen mode for the window layout. This API uses an asynchronous callback to return the result.
Sets whether the window layout is immersive. This API uses an asynchronous callback to return the result.
An immersive layout means that the layout does not avoid the status bar and navigation bar, and components may overlap with them.
A non-immersive layout means that the layout avoids the status bar and navigation bar, and components do not overlap with them.
> **NOTE**
>
......@@ -5338,7 +5455,7 @@ Sets whether to enable the full-screen mode for the window layout. This API uses
| Name | Type | Mandatory | Description |
| ------------------ | ------------------------- | --------- | ------------------------------------------------------------ |
| isLayoutFullScreen | boolean | Yes | Whether to enable the full-screen mode for the window layout, in which the status bar and navigation bar are displayed. The value **true** means to enable the full-screen mode for the window layout, and **false** means the opposite. |
| isLayoutFullScreen | boolean | Yes | Whether the window layout is immersive. (The status bar and navigation bar of the immersive layout are still displayed.) The value **true** means that the window is immersive, and **false** means the opposite. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Example**
......@@ -5352,14 +5469,15 @@ windowClass.setLayoutFullScreen(isLayoutFullScreen, (err) => {
}
console.info('Succeeded in setting the window layout to full-screen mode.');
});
```
### setLayoutFullScreen<sup>(deprecated)</sup>
setLayoutFullScreen(isLayoutFullScreen: boolean): Promise&lt;void&gt;
Sets whether to enable the full-screen mode for the window layout. This API uses a promise to return the result.
Sets whether the window layout is immersive. This API uses a promise to return the result.
An immersive layout means that the layout does not avoid the status bar and navigation bar, and components may overlap with them.
A non-immersive layout means that the layout avoids the status bar and navigation bar, and components do not overlap with them.
> **NOTE**
>
......@@ -5371,7 +5489,7 @@ Sets whether to enable the full-screen mode for the window layout. This API uses
| Name | Type | Mandatory | Description |
| ------------------ | ------- | --------- | ------------------------------------------------------------ |
| isLayoutFullScreen | boolean | Yes | Whether to enable the full-screen mode for the window layout, in which the status bar and navigation bar are displayed. The value **true** means to enable the full-screen mode for the window layout, and **false** means the opposite. |
| isLayoutFullScreen | boolean | Yes | Whether the window layout is immersive. (The status bar and navigation bar of the immersive layout are still displayed.) The value **true** means that the window is immersive, and **false** means the opposite. |
**Return value**
......@@ -5389,7 +5507,6 @@ promise.then(()=> {
}).catch((err)=>{
console.error('Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(err));
});
```
### setSystemBarEnable<sup>(deprecated)</sup>
......@@ -5423,7 +5540,6 @@ windowClass.setSystemBarEnable(names, (err) => {
}
console.info('Succeeded in setting the system bar to be invisible.');
});
```
### setSystemBarEnable<sup>(deprecated)</sup>
......@@ -5461,7 +5577,6 @@ promise.then(()=> {
}).catch((err)=>{
console.error('Failed to set the system bar to be invisible. Cause:' + JSON.stringify(err));
});
```
### setSystemBarProperties<sup>(deprecated)</sup>
......@@ -5500,7 +5615,6 @@ windowClass.setSystemBarProperties(SystemBarProperties, (err) => {
}
console.info('Succeeded in setting the system bar properties.');
});
```
### setSystemBarProperties<sup>(deprecated)</sup>
......@@ -5543,7 +5657,6 @@ promise.then(()=> {
}).catch((err)=>{
console.error('Failed to set the system bar properties. Cause: ' + JSON.stringify(err));
});
```
### loadContent<sup>(deprecated)</sup>
......@@ -5575,7 +5688,6 @@ windowClass.loadContent('pages/page2/page2', (err) => {
}
console.info('Succeeded in loading the content.');
});
```
### loadContent<sup>(deprecated)</sup>
......@@ -5611,7 +5723,6 @@ promise.then(()=> {
}).catch((err)=>{
console.error('Failed to load the content. Cause: ' + JSON.stringify(err));
});
```
### isShowing<sup>(deprecated)</sup>
......@@ -5642,7 +5753,6 @@ windowClass.isShowing((err, data) => {
}
console.info('Succeeded in checking whether the window is showing. Data: ' + JSON.stringify(data));
});
```
### isShowing<sup>(deprecated)</sup>
......@@ -5672,7 +5782,6 @@ promise.then((data)=> {
}).catch((err)=>{
console.error('Failed to check whether the window is showing. Cause: ' + JSON.stringify(err));
});
```
### on('systemAvoidAreaChange')<sup>(deprecated)</sup>
......@@ -5700,7 +5809,6 @@ Enables listening for changes to the area where the window cannot be displayed.
windowClass.on('systemAvoidAreaChange', (data) => {
console.info('Succeeded in enabling the listener for system avoid area changes. Data: ' + JSON.stringify(data));
});
```
### off('systemAvoidAreaChange')<sup>(deprecated)</sup>
......@@ -5726,7 +5834,6 @@ Disables listening for changes to the area where the window cannot be displayed.
```js
windowClass.off('systemAvoidAreaChange');
```
### isSupportWideGamut<sup>(deprecated)</sup>
......@@ -5757,7 +5864,6 @@ windowClass.isSupportWideGamut((err, data) => {
}
console.info('Succeeded in checking whether the window support WideGamut Data: ' + JSON.stringify(data));
});
```
### isSupportWideGamut<sup>(deprecated)</sup>
......@@ -5787,7 +5893,6 @@ promise.then((data)=> {
}).catch((err)=>{
console.error('Failed to check whether the window support WideGamut. Cause: ' + JSON.stringify(err));
});
```
### setColorSpace<sup>(deprecated)</sup>
......@@ -5819,7 +5924,6 @@ windowClass.setColorSpace(window.ColorSpace.WIDE_GAMUT, (err) => {
}
console.info('Succeeded in setting window colorspace.');
});
```
### setColorSpace<sup>(deprecated)</sup>
......@@ -5855,7 +5959,6 @@ promise.then(()=> {
}).catch((err)=>{
console.error('Failed to set window colorspace. Cause: ' + JSON.stringify(err));
});
```
### getColorSpace<sup>(deprecated)</sup>
......@@ -5886,7 +5989,6 @@ windowClass.getColorSpace((err, data) => {
}
console.info('Succeeded in getting window colorspace. Cause:' + JSON.stringify(data));
});
```
### getColorSpace<sup>(deprecated)</sup>
......@@ -5916,7 +6018,6 @@ promise.then((data)=> {
}).catch((err)=>{
console.error('Failed to get window colorspace. Cause: ' + JSON.stringify(err));
});
```
### setBackgroundColor<sup>(deprecated)</sup>
......@@ -5935,7 +6036,7 @@ Sets the background color for this window. This API uses an asynchronous callbac
| Name | Type | Mandatory | Description |
| -------- | ------------------------- | --------- | ------------------------------------------------------------ |
| color | string | Yes | Background color to set. The value is a hexadecimal RGB or aRGB color code and is case insensitive, for example, **#00FF00** or **#FF00FF00**. |
| color | string | Yes | Background color to set. The value is a hexadecimal RGB or ARGB color code and is case insensitive, for example, **#00FF00** or **#FF00FF00**. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Example**
......@@ -5949,7 +6050,6 @@ windowClass.setBackgroundColor(color, (err) => {
}
console.info('Succeeded in setting the background color.');
});
```
### setBackgroundColor<sup>(deprecated)</sup>
......@@ -5968,7 +6068,7 @@ Sets the background color for this window. This API uses a promise to return the
| Name | Type | Mandatory | Description |
| ----- | ------ | --------- | ------------------------------------------------------------ |
| color | string | Yes | Background color to set. The value is a hexadecimal RGB or aRGB color code and is case insensitive, for example, **#00FF00** or **#FF00FF00**. |
| color | string | Yes | Background color to set. The value is a hexadecimal RGB or ARGB color code and is case insensitive, for example, **#00FF00** or **#FF00FF00**. |
**Return value**
......@@ -5986,7 +6086,6 @@ promise.then(()=> {
}).catch((err)=>{
console.error('Failed to set the background color. Cause: ' + JSON.stringify(err));
});
```
### setBrightness<sup>(deprecated)</sup>
......@@ -6019,7 +6118,6 @@ windowClass.setBrightness(brightness, (err) => {
}
console.info('Succeeded in setting the brightness.');
});
```
### setBrightness<sup>(deprecated)</sup>
......@@ -6056,7 +6154,6 @@ promise.then(()=> {
}).catch((err)=>{
console.error('Failed to set the brightness. Cause: ' + JSON.stringify(err));
});
```
### setDimBehind<sup>(deprecated)</sup>
......@@ -6088,7 +6185,6 @@ windowClass.setDimBehind(0.5, (err) => {
}
console.info('Succeeded in setting the dimness.');
});
```
### setDimBehind<sup>(deprecated)</sup>
......@@ -6124,7 +6220,6 @@ promise.then(()=> {
}).catch((err)=>{
console.error('Failed to set the dimness. Cause: ' + JSON.stringify(err));
});
```
### setFocusable<sup>(deprecated)</sup>
......@@ -6157,7 +6252,6 @@ windowClass.setFocusable(isFocusable, (err) => {
}
console.info('Succeeded in setting the window to be focusable.');
});
```
### setFocusable<sup>(deprecated)</sup>
......@@ -6194,7 +6288,6 @@ promise.then(()=> {
}).catch((err)=>{
console.error('Failed to set the window to be focusable. Cause: ' + JSON.stringify(err));
});
```
### setKeepScreenOn<sup>(deprecated)</sup>
......@@ -6227,7 +6320,6 @@ windowClass.setKeepScreenOn(isKeepScreenOn, (err) => {
}
console.info('Succeeded in setting the screen to be always on.');
});
```
### setKeepScreenOn<sup>(deprecated)</sup>
......@@ -6264,7 +6356,6 @@ promise.then(() => {
}).catch((err)=>{
console.info('Failed to set the screen to be always on. Cause: ' + JSON.stringify(err));
});
```
### setOutsideTouchable<sup>(deprecated)</sup>
......@@ -6296,7 +6387,6 @@ windowClass.setOutsideTouchable(true, (err) => {
}
console.info('Succeeded in setting the area to be touchable.');
});
```
### setOutsideTouchable<sup>(deprecated)</sup>
......@@ -6332,7 +6422,6 @@ promise.then(()=> {
}).catch((err)=>{
console.error('Failed to set the area to be touchable. Cause: ' + JSON.stringify(err));
});
```
### setPrivacyMode<sup>(deprecated)</sup>
......@@ -6365,7 +6454,6 @@ windowClass.setPrivacyMode(isPrivacyMode, (err) => {
}
console.info('Succeeded in setting the window to privacy mode.');
});
```
### setPrivacyMode<sup>(deprecated)</sup>
......@@ -6402,7 +6490,6 @@ promise.then(()=> {
}).catch((err)=>{
console.error('Failed to set the window to privacy mode. Cause: ' + JSON.stringify(err));
});
```
### setTouchable<sup>(deprecated)</sup>
......@@ -6435,7 +6522,6 @@ windowClass.setTouchable(isTouchable, (err) => {
}
console.info('Succeeded in setting the window to be touchable.');
});
```
### setTouchable<sup>(deprecated)</sup>
......@@ -6472,7 +6558,6 @@ promise.then(()=> {
}).catch((err)=>{
console.error('Failed to set the window to be touchable. Cause: ' + JSON.stringify(err));
});
```
## WindowStageEventType<sup>9+</sup>
......@@ -6542,7 +6627,6 @@ export default class EntryAbility extends UIAbility {
});
}
};
```
### getMainWindow<sup>9+</sup>
......@@ -6590,7 +6674,6 @@ export default class EntryAbility extends UIAbility {
});
}
};
```
### getMainWindowSync<sup>9+</sup>
......@@ -6635,7 +6718,6 @@ export default class EntryAbility extends UIAbility {
};
}
};
```
### createSubWindow<sup>9+</sup>
......@@ -6690,9 +6772,7 @@ export default class EntryAbility extends UIAbility {
};
}
};
```
### createSubWindow<sup>9+</sup>
createSubWindow(name: string): Promise&lt;Window&gt;
......@@ -6748,7 +6828,6 @@ export default class EntryAbility extends UIAbility {
};
}
};
```
### getSubWindow<sup>9+</sup>
......@@ -6796,9 +6875,7 @@ export default class EntryAbility extends UIAbility {
});
}
};
```
### getSubWindow<sup>9+</sup>
getSubWindow(): Promise&lt;Array&lt;Window&gt;&gt;
......@@ -6843,9 +6920,7 @@ export default class EntryAbility extends UIAbility {
})
}
};
```
### loadContent<sup>9+</sup>
loadContent(path: string, storage: LocalStorage, callback: AsyncCallback&lt;void&gt;): void
......@@ -6858,11 +6933,11 @@ Loads content from a page associated with a local storage to the main window in
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
| path | string | Yes | Path of the page from which the content will be loaded. |
| storage | [LocalStorage](../../quick-start/arkts-state-mgmt-application-level.md#localstorage) | Yes | A storage unit, which provides storage for variable state properties and non-variable state properties of an application. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
| Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------- | --------- | ------------------------------------------------------------ |
| path | string | Yes | Path of the page from which the content will be loaded. |
| storage | [LocalStorage](../../quick-start/arkts-localstorage.md) | Yes | A storage unit, which provides storage for variable state properties and non-variable state properties of an application. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
......@@ -6899,7 +6974,6 @@ export default class EntryAbility extends UIAbility {
};
}
};
```
### loadContent<sup>9+</sup>
......@@ -6914,10 +6988,10 @@ Loads content from a page associated with a local storage to the main window in
**Parameters**
| Name | Type | Mandatory | Description |
| ------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ |
| path | string | Yes | Path of the page from which the content will be loaded. |
| storage | [LocalStorage](../../quick-start/arkts-state-mgmt-application-level.md#localstorage) | No | A storage unit, which provides storage for variable state properties and non-variable state properties of an application. |
| Name | Type | Mandatory | Description |
| ------- | ------------------------------------------------------- | --------- | ------------------------------------------------------------ |
| path | string | Yes | Path of the page from which the content will be loaded. |
| storage | [LocalStorage](../../quick-start/arkts-localstorage.md) | No | A storage unit, which provides storage for variable state properties and non-variable state properties of an application. |
**Return value**
......@@ -6959,7 +7033,6 @@ export default class EntryAbility extends UIAbility {
};
}
};
```
### loadContent<sup>9+</sup>
......@@ -7011,7 +7084,6 @@ export default class EntryAbility extends UIAbility {
};
}
};
```
### on('windowStageEvent')<sup>9+</sup>
......@@ -7061,7 +7133,6 @@ export default class EntryAbility extends UIAbility {
};
}
};
```
### off('windowStageEvent')<sup>9+</sup>
......@@ -7108,7 +7179,6 @@ export default class EntryAbility extends UIAbility {
};
}
};
```
### disableWindowDecor()<sup>9+</sup>
......@@ -7145,7 +7215,6 @@ export default class EntryAbility extends UIAbility {
windowStage.disableWindowDecor();
}
};
```
### setShowOnLockScreen()<sup>9+</sup>
......@@ -7192,9 +7261,7 @@ export default class EntryAbility extends UIAbility {
};
}
};
```
## TransitionContext<sup>9+</sup>
Provides the context for the transition animation.
......@@ -7255,7 +7322,6 @@ controller.animationForShown = (context : window.TransitionContext) => {
}
console.info('complete transition end');
};
```
## TransitionController<sup>9+</sup>
......@@ -7306,7 +7372,6 @@ controller.animationForShown = (context : window.TransitionContext) => {
);
console.info('complete transition end');
};
```
### animationForHidden<sup>9+</sup>
......@@ -7353,4 +7418,6 @@ controller.animationForHidden = (context : window.TransitionContext) => {
)
console.info('complete transition end');
};
```
\ No newline at end of file
```
<!--no_check-->
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册