diff --git a/en/application-dev/reference/apis/js-apis-window.md b/en/application-dev/reference/apis/js-apis-window.md index 26fd78b642da4a588bec3a06e12a1b591681da62..d00c77b95c8870f0c97404a0e08d2ba3d449160b 100644 --- a/en/application-dev/reference/apis/js-apis-window.md +++ b/en/application-dev/reference/apis/js-apis-window.md @@ -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.
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.
You do not need to set this parameter to create a subwindow in the FA model
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_GESTURE9+ | 2 | Gesture area. | | TYPE_KEYBOARD9+ | 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**.| | isStatusBarLightIcon7+ | 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**.| | statusBarContentColor8+ | 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**.| | isNavigationBarLightIcon7+ | 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**.| | navigationBarContentColor8+ | 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. | ## SystemBarTintState8+ @@ -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')10+ + +on(type: 'gestureNavigationEnabledChange', callback: Callback<boolean>): 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<boolean> | 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')10+ + +off(type: 'gestureNavigationEnabledChange', callback?: Callback<boolean>): 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<boolean> | 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.setGestureNavigationEnabled10+ +setGestureNavigationEnabled(enable: boolean, callback: AsyncCallback<void>): 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<void> | 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.setGestureNavigationEnabled10+ +setGestureNavigationEnabled(enable: boolean): Promise<void> + +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<void> | 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(deprecated) create(id: string, type: WindowType, callback: AsyncCallback<Window>): void @@ -1910,7 +2050,9 @@ try { setWindowLayoutFullScreen(isLayoutFullScreen: boolean, callback: AsyncCallback<void>): 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<void> | Yes| Callback used to return the result.| **Error codes** @@ -1951,7 +2093,9 @@ try { setWindowLayoutFullScreen(isLayoutFullScreen: boolean): Promise<void> -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<void> | 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)); } - ``` ### setBackdropBlurStyle9+ @@ -4339,7 +4482,6 @@ try { } catch (exception) { console.error('Failed to set backdrop blur style. Cause: ' + JSON.stringify(exception)); } - ``` ### setShadow9+ @@ -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)); } - ``` ### setCornerRadius9+ @@ -4414,7 +4555,6 @@ try { } catch (exception) { console.error('Failed to set corner radius. Cause: ' + JSON.stringify(exception)); } - ``` ### raiseToAppTop10+ @@ -4454,7 +4594,6 @@ windowClass.raiseToAppTop((err) => { } console.info('Succeeded in raising the window to app top.'); }); - ``` ### raiseToAppTop10+ @@ -4493,9 +4632,7 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to raise the window to app top. Cause: ' + JSON.stringify(err)); }); - ``` - ### setAspectRatio10+ setAspectRatio(ratio: number): Promise<void> @@ -4541,7 +4678,6 @@ try { } catch (exception) { console.error('Failed to set the aspect ratio of window. Cause: ' + JSON.stringify(exception)); } - ``` ### setAspectRatio10+ @@ -4585,7 +4721,6 @@ try { } catch (exception) { console.error('Failed to set the aspect ratio of window. Cause: ' + JSON.stringify(exception)); } - ``` ### resetAspectRatio10+ @@ -4626,7 +4761,6 @@ try { } catch (exception) { console.error('Failed to reset the aspect ratio of window. Cause: ' + JSON.stringify(exception)); } - ``` ### resetAspectRatio10+ @@ -4668,7 +4802,6 @@ try { } catch (exception) { console.error('Failed to reset the aspect ratio of window. Cause: ' + JSON.stringify(exception)); } - ``` ### setWaterMarkFlag10+ @@ -4717,7 +4850,6 @@ try { } catch (exception) { console.error('Failed to set water mark flag of window. Cause: ' + JSON.stringify(exception)); } - ``` ### setWaterMarkFlag10+ @@ -4762,7 +4894,6 @@ try { } catch (exception) { console.error('Failed to set water mark flag of window. Cause: ' + JSON.stringify(exception)); } - ``` ### show(deprecated) @@ -4793,7 +4924,6 @@ windowClass.show((err) => { } console.info('Succeeded in showing the window.'); }); - ``` ### show(deprecated) @@ -4823,7 +4953,6 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to show the window. Cause: ' + JSON.stringify(err)); }); - ``` ### destroy(deprecated) @@ -4854,7 +4983,6 @@ windowClass.destroy((err) => { } console.info('Succeeded in destroying the window.'); }); - ``` ### destroy(deprecated) @@ -4884,7 +5012,6 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to destroy the window. Cause: ' + JSON.stringify(err)); }); - ``` ### moveTo(deprecated) @@ -4919,7 +5046,6 @@ windowClass.moveTo(300, 300, (err)=>{ } console.info('Succeeded in moving the window.'); }); - ``` ### moveTo(deprecated) @@ -4958,7 +5084,6 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to move the window. Cause: ' + JSON.stringify(err)); }); - ``` ### resetSize(deprecated) @@ -4999,7 +5124,6 @@ windowClass.resetSize(500, 1000, (err) => { } console.info('Succeeded in changing the window size.'); }); - ``` ### resetSize(deprecated) @@ -5044,7 +5168,6 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to change the window size. Cause: ' + JSON.stringify(err)); }); - ``` ### setWindowType(deprecated) @@ -5079,7 +5202,6 @@ windowClass.setWindowType(type, (err) => { } console.info('Succeeded in setting the window type.'); }); - ``` ### setWindowType(deprecated) @@ -5118,7 +5240,6 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to set the window type. Cause: ' + JSON.stringify(err)); }); - ``` ### getProperties(deprecated) @@ -5149,7 +5270,6 @@ windowClass.getProperties((err, data) => { } console.info('Succeeded in obtaining the window properties. Data: ' + JSON.stringify(data)); }); - ``` ### getProperties(deprecated) @@ -5179,7 +5299,6 @@ promise.then((data)=> { }).catch((err)=>{ console.error('Failed to obtain the window properties. Cause: ' + JSON.stringify(err)); }); - ``` ### getAvoidArea(deprecated) @@ -5212,7 +5331,6 @@ windowClass.getAvoidArea(type, (err, data) => { } console.info('Succeeded in obtaining the area. Data:' + JSON.stringify(data)); }); - ``` ### getAvoidArea(deprecated) @@ -5249,7 +5367,6 @@ promise.then((data)=> { }).catch((err)=>{ console.error('Failed to obtain the area. Cause:' + JSON.stringify(err)); }); - ``` ### setFullScreen(deprecated) @@ -5282,7 +5399,6 @@ windowClass.setFullScreen(isFullScreen, (err) => { } console.info('Succeeded in enabling the full-screen mode.'); }); - ``` ### setFullScreen(deprecated) @@ -5319,14 +5435,15 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to enable the full-screen mode. Cause: ' + JSON.stringify(err)); }); - ``` ### setLayoutFullScreen(deprecated) setLayoutFullScreen(isLayoutFullScreen: boolean, callback: AsyncCallback<void>): 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<void> | 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(deprecated) setLayoutFullScreen(isLayoutFullScreen: boolean): Promise<void> -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(deprecated) @@ -5423,7 +5540,6 @@ windowClass.setSystemBarEnable(names, (err) => { } console.info('Succeeded in setting the system bar to be invisible.'); }); - ``` ### setSystemBarEnable(deprecated) @@ -5461,7 +5577,6 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to set the system bar to be invisible. Cause:' + JSON.stringify(err)); }); - ``` ### setSystemBarProperties(deprecated) @@ -5500,7 +5615,6 @@ windowClass.setSystemBarProperties(SystemBarProperties, (err) => { } console.info('Succeeded in setting the system bar properties.'); }); - ``` ### setSystemBarProperties(deprecated) @@ -5543,7 +5657,6 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to set the system bar properties. Cause: ' + JSON.stringify(err)); }); - ``` ### loadContent(deprecated) @@ -5575,7 +5688,6 @@ windowClass.loadContent('pages/page2/page2', (err) => { } console.info('Succeeded in loading the content.'); }); - ``` ### loadContent(deprecated) @@ -5611,7 +5723,6 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to load the content. Cause: ' + JSON.stringify(err)); }); - ``` ### isShowing(deprecated) @@ -5642,7 +5753,6 @@ windowClass.isShowing((err, data) => { } console.info('Succeeded in checking whether the window is showing. Data: ' + JSON.stringify(data)); }); - ``` ### isShowing(deprecated) @@ -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')(deprecated) @@ -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')(deprecated) @@ -5726,7 +5834,6 @@ Disables listening for changes to the area where the window cannot be displayed. ```js windowClass.off('systemAvoidAreaChange'); - ``` ### isSupportWideGamut(deprecated) @@ -5757,7 +5864,6 @@ windowClass.isSupportWideGamut((err, data) => { } console.info('Succeeded in checking whether the window support WideGamut Data: ' + JSON.stringify(data)); }); - ``` ### isSupportWideGamut(deprecated) @@ -5787,7 +5893,6 @@ promise.then((data)=> { }).catch((err)=>{ console.error('Failed to check whether the window support WideGamut. Cause: ' + JSON.stringify(err)); }); - ``` ### setColorSpace(deprecated) @@ -5819,7 +5924,6 @@ windowClass.setColorSpace(window.ColorSpace.WIDE_GAMUT, (err) => { } console.info('Succeeded in setting window colorspace.'); }); - ``` ### setColorSpace(deprecated) @@ -5855,7 +5959,6 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to set window colorspace. Cause: ' + JSON.stringify(err)); }); - ``` ### getColorSpace(deprecated) @@ -5886,7 +5989,6 @@ windowClass.getColorSpace((err, data) => { } console.info('Succeeded in getting window colorspace. Cause:' + JSON.stringify(data)); }); - ``` ### getColorSpace(deprecated) @@ -5916,7 +6018,6 @@ promise.then((data)=> { }).catch((err)=>{ console.error('Failed to get window colorspace. Cause: ' + JSON.stringify(err)); }); - ``` ### setBackgroundColor(deprecated) @@ -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<void> | 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(deprecated) @@ -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(deprecated) @@ -6019,7 +6118,6 @@ windowClass.setBrightness(brightness, (err) => { } console.info('Succeeded in setting the brightness.'); }); - ``` ### setBrightness(deprecated) @@ -6056,7 +6154,6 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to set the brightness. Cause: ' + JSON.stringify(err)); }); - ``` ### setDimBehind(deprecated) @@ -6088,7 +6185,6 @@ windowClass.setDimBehind(0.5, (err) => { } console.info('Succeeded in setting the dimness.'); }); - ``` ### setDimBehind(deprecated) @@ -6124,7 +6220,6 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to set the dimness. Cause: ' + JSON.stringify(err)); }); - ``` ### setFocusable(deprecated) @@ -6157,7 +6252,6 @@ windowClass.setFocusable(isFocusable, (err) => { } console.info('Succeeded in setting the window to be focusable.'); }); - ``` ### setFocusable(deprecated) @@ -6194,7 +6288,6 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to set the window to be focusable. Cause: ' + JSON.stringify(err)); }); - ``` ### setKeepScreenOn(deprecated) @@ -6227,7 +6320,6 @@ windowClass.setKeepScreenOn(isKeepScreenOn, (err) => { } console.info('Succeeded in setting the screen to be always on.'); }); - ``` ### setKeepScreenOn(deprecated) @@ -6264,7 +6356,6 @@ promise.then(() => { }).catch((err)=>{ console.info('Failed to set the screen to be always on. Cause: ' + JSON.stringify(err)); }); - ``` ### setOutsideTouchable(deprecated) @@ -6296,7 +6387,6 @@ windowClass.setOutsideTouchable(true, (err) => { } console.info('Succeeded in setting the area to be touchable.'); }); - ``` ### setOutsideTouchable(deprecated) @@ -6332,7 +6422,6 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to set the area to be touchable. Cause: ' + JSON.stringify(err)); }); - ``` ### setPrivacyMode(deprecated) @@ -6365,7 +6454,6 @@ windowClass.setPrivacyMode(isPrivacyMode, (err) => { } console.info('Succeeded in setting the window to privacy mode.'); }); - ``` ### setPrivacyMode(deprecated) @@ -6402,7 +6490,6 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to set the window to privacy mode. Cause: ' + JSON.stringify(err)); }); - ``` ### setTouchable(deprecated) @@ -6435,7 +6522,6 @@ windowClass.setTouchable(isTouchable, (err) => { } console.info('Succeeded in setting the window to be touchable.'); }); - ``` ### setTouchable(deprecated) @@ -6472,7 +6558,6 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to set the window to be touchable. Cause: ' + JSON.stringify(err)); }); - ``` ## WindowStageEventType9+ @@ -6542,7 +6627,6 @@ export default class EntryAbility extends UIAbility { }); } }; - ``` ### getMainWindow9+ @@ -6590,7 +6674,6 @@ export default class EntryAbility extends UIAbility { }); } }; - ``` ### getMainWindowSync9+ @@ -6635,7 +6718,6 @@ export default class EntryAbility extends UIAbility { }; } }; - ``` ### createSubWindow9+ @@ -6690,9 +6772,7 @@ export default class EntryAbility extends UIAbility { }; } }; - ``` - ### createSubWindow9+ createSubWindow(name: string): Promise<Window> @@ -6748,7 +6828,6 @@ export default class EntryAbility extends UIAbility { }; } }; - ``` ### getSubWindow9+ @@ -6796,9 +6875,7 @@ export default class EntryAbility extends UIAbility { }); } }; - ``` - ### getSubWindow9+ getSubWindow(): Promise<Array<Window>> @@ -6843,9 +6920,7 @@ export default class EntryAbility extends UIAbility { }) } }; - ``` - ### loadContent9+ loadContent(path: string, storage: LocalStorage, callback: AsyncCallback<void>): 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<void> | 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<void> | Yes | Callback used to return the result. | **Error codes** @@ -6899,7 +6974,6 @@ export default class EntryAbility extends UIAbility { }; } }; - ``` ### loadContent9+ @@ -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 { }; } }; - ``` ### loadContent9+ @@ -7011,7 +7084,6 @@ export default class EntryAbility extends UIAbility { }; } }; - ``` ### on('windowStageEvent')9+ @@ -7061,7 +7133,6 @@ export default class EntryAbility extends UIAbility { }; } }; - ``` ### off('windowStageEvent')9+ @@ -7108,7 +7179,6 @@ export default class EntryAbility extends UIAbility { }; } }; - ``` ### disableWindowDecor()9+ @@ -7145,7 +7215,6 @@ export default class EntryAbility extends UIAbility { windowStage.disableWindowDecor(); } }; - ``` ### setShowOnLockScreen()9+ @@ -7192,9 +7261,7 @@ export default class EntryAbility extends UIAbility { }; } }; - ``` - ## TransitionContext9+ Provides the context for the transition animation. @@ -7255,7 +7322,6 @@ controller.animationForShown = (context : window.TransitionContext) => { } console.info('complete transition end'); }; - ``` ## TransitionController9+ @@ -7306,7 +7372,6 @@ controller.animationForShown = (context : window.TransitionContext) => { ); console.info('complete transition end'); }; - ``` ### animationForHidden9+ @@ -7353,4 +7418,6 @@ controller.animationForHidden = (context : window.TransitionContext) => { ) console.info('complete transition end'); }; -``` \ No newline at end of file +``` + + \ No newline at end of file