From b928786f85a353f218f0329621b0f44ec5254991 Mon Sep 17 00:00:00 2001 From: Gloria Date: Mon, 5 Dec 2022 17:18:18 +0800 Subject: [PATCH] Update docs against 11213+10885+11375+11555+11699+11754+11874 Signed-off-by: wusongqing --- .../reference/apis/js-apis-window.md | 530 ++++++++++-------- .../windowmanager/application-window-stage.md | 110 ++-- .../windowmanager/system-window-stage.md | 20 +- .../windowmanager/window-overview.md | 6 +- 4 files changed, 372 insertions(+), 294 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-window.md b/en/application-dev/reference/apis/js-apis-window.md index 24176d5c97..9d60fe2118 100644 --- a/en/application-dev/reference/apis/js-apis-window.md +++ b/en/application-dev/reference/apis/js-apis-window.md @@ -56,7 +56,7 @@ An asynchronous callback is used when a system window is created in the case tha | ---------- | -------------------------- | -- | ----------------------------------- | | name | string | Yes| Name of the subwindow. | | windowType | [WindowType](#windowtype7) | Yes| Type of the subwindow. | -| ctx | BaseContext | No| Current application context.
For details about the context in the FA model, see [Context](js-apis-Context.md).
For details about the context in the stage model, see [Context](js-apis-service-extension-context.md).
If this parameter is not set, no context is used. | +| ctx | BaseContext | No| Current application context.
For details about the context in the FA model, see [Context](js-apis-Context.md).
For details about the context in the stage model, see [Context](js-apis-service-extension-context.md).
If this parameter is not set, no context is used. | | 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. | @@ -108,14 +108,14 @@ Describes the properties of the status bar and navigation bar. **System capability**: SystemCapability.WindowManager.WindowManager.Core -| Name | Type| Readable| Writable| Mandatory| Description | -| -------------------------------------- | -------- | ---- | ---- | ---- | ------------------------------------------------------------ | -| statusBarColor | string | No | Yes | 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**.| -| isStatusBarLightIcon7+ | boolean | No | Yes | 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 | Yes | 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 | Yes | 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**.| -| isNavigationBarLightIcon7+ | boolean | No | Yes | 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 | Yes | 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**.| +| 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**.| +| 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**.| +| 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**.| ## Orientation9+ @@ -248,7 +248,7 @@ Enumerates the color spaces. **System capability**: SystemCapability.WindowManager.WindowManager.Core -| Name | Default Value | Description | +| Name | Value| Description | | ---------- | ------ | -------------- | | DEFAULT | 0 | Default gamut.| | WIDE_GAMUT | 1 | Wide-gamut. | @@ -319,7 +319,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc | ID| Error Message| | ------- | -------------------------------- | -| 1300001 | Repeated operation. | +| 1300001 | Repeated operation. | | 1300006 | This window context is abnormal. | **Example** @@ -339,7 +339,7 @@ try { }); } catch (exception) { console.error('Failed to create the window. Cause: ' + JSON.stringify(exception)); -}; +} ``` ## window.createWindow9+ @@ -368,7 +368,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc | ID| Error Message| | ------- | -------------------------------- | -| 1300001 | Repeated operation. | +| 1300001 | Repeated operation. | | 1300006 | This window context is abnormal. | **Example** @@ -386,7 +386,7 @@ try { }); } catch (exception) { console.error('Failed to create the window. Cause: ' + JSON.stringify(exception)); -}; +} ``` ## window.findWindow9+ @@ -412,11 +412,12 @@ Finds a window based on the ID. **Example** ```js +let windowClass = null; try { - let windowClass = window.findWindow('alertWindow'); + windowClass = window.findWindow('alertWindow'); } catch (exception) { console.error('Failed to find the Window. Cause: ' + JSON.stringify(exception)); -}; +} ``` ## window.getLastWindow9+ @@ -458,7 +459,7 @@ try { }); } catch (exception) { console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(exception)); -}; +} ``` ## window.getLastWindow9+ @@ -504,7 +505,7 @@ try { }); } catch (exception) { console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(exception)); -}; +} ``` ## window.minimizeAll9+ @@ -535,26 +536,25 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ```js import display from '@ohos.display' -import window from '@ohos.window' +let displayClass = null; try { displayClass = display.getDefaultDisplaySync(); -} catch (exception) { - console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception)); - return; -}; -try { - window.minimizeAll(displayClass.id, (err) => { - if(err.code) { - console.error('Failed to minimize all windows. Cause: ' + JSON.stringify(err)); - return; - } - console.info('Succeeded in minimizing all windows.'); - }); + try { + window.minimizeAll(displayClass.id, (err) => { + if(err.code) { + console.error('Failed to minimize all windows. Cause: ' + JSON.stringify(err)); + return; + } + console.info('Succeeded in minimizing all windows.'); + }); + } catch (exception) { + console.error('Failed to minimize all windows. Cause: ' + JSON.stringify(exception)); + } } catch (exception) { - console.error('Failed to minimize all windows. Cause: ' + JSON.stringify(exception)); -}; + console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception)); +} ``` ## window.minimizeAll9+ @@ -590,26 +590,24 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ```js import display from '@ohos.display' -import window from '@ohos.window' let displayClass = null; try { displayClass = display.getDefaultDisplaySync(); -} catch (exception) { - console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception)); - return; -}; -try { - let promise = window.minimizeAll(displayClass.id); - promise.then(()=> { - console.info('Succeeded in minimizing all windows.'); - }).catch((err)=>{ - console.error('Failed to minimize all windows. Cause: ' + JSON.stringify(err)); - }); + try { + let promise = window.minimizeAll(displayClass.id); + promise.then(()=> { + console.info('Succeeded in minimizing all windows.'); + }).catch((err)=>{ + console.error('Failed to minimize all windows. Cause: ' + JSON.stringify(err)); + }); + } catch (exception) { + console.error('Failed to minimize all windows. Cause: ' + JSON.stringify(exception)); + } } catch (exception) { - console.error('Failed to minimize all windows. Cause: ' + JSON.stringify(exception)); -}; + console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception)); +} ``` ## window.toggleShownStateForAllAppWindows9+ @@ -644,7 +642,7 @@ window.toggleShownStateForAllAppWindows((err) => { return; } console.info('Succeeded in toggling shown state for all app windows.'); -}) +}); ``` ## window.toggleShownStateForAllAppWindows9+ @@ -678,7 +676,7 @@ promise.then(()=> { console.info('Succeeded in toggling shown state for all app windows.'); }).catch((err)=>{ console.error('Failed to toggle shown state for all app windows. Cause: ' + JSON.stringify(err)); -}) +}); ``` ## window.setWindowLayoutMode9+ @@ -718,7 +716,7 @@ try { }); } catch (exception) { console.error('Failed to set window layout mode. Cause: ' + JSON.stringify(exception)); -}; +} ``` ## window.setWindowLayoutMode9+ @@ -762,7 +760,7 @@ try { }); } catch (exception) { console.error('Failed to set window layout mode. Cause: ' + JSON.stringify(exception)); -}; +} ``` ## window.on('systemBarTintChange')8+ @@ -777,10 +775,10 @@ Enables listening for properties changes of the status bar and navigation bar. **Parameters** -| 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.| -| callback | Callback<[SystemBarTintState](#systembartintstate)> | Yes | Callback used to return the properties of the status bar and navigation bar. | +| 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.| +| callback | Callback<[SystemBarTintState](#systembartintstate8)> | Yes | Callback used to return the properties of the status bar and navigation bar. | **Example** @@ -791,7 +789,7 @@ try { }); } catch (exception) { console.error('Failed to enable the listener for systemBarTint changes. Cause: ' + JSON.stringify(exception)); -}; +} ``` ## window.off('systemBarTintChange')8+ @@ -806,10 +804,10 @@ Disables listening for properties changes of the status bar and navigation bar. **Parameters** -| 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.| -| callback | Callback<[SystemBarTintState](#systembartintstate)> | No | Callback used to return the properties of the status bar and navigation bar. | +| 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.| +| callback | Callback<[SystemBarTintState](#systembartintstate8)> | No | Callback used to return the properties of the status bar and navigation bar. | **Example** @@ -818,7 +816,7 @@ try { window.off('systemBarTintChange'); } catch (exception) { console.error('Failed to disable the listener for systemBarTint changes. Cause: ' + JSON.stringify(exception)); -}; +} ``` ## window.create(deprecated) @@ -901,9 +899,7 @@ promise.then((data)=> { create(ctx: BaseContext, id: string, type: WindowType, callback: AsyncCallback<Window>): void -Creates a subwindow in the FA model - -or a system window in the stage model. This API uses an asynchronous callback to return the result. +Creates a subwindow in the FA model or a system window in the stage model. This API uses an asynchronous callback to return the result. > **NOTE** > @@ -939,9 +935,7 @@ window.create(this.context, 'alertWindow', window.WindowType.TYPE_SYSTEM_ALERT, create(ctx: BaseContext, id: string, type: WindowType): Promise<Window> -Creates a subwindow in the FA model - -or a system window in the stage model. This API uses a promise to return the result. +Creates a subwindow in the FA model or a system window in the stage model. This API uses a promise to return the result. > **NOTE** > @@ -1110,7 +1104,7 @@ promise.then((data)=> { console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); }).catch((err)=>{ console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(err)); -}) +}); ``` ## window.getTopWindow(deprecated) @@ -1180,7 +1174,7 @@ promise.then((data)=> { console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); }).catch((err)=>{ console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(err)); -}) +}); ``` ## Window @@ -1221,8 +1215,8 @@ windowClass.hide((err) => { console.error('Failed to hide the window. Cause: ' + JSON.stringify(err)); return; } - console.info('Succeeded in hiding the window. data: ' + JSON.stringify(data)); -}) + console.info('Succeeded in hiding the window.'); +}); ``` ### hide7+ @@ -1257,7 +1251,7 @@ promise.then(()=> { console.info('Succeeded in hiding the window.'); }).catch((err)=>{ console.error('Failed to hide the window. Cause: ' + JSON.stringify(err)); -}) +}); ``` ### hideWithAnimation9+ @@ -1295,7 +1289,7 @@ windowClass.hideWithAnimation((err) => { return; } console.info('Succeeded in hiding the window with animation.'); -}) +}); ``` ### hideWithAnimation9+ @@ -1329,10 +1323,10 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ```js let promise = windowClass.hideWithAnimation(); promise.then(()=> { - console.info('Succeeded in hiding the window with animation. Data: ' + JSON.stringify(data)); + console.info('Succeeded in hiding the window with animation.'); }).catch((err)=>{ console.error('Failed to hide the window with animation. Cause: ' + JSON.stringify(err)); -}) +}); ``` ### showWindow9+ @@ -1437,7 +1431,7 @@ windowClass.showWithAnimation((err) => { return; } console.info('Succeeded in showing the window with animation.'); -}) +}); ``` ### showWithAnimation9+ @@ -1474,7 +1468,7 @@ promise.then(()=> { console.info('Succeeded in showing the window with animation.'); }).catch((err)=>{ console.error('Failed to show the window with animation. Cause: ' + JSON.stringify(err)); -}) +}); ``` ### destroyWindow9+ @@ -1509,7 +1503,7 @@ windowClass.destroyWindow((err) => { return; } console.info('Succeeded in destroying the window.'); -}) +}); ``` ### destroyWindow9+ @@ -1543,7 +1537,7 @@ promise.then(()=> { console.info('Succeeded in destroying the window.'); }).catch((err)=>{ console.error('Failed to destroy the window. Cause: ' + JSON.stringify(err)); -}) +}); ``` ### moveWindowTo9+ @@ -1584,7 +1578,7 @@ try { }); } catch (exception) { console.error('Failed to move the window. Cause:' + JSON.stringify(exception)); -}; +} ``` ### moveWindowTo9+ @@ -1629,7 +1623,7 @@ try { }); } catch (exception) { console.error('Failed to move the window. Cause:' + JSON.stringify(exception)); -}; +} ``` ### resize9+ @@ -1638,6 +1632,12 @@ resize(width: number, height: number, callback: AsyncCallback<void>): void 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. + +The new width and height you set must meet the limits. + **System capability**: SystemCapability.WindowManager.WindowManager.Core **Parameters** @@ -1670,7 +1670,7 @@ try { }); } catch (exception) { console.error('Failed to change the window size. Cause:' + JSON.stringify(exception)); -}; +} ``` ### resize9+ @@ -1679,6 +1679,12 @@ resize(width: number, height: number): Promise<void> 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. + +The new width and height you set must meet the limits. + **System capability**: SystemCapability.WindowManager.WindowManager.Core **Parameters** @@ -1715,7 +1721,7 @@ try { }); } catch (exception) { console.error('Failed to change the window size. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### setWindowMode9+ @@ -1758,7 +1764,7 @@ try { }); } catch (exception) { console.error('Failed to set the window mode. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### setWindowMode9+ @@ -1797,7 +1803,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ```js let mode = window.WindowMode.FULLSCREEN; try { - let promise = windowClass.setWindowMode(type); + let promise = windowClass.setWindowMode(mode); promise.then(()=> { console.info('Succeeded in setting the window mode.'); }).catch((err)=>{ @@ -1805,7 +1811,7 @@ try { }); } catch (exception) { console.error('Failed to set the window mode. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### getWindowProperties9+ @@ -1837,7 +1843,7 @@ try { let properties = windowClass.getWindowProperties(); } catch (exception) { console.error('Failed to obtain the window properties. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### getWindowAvoidArea9+ @@ -1876,7 +1882,7 @@ try { let avoidArea = windowClass.getWindowAvoidArea(type); } catch (exception) { console.error('Failed to obtain the area. Cause:' + JSON.stringify(exception)); -}; +} ``` ### setWindowLayoutFullScreen9+ @@ -1917,7 +1923,7 @@ try { }); } catch (exception) { console.error('Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(exception)); -}; +} ``` ### setWindowLayoutFullScreen9+ @@ -1962,7 +1968,7 @@ try { }); } catch (exception) { console.error('Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(exception)); -}; +} ``` ### setWindowSystemBarEnable9+ @@ -1976,8 +1982,8 @@ Sets whether to display the status bar and navigation bar in this window. This A **Parameters** | Name| Type| Mandatory| Description| -| -------- | ------------------------- | -- | --------- | -| names | Array | Yes| Whether to display the status bar and navigation bar.
For example, to display the status bar and navigation bar, set this parameter to **['status', 'navigation']**. By default, they are not displayed.| +| -------- | ---------------------------- | -- | --------- | +| names | Array<'status'\|'navigation'> | Yes | Whether to display the status bar and navigation bar.
For example, to display the status bar and navigation bar, set this parameter to **['status', 'navigation']**. By default, they are not displayed.| | callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Error codes** @@ -2004,7 +2010,7 @@ try { }); } catch (exception) { console.error('Failed to set the system bar to be invisible. Cause:' + JSON.stringify(exception)); -}; +} ``` ### setWindowSystemBarEnable9+ @@ -2018,8 +2024,8 @@ Sets whether to display the status bar and navigation bar in this window. This A **Parameters** | Name| Type | Mandatory| Description| -| ----- | ----- | -- | ------------------------------------------------------------------------------------------------------------ | -| names | Array | Yes| Whether to display the status bar and navigation bar.
For example, to display the status bar and navigation bar, set this parameter to **['status', 'navigation']**. By default, they are not displayed.| +| ----- | ---------------------------- | -- | --------------------------------- | +| names | Array<'status'\|'navigation'> | Yes| Whether to display the status bar and navigation bar.
For example, to display the status bar and navigation bar, set this parameter to **['status', 'navigation']**. By default, they are not displayed.| **Return value** @@ -2050,7 +2056,7 @@ try { }); } catch (exception) { console.error('Failed to set the system bar to be invisible. Cause:' + JSON.stringify(exception)); -}; +} ``` ### setWindowSystemBarProperties9+ @@ -2080,7 +2086,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```js -let SystemBarProperties={ +let SystemBarProperties = { statusBarColor: '#ff00ff', navigationBarColor: '#00ff00', // The following properties are supported since API version 8. @@ -2097,7 +2103,7 @@ try { }); } catch (exception) { console.error('Failed to set the system bar properties. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### setWindowSystemBarProperties9+ @@ -2132,7 +2138,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```js -let SystemBarProperties={ +let SystemBarProperties = { statusBarColor: '#ff00ff', navigationBarColor: '#00ff00', // The following properties are supported since API version 8. @@ -2148,7 +2154,7 @@ try { }); } catch (exception) { console.error('Failed to set the system bar properties. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### setPreferredOrientation9+ @@ -2188,7 +2194,7 @@ try { }); } catch (exception) { console.error('Failed to set window orientation. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### setPreferredOrientation9+ @@ -2232,7 +2238,7 @@ try { }); } catch (exception) { console.error('Failed to set window orientation. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### setUIContent9+ @@ -2272,7 +2278,7 @@ try { }); } catch (exception) { console.error('Failed to load the content. Cause:' + JSON.stringify(exception)); -}; +} ``` ### setUIContent9+ @@ -2316,7 +2322,7 @@ try { }); } catch (exception) { console.error('Failed to load the content. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### loadContent9+ @@ -2334,7 +2340,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 | Yes | A storage unit, which provides storage for variable state properties and non-variable state properties of an application.| +| 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. | **Error codes** @@ -2362,7 +2368,7 @@ try { }); } catch (exception) { console.error('Failed to load the content. Cause:' + JSON.stringify(exception)); -}; +} ``` ### loadContent9+ @@ -2380,7 +2386,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 | Yes | A storage unit, which provides storage for variable state properties and non-variable state properties of an application.| +| 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.| **Return value** @@ -2412,7 +2418,7 @@ try { }); } catch (exception) { console.error('Failed to load the content. Cause:' + JSON.stringify(exception)); -}; +} ``` ### isWindowShowing9+ @@ -2445,7 +2451,7 @@ try { console.info('Succeeded in checking whether the window is showing. Data: ' + JSON.stringify(data)); } catch (exception) { console.error('Failed to check whether the window is showing. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### on('windowSizeChange')7+ @@ -2472,7 +2478,7 @@ try { }); } catch (exception) { console.error('Failed to enable the listener for window size changes. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### off('windowSizeChange')7+ @@ -2497,7 +2503,7 @@ try { windowClass.off('windowSizeChange'); } catch (exception) { console.error('Failed to disable the listener for window size changes. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### on('avoidAreaChange')9+ @@ -2525,7 +2531,7 @@ try { }); } catch (exception) { console.error('Failed to enable the listener for system avoid area changes. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### off('avoidAreaChange')9+ @@ -2550,7 +2556,7 @@ try { windowClass.off('avoidAreaChange'); } catch (exception) { console.error('Failed to disable the listener for system avoid area changes. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### on('keyboardHeightChange')7+ @@ -2577,7 +2583,7 @@ try { }); } catch (exception) { console.error('Failed to enable the listener for keyboard height changes. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### off('keyboardHeightChange')7+ @@ -2602,7 +2608,7 @@ try { windowClass.off('keyboardHeightChange'); } catch (exception) { console.error('Failed to disable the listener for keyboard height changes. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### on('touchOutside')9+ @@ -2631,7 +2637,7 @@ try { }); } catch (exception) { console.error('Failed to register callback. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### off('touchOutside')9+ @@ -2658,7 +2664,7 @@ try { windowClass.off('touchOutside'); } catch (exception) { console.error('Failed to unregister callback. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### on('screenshot')9+ @@ -2685,7 +2691,7 @@ try { }); } catch (exception) { console.error('Failed to register callback. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### off('screenshot')9+ @@ -2706,21 +2712,21 @@ Unsubscribes from screenshot events. **Example** ```js -let callback = ()=>{ +let callback = () => { console.info('screenshot happened'); }; try { windowClass.on('screenshot', callback); } catch (exception) { console.error('Failed to register callback. Cause: ' + JSON.stringify(exception)); -}; +} try { windowClass.off('screenshot', callback); // If multiple callbacks are enabled in on(), they will all be disabled. windowClass.off('screenshot'); } catch (exception) { console.error('Failed to unregister callback. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### on('dialogTargetTouch')9+ @@ -2747,7 +2753,7 @@ try { }); } catch (exception) { console.error('Failed to register callback. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### off('dialogTargetTouch')9+ @@ -2772,7 +2778,7 @@ try { windowClass.off('dialogTargetTouch'); } catch (exception) { console.error('Failed to unregister callback. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### bindDialogTarget9+ @@ -2805,6 +2811,8 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```js +import rpc from '@ohos.rpc'; + class MyDeathRecipient { onRemoteDied() { console.log('server died'); @@ -2824,6 +2832,7 @@ class TestRemoteObject extends rpc.RemoteObject { return false; } } + let token = new TestRemoteObject('testObject'); try { windowClass.bindDialogTarget(token, () => { @@ -2837,7 +2846,7 @@ try { }); } catch (exception) { console.error('Failed to bind dialog target. Cause:' + JSON.stringify(exception)); -}; +} ``` ### bindDialogTarget9+ @@ -2875,6 +2884,8 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```js +import rpc from '@ohos.rpc'; + class MyDeathRecipient { onRemoteDied() { console.log('server died'); @@ -2894,6 +2905,7 @@ class TestRemoteObject extends rpc.RemoteObject { return false; } } + let token = new TestRemoteObject('testObject'); try { let promise = windowClass.bindDialogTarget(token, () => { @@ -2906,7 +2918,7 @@ try { }); } catch (exception) { console.error('Failed to bind dialog target. Cause:' + JSON.stringify(exception)); -}; +} ``` ### isWindowSupportWideGamut9+ @@ -3012,7 +3024,7 @@ try { }); } catch (exception) { console.error('Failed to set window colorspace. Cause:' + JSON.stringify(exception)); -}; +} ``` ### setWindowColorSpace9+ @@ -3055,7 +3067,7 @@ try { }); } catch (exception) { console.error('Failed to set window colorspace. Cause:' + JSON.stringify(exception)); -}; +} ``` ### getWindowColorSpace9+ @@ -3116,7 +3128,7 @@ try { windowClass.setWindowBackgroundColor(color); } catch (exception) { console.error('Failed to set the background color. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### setWindowBrightness9+ @@ -3157,7 +3169,7 @@ try { }); } catch (exception) { console.error('Failed to set the brightness. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### setWindowBrightness9+ @@ -3202,7 +3214,7 @@ try { }); } catch (exception) { console.error('Failed to set the brightness. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### setWindowFocusable9+ @@ -3232,7 +3244,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```js -let isFocusable= true; +let isFocusable = true; try { windowClass.setWindowFocusable(isFocusable, (err) => { if (err.code) { @@ -3243,7 +3255,7 @@ try { }); } catch (exception) { console.error('Failed to set the window to be focusable. Cause:' + JSON.stringify(exception)); -}; +} ``` ### setWindowFocusable9+ @@ -3278,7 +3290,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```js -let isFocusable= true; +let isFocusable = true; try { let promise = windowClass.setWindowFocusable(isFocusable); promise.then(()=> { @@ -3288,7 +3300,7 @@ try { }); } catch (exception) { console.error('Failed to set the window to be focusable. Cause:' + JSON.stringify(exception)); -}; +} ``` ### setWindowKeepScreenOn9+ @@ -3329,7 +3341,7 @@ try { }); } catch (exception) { console.error('Failed to set the screen to be always on. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### setWindowKeepScreenOn9+ @@ -3374,7 +3386,7 @@ try { }); } catch (exception) { console.error('Failed to set the screen to be always on. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### setWakeUpScreen()9+ @@ -3410,7 +3422,7 @@ try { windowClass.setWakeUpScreen(wakeUp); } catch (exception) { console.error('Failed to wake up the screen. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### setWindowPrivacyMode9+ @@ -3452,7 +3464,7 @@ try { }); } catch (exception) { console.error('Failed to set the window to privacy mode. Cause:' + JSON.stringify(exception)); -}; +} ``` ### setWindowPrivacyMode9+ @@ -3498,7 +3510,7 @@ try { }); } catch (exception) { console.error('Failed to set the window to privacy mode. Cause:' + JSON.stringify(exception)); -}; +} ``` ### setSnapshotSkip9+ @@ -3571,7 +3583,7 @@ try { }); } catch (exception) { console.error('Failed to set the window to be touchable. Cause:' + JSON.stringify(exception)); -}; +} ``` ### setWindowTouchable9+ @@ -3616,7 +3628,7 @@ try { }); } catch (exception) { console.error('Failed to set the window to be touchable. Cause:' + JSON.stringify(exception)); -}; +} ``` ### setForbidSplitMove9+ @@ -3659,7 +3671,7 @@ try { }); } catch (exception) { console.error('Failed to forbid window moving in split screen mode. Cause:' + JSON.stringify(exception)); -}; +} ``` ### setForbidSplitMove9+ @@ -3706,7 +3718,7 @@ try { }); } catch (exception) { console.error('Failed to forbid window moving in split screen mode. Cause:' + JSON.stringify(exception)); -}; +} ``` ### snapshot9+ @@ -3801,7 +3813,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc | ID | Error Message | | ------- | ------------------------------ | | 1300002 | This window state is abnormal. | -| 1300004 | Unauthorized operation. | +| 1300004 | Unauthorized operation. | **Example** @@ -3810,7 +3822,7 @@ try { windowClass.opacity(0.5); } catch (exception) { console.error('Failed to opacity. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### scale9+ @@ -3836,7 +3848,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc | ID | Error Message | | ------- | ------------------------------ | | 1300002 | This window state is abnormal. | -| 1300004 | Unauthorized operation. | +| 1300004 | Unauthorized operation. | **Example** @@ -3851,7 +3863,7 @@ try { windowClass.scale(obj); } catch (exception) { console.error('Failed to scale. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### rotate9+ @@ -3877,7 +3889,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc | ID | Error Message | | ------- | ------------------------------ | | 1300002 | This window state is abnormal. | -| 1300004 | Unauthorized operation. | +| 1300004 | Unauthorized operation. | **Example** @@ -3893,7 +3905,7 @@ try { windowClass.rotate(obj); } catch (exception) { console.error('Failed to rotate. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### translate9+ @@ -3919,7 +3931,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc | ID | Error Message | | ------- | ------------------------------ | | 1300002 | This window state is abnormal. | -| 1300004 | Unauthorized operation. | +| 1300004 | Unauthorized operation. | **Example** @@ -3933,7 +3945,7 @@ try { windowClass.translate(obj); } catch (exception) { console.error('Failed to translate. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### getTransitionController9+ @@ -3959,7 +3971,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc | ID | Error Message | | ------- | ------------------------------ | | 1300002 | This window state is abnormal. | -| 1300004 | Unauthorized operation. | +| 1300004 | Unauthorized operation. | **Example** @@ -3986,16 +3998,16 @@ controller.animationForHidden = (context : window.TransitionContext) => { toWindow.translate(obj); // Set the transition animation. console.info('toWindow translate end'); } - ) + ); console.info('complete transition end'); -} +}; windowClass.hideWithAnimation((err, data) => { if (err.code) { console.error('Failed to show the window with animation. Cause: ' + JSON.stringify(err)); return; } console.info('Succeeded in showing the window with animation. Data: ' + JSON.stringify(data)); -}) +}); ``` ### setBlur9+ @@ -4021,7 +4033,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc | ID | Error Message | | ------- | ------------------------------ | | 1300002 | This window state is abnormal. | -| 1300004 | Unauthorized operation. | +| 1300004 | Unauthorized operation. | **Example** @@ -4030,7 +4042,7 @@ try { windowClass.setBlur(4.0); } catch (exception) { console.error('Failed to set blur. Cause: ' + JSON.stringify(exception)); -}; +} ``` ### setBackdropBlur9+ @@ -4056,7 +4068,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc | ID | Error Message | | ------- | ------------------------------ | | 1300002 | This window state is abnormal. | -| 1300004 | Unauthorized operation. | +| 1300004 | Unauthorized operation. | **Example** @@ -4065,7 +4077,8 @@ try { windowClass.setBackdropBlur(4.0); } catch (exception) { console.error('Failed to set backdrop blur. Cause: ' + JSON.stringify(exception)); -}; +} + ``` ### setBackdropBlurStyle9+ @@ -4091,7 +4104,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc | ID | Error Message | | ------- | ------------------------------ | | 1300002 | This window state is abnormal. | -| 1300004 | Unauthorized operation. | +| 1300004 | Unauthorized operation. | **Example** @@ -4100,7 +4113,8 @@ try { windowClass.setBackdropBlurStyle(window.BlurStyle.THIN); } catch (exception) { console.error('Failed to set backdrop blur style. Cause: ' + JSON.stringify(exception)); -}; +} + ``` ### setShadow9+ @@ -4129,7 +4143,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc | ID | Error Message | | ------- | ------------------------------ | | 1300002 | This window state is abnormal. | -| 1300004 | Unauthorized operation. | +| 1300004 | Unauthorized operation. | **Example** @@ -4138,7 +4152,8 @@ try { windowClass.setShadow(4.0, '#FF00FF00', 2, 3); } catch (exception) { console.error('Failed to set shadow. Cause: ' + JSON.stringify(exception)); -}; +} + ``` ### setCornerRadius9+ @@ -4164,7 +4179,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc | ID | Error Message | | ------- | ------------------------------ | | 1300002 | This window state is abnormal. | -| 1300004 | Unauthorized operation. | +| 1300004 | Unauthorized operation. | **Example** @@ -4173,7 +4188,8 @@ try { windowClass.setCornerRadius(4.0); } catch (exception) { console.error('Failed to set corner radius. Cause: ' + JSON.stringify(exception)); -}; +} + ``` ### show(deprecated) @@ -4203,7 +4219,8 @@ windowClass.show((err) => { return; } console.info('Succeeded in showing the window.'); -}) +}); + ``` ### show(deprecated) @@ -4232,7 +4249,8 @@ promise.then(()=> { console.info('Succeeded in showing the window.'); }).catch((err)=>{ console.error('Failed to show the window. Cause: ' + JSON.stringify(err)); -}) +}); + ``` ### destroy(deprecated) @@ -4262,7 +4280,8 @@ windowClass.destroy((err) => { return; } console.info('Succeeded in destroying the window.'); -}) +}); + ``` ### destroy(deprecated) @@ -4291,7 +4310,8 @@ promise.then(()=> { console.info('Succeeded in destroying the window.'); }).catch((err)=>{ console.error('Failed to destroy the window. Cause: ' + JSON.stringify(err)); -}) +}); + ``` ### moveTo(deprecated) @@ -4323,8 +4343,8 @@ windowClass.moveTo(300, 300, (err)=>{ return; } console.info('Succeeded in moving the window.'); - }); + ``` ### moveTo(deprecated) @@ -4360,7 +4380,8 @@ promise.then(()=> { console.info('Succeeded in moving the window.'); }).catch((err)=>{ console.error('Failed to move the window. Cause: ' + JSON.stringify(err)); -}) +}); + ``` ### resetSize(deprecated) @@ -4369,6 +4390,12 @@ resetSize(width: number, height: number, callback: AsyncCallback<void>): v 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. + +The new width and height you set must meet the limits. + > **NOTE** > > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [resize()](#resize9) instead. @@ -4393,6 +4420,7 @@ windowClass.resetSize(500, 1000, (err) => { } console.info('Succeeded in changing the window size.'); }); + ``` ### resetSize(deprecated) @@ -4401,6 +4429,12 @@ resetSize(width: number, height: number): Promise<void> 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. + +The new width and height you set must meet the limits. + > **NOTE** > > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [resize()](#resize9-1) instead. @@ -4464,6 +4498,7 @@ windowClass.setWindowType(type, (err) => { } console.info('Succeeded in setting the window type.'); }); + ``` ### setWindowType(deprecated) @@ -4502,6 +4537,7 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to set the window type. Cause: ' + JSON.stringify(err)); }); + ``` ### getProperties(deprecated) @@ -4573,7 +4609,7 @@ Obtains the area where this window cannot be displayed, for example, the system > **NOTE** > -> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [[getWindowAvoidArea()](#getwindowavoidarea9) instead. +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [getWindowAvoidArea()](#getwindowavoidarea9) instead. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -4595,6 +4631,7 @@ windowClass.getAvoidArea(type, (err, data) => { } console.info('Succeeded in obtaining the area. Data:' + JSON.stringify(data)); }); + ``` ### getAvoidArea(deprecated) @@ -4605,7 +4642,7 @@ Obtains the area where this window cannot be displayed, for example, the system > **NOTE** > -> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [getWindowProperties()](#getwindowavoidarea9) instead. +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [getWindowAvoidArea()](#getwindowavoidarea9) instead. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -4631,6 +4668,7 @@ promise.then((data)=> { }).catch((err)=>{ console.error('Failed to obtain the area. Cause:' + JSON.stringify(err)); }); + ``` ### setFullScreen(deprecated) @@ -4663,6 +4701,7 @@ windowClass.setFullScreen(isFullScreen, (err) => { } console.info('Succeeded in enabling the full-screen mode.'); }); + ``` ### setFullScreen(deprecated) @@ -4769,6 +4808,7 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(err)); }); + ``` ### setSystemBarEnable(deprecated) @@ -4785,10 +4825,10 @@ Sets whether to display the status bar and navigation bar in this window. This A **Parameters** -| Name | Type | Mandatory | Description | -| -------- | ------------------------- | --------- | ------------------------------------------------------------ | -| names | Array | Yes | Whether to display the status bar and navigation bar.
For example, to display the status bar and navigation bar, set this parameter to **['status', 'navigation']**. By default, they are not displayed. | -| callback | AsyncCallback<void> | Yes | Callback used to return the result. | +| Name | Type | Mandatory | Description | +| -------- | ----------------------------- | --------- | ------------------------------------------------------------ | +| names | Array<'status'\|'navigation'> | Yes | Whether to display the status bar and navigation bar.
For example, to display the status bar and navigation bar, set this parameter to **['status', 'navigation']**. By default, they are not displayed. | +| callback | AsyncCallback<void> | Yes | Callback used to return the result. | **Example** @@ -4819,9 +4859,9 @@ Sets whether to display the status bar and navigation bar in this window. This A **Parameters** -| Name | Type | Mandatory | Description | -| ----- | ----- | --------- | ------------------------------------------------------------ | -| names | Array | Yes | Whether to display the status bar and navigation bar.
For example, to display the status bar and navigation bar, set this parameter to **['status', 'navigation']**. By default, they are not displayed. | +| Name | Type | Mandatory | Description | +| ----- | ----------------------------- | --------- | ------------------------------------------------------------ | +| names | Array<'status'\|'navigation'> | Yes | Whether to display the status bar and navigation bar.
For example, to display the status bar and navigation bar, set this parameter to **['status', 'navigation']**. By default, they are not displayed. | **Return value** @@ -4879,6 +4919,7 @@ windowClass.setSystemBarProperties(SystemBarProperties, (err) => { } console.info('Succeeded in setting the system bar properties.'); }); + ``` ### setSystemBarProperties(deprecated) @@ -5020,6 +5061,7 @@ windowClass.isShowing((err, data) => { } console.info('Succeeded in checking whether the window is showing. Data: ' + JSON.stringify(data)); }); + ``` ### isShowing(deprecated) @@ -5049,6 +5091,7 @@ promise.then((data)=> { }).catch((err)=>{ console.error('Failed to check whether the window is showing. Cause: ' + JSON.stringify(err)); }); + ``` ### on('systemAvoidAreaChange')(deprecated) @@ -5076,6 +5119,7 @@ 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) @@ -5131,7 +5175,7 @@ windowClass.isSupportWideGamut((err, data) => { return; } console.info('Succeeded in checking whether the window support WideGamut Data: ' + JSON.stringify(data)); -}) +}); ``` @@ -5193,7 +5237,8 @@ windowClass.setColorSpace(window.ColorSpace.WIDE_GAMUT, (err) => { return; } console.info('Succeeded in setting window colorspace.'); -}) +}); + ``` ### setColorSpace(deprecated) @@ -5259,7 +5304,7 @@ windowClass.getColorSpace((err, data) => { return; } console.info('Succeeded in getting window colorspace. Cause:' + JSON.stringify(data)); -}) +}); ``` @@ -5323,6 +5368,7 @@ windowClass.setBackgroundColor(color, (err) => { } console.info('Succeeded in setting the background color.'); }); + ``` ### setBackgroundColor(deprecated) @@ -5461,6 +5507,7 @@ windowClass.setDimBehind(0.5, (err) => { } console.info('Succeeded in setting the dimness.'); }); + ``` ### setDimBehind(deprecated) @@ -5566,6 +5613,7 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to set the window to be focusable. Cause: ' + JSON.stringify(err)); }); + ``` ### setKeepScreenOn(deprecated) @@ -5598,6 +5646,7 @@ windowClass.setKeepScreenOn(isKeepScreenOn, (err) => { } console.info('Succeeded in setting the screen to be always on.'); }); + ``` ### setKeepScreenOn(deprecated) @@ -5634,6 +5683,7 @@ promise.then(() => { }).catch((err)=>{ console.info('Failed to set the screen to be always on. Cause: ' + JSON.stringify(err)); }); + ``` ### setOutsideTouchable(deprecated) @@ -5664,7 +5714,8 @@ windowClass.setOutsideTouchable(true, (err) => { return; } console.info('Succeeded in setting the area to be touchable.'); -}) +}); + ``` ### setOutsideTouchable(deprecated) @@ -5700,6 +5751,7 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to set the area to be touchable. Cause: ' + JSON.stringify(err)); }); + ``` ### setPrivacyMode(deprecated) @@ -5731,7 +5783,6 @@ windowClass.setPrivacyMode(isPrivacyMode, (err) => { return; } console.info('Succeeded in setting the window to privacy mode.'); - }); ``` @@ -5770,6 +5821,7 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to set the window to privacy mode. Cause: ' + JSON.stringify(err)); }); + ``` ### setTouchable(deprecated) @@ -5801,8 +5853,8 @@ windowClass.setTouchable(isTouchable, (err) => { return; } console.info('Succeeded in setting the window to be touchable.'); - }); + ``` ### setTouchable(deprecated) @@ -5839,6 +5891,7 @@ promise.then(()=> { }).catch((err)=>{ console.error('Failed to set the window to be touchable. Cause: ' + JSON.stringify(err)); }); + ``` ## WindowStageEventType9+ @@ -5849,12 +5902,12 @@ Describes the lifecycle of a window stage. **System capability**: SystemCapability.WindowManager.WindowManager.Core -| Name | Default Value | Description | -| ---------- | ------------- | ---------------------------------------------- | -| FOREGROUND | 1 | The window stage is running in the foreground. | -| ACTIVE | 2 | The window stage gains focus. | -| INACTIVE | 3 | The window stage loses focus. | -| BACKGROUND | 4 | The window stage is running in the background. | +| Name | Value | Description | +| ---------- | ----- | ---------------------------------------------- | +| FOREGROUND | 1 | The window stage is running in the foreground. | +| ACTIVE | 2 | The window stage gains focus. | +| INACTIVE | 3 | The window stage loses focus. | +| BACKGROUND | 4 | The window stage is running in the background. | ## WindowStage9+ @@ -5891,6 +5944,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ```ts import Ability from '@ohos.application.Ability'; + class myAbility extends Ability { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); @@ -5904,7 +5958,8 @@ class myAbility extends Ability { console.info('Succeeded in obtaining the main window. Data: ' + JSON.stringify(data)); }); } -} +}; + ``` ### getMainWindow9+ @@ -5936,19 +5991,21 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ```ts import Ability from '@ohos.application.Ability'; + class myAbility extends Ability { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); let windowClass = null; let promise = windowStage.getMainWindow(); - promise.then((data)=> { + promise.then((data) => { windowClass = data; console.info('Succeeded in obtaining the main window. Data: ' + JSON.stringify(data)); - }).catch((err)=>{ + }).catch((err) => { console.error('Failed to obtain the main window. Cause: ' + JSON.stringify(err)); }); } -} +}; + ``` ### getMainWindowSync9+ @@ -5980,6 +6037,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ```ts import Ability from '@ohos.application.Ability'; + class myAbility extends Ability { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); @@ -5989,7 +6047,8 @@ class myAbility extends Ability { console.error('Failed to obtain the main window. Cause: ' + JSON.stringify(exception)); }; } -} +}; + ``` ### createSubWindow9+ @@ -6006,7 +6065,7 @@ Creates a subwindow for this window stage. This API uses an asynchronous callbac | Name | Type | Mandatory | Description | | -------- | -------------------------------------- | --------- | -------------------------------------- | -| name | String | Yes | Name of the subwindow. | +| name | string | Yes | Name of the subwindow. | | callback | AsyncCallback<[Window](#window)> | Yes | Callback used to return the subwindow. | **Error codes** @@ -6022,6 +6081,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ```ts import Ability from '@ohos.application.Ability'; + class myAbility extends Ability { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); @@ -6040,7 +6100,8 @@ class myAbility extends Ability { console.error('Failed to create the subwindow. Cause: ' + JSON.stringify(exception)); }; } -} +}; + ``` ### createSubWindow9+ @@ -6057,7 +6118,7 @@ Creates a subwindow for this window stage. This API uses a promise to return the | Name | Type | Mandatory | Description | | ---- | ------ | --------- | ---------------------- | -| name | String | Yes | Name of the subwindow. | +| name | string | Yes | Name of the subwindow. | **Return value** @@ -6078,23 +6139,25 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ```ts import Ability from '@ohos.application.Ability'; + class myAbility extends Ability { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); let windowClass = null; try { let promise = windowStage.createSubWindow('mySubWindow'); - promise.then((data)=> { + promise.then((data) => { windowClass = data; console.info('Succeeded in creating the subwindow. Data: ' + JSON.stringify(data)); - }).catch((err)=>{ + }).catch((err) => { console.error('Failed to create the subwindow. Cause: ' + JSON.stringify(err)); }); } catch (exception) { console.error('Failed to create the subwindow. Cause: ' + JSON.stringify(exception)); }; } -} +}; + ``` ### getSubWindow9+ @@ -6125,6 +6188,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ```ts import Ability from '@ohos.application.Ability'; + class myAbility extends Ability { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); @@ -6138,7 +6202,8 @@ class myAbility extends Ability { console.info('Succeeded in obtaining the subwindow. Data: ' + JSON.stringify(data)); }); } -} +}; + ``` ### getSubWindow9+ @@ -6169,19 +6234,21 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ```ts import Ability from '@ohos.application.Ability'; + class myAbility extends Ability { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); let windowClass = null; let promise = windowStage.getSubWindow(); - promise.then((data)=> { + promise.then((data) => { windowClass = data; console.info('Succeeded in obtaining the subwindow. Data: ' + JSON.stringify(data)); - }).catch((err)=>{ + }).catch((err) => { console.error('Failed to obtain the subwindow. Cause: ' + JSON.stringify(err)); }) } -} +}; + ``` ### loadContent9+ @@ -6199,7 +6266,7 @@ Loads content from a page associated with a local storage to the main window in | Name | Type | Mandatory | Description | | -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ | | path | string | Yes | Path of the page from which the content will be loaded. | -| storage | 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-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. | **Error codes** @@ -6215,6 +6282,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ```ts import Ability from '@ohos.application.Ability'; + class myAbility extends Ability { storage : LocalStorage onWindowStageCreate(windowStage) { @@ -6233,7 +6301,8 @@ class myAbility extends Ability { console.error('Failed to load the content. Cause:' + JSON.stringify(exception)); }; } -} +}; + ``` ### loadContent9+ @@ -6251,7 +6320,7 @@ Loads content from a page associated with a local storage to the main window in | Name | Type | Mandatory | Description | | ------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ | | path | string | Yes | Path of the page from which the content will be loaded. | -| storage | LocalStorage | No | A storage unit, which provides storage for variable state properties and non-variable state properties of an application. | +| 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. | **Return value** @@ -6272,6 +6341,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ```ts import Ability from '@ohos.application.Ability'; + class myAbility extends Ability { storage : LocalStorage onWindowStageCreate(windowStage) { @@ -6280,16 +6350,17 @@ class myAbility extends Ability { console.log('onWindowStageCreate'); try { let promise = windowStage.loadContent('pages/page2',this.storage); - promise.then(()=> { + promise.then(() => { console.info('Succeeded in loading the content.'); - }).catch((err)=>{ + }).catch((err) => { console.error('Failed to load the content. Cause:' + JSON.stringify(err)); }); } catch (exception) { console.error('Failed to load the content. Cause:' + JSON.stringify(exception)); }; } -} +}; + ``` ### loadContent9+ @@ -6322,6 +6393,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ```ts import Ability from '@ohos.application.Ability'; + class myAbility extends Ability { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); @@ -6337,7 +6409,8 @@ class myAbility extends Ability { console.error('Failed to load the content. Cause:' + JSON.stringify(exception)); }; } -} +}; + ``` ### on('windowStageEvent')9+ @@ -6370,6 +6443,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ```ts import Ability from '@ohos.application.Ability'; + class myAbility extends Ability { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); @@ -6383,7 +6457,8 @@ class myAbility extends Ability { JSON.stringify(exception)); }; } -} +}; + ``` ### off('windowStageEvent')9+ @@ -6416,6 +6491,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ```ts import Ability from '@ohos.application.Ability'; + class myAbility extends Ability { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); @@ -6426,7 +6502,8 @@ class myAbility extends Ability { JSON.stringify(exception)); }; } -} +}; + ``` ### disableWindowDecor()9+ @@ -6454,12 +6531,14 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ```ts import Ability from '@ohos.application.Ability'; + class myAbility extends Ability { onWindowStageCreate(windowStage) { console.log('disableWindowDecor'); windowStage.disableWindowDecor(); } -} +}; + ``` ### setShowOnLockScreen()9+ @@ -6493,6 +6572,7 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc ```ts import Ability from '@ohos.application.Ability'; + class myAbility extends Ability { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); @@ -6502,7 +6582,8 @@ class myAbility extends Ability { console.error('Failed to show on lockscreen. Cause:' + JSON.stringify(exception)); }; } -} +}; + ``` ## TransitionContext9+ @@ -6557,7 +6638,7 @@ controller.animationForShown = (context : window.TransitionContext) => { toWindow.translate(obj); console.info('toWindow translate end'); } - ) + ); try { context.completeTransition(true) } catch (exception) { @@ -6565,6 +6646,7 @@ controller.animationForShown = (context : window.TransitionContext) => { } console.info('complete transition end'); }; + ``` ## TransitionController9+ @@ -6612,9 +6694,10 @@ controller.animationForShown = (context : window.TransitionContext) => { toWindow.translate(obj); console.info('toWindow translate end'); } - ) + ); console.info('complete transition end'); -} +}; + ``` ### animationForHidden9+ @@ -6660,6 +6743,5 @@ controller.animationForHidden = (context : window.TransitionContext) => { } ) console.info('complete transition end'); -} -``` - +}; +``` \ No newline at end of file diff --git a/en/application-dev/windowmanager/application-window-stage.md b/en/application-dev/windowmanager/application-window-stage.md index 4388719ee9..6ab30dbf32 100644 --- a/en/application-dev/windowmanager/application-window-stage.md +++ b/en/application-dev/windowmanager/application-window-stage.md @@ -57,8 +57,9 @@ In the stage model, the main window of an application is created and maintained 1. Obtain the main window. -Call **getMainWindow** to obtain the main window of the application. - + + Call **getMainWindow** to obtain the main window of the application. + 2. Set the properties of the main window. You can set multiple properties of the main window, such as the background color, brightness, and whether the main window is touchable. The code snippet below uses the **touchable** property as an example. @@ -83,21 +84,21 @@ class MainAbility extends Ability { console.info('Succeeded in obtaining the main window. Data: ' + JSON.stringify(data)); // 2. Set the touchable property of the main window. let isTouchable = true; - windowClass.setTouchable(isTouchable, (err, data) => { + windowClass.setTouchable(isTouchable, (err) => { if (err.code) { console.error('Failed to set the window to be touchable. Cause:' + JSON.stringify(err)); return; } - console.info('Succeeded in setting the window to be touchable. Data:' + JSON.stringify(data)); + console.info('Succeeded in setting the window to be touchable.'); }) }) // 3. Load the page content to the main window. - windowStage.loadContent("pages/page2", (err, data) => { + windowStage.loadContent("pages/page2", (err) => { if (err.code) { console.error('Failed to load the content. Cause:' + JSON.stringify(err)); return; } - console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data)); + console.info('Succeeded in loading the content.'); }); } }; @@ -111,12 +112,11 @@ You can create an application subwindow, such as a dialog box, and set its prope ### How to Develop -1. Create or obtain a subwindow. - -Call **createSubWindow** to create a subwindow. - -Call **getSubWindow** to obtain a subwindow. +1. Create a subwindow. + + Call **createSubWindow** to create a subwindow. + 2. Set the properties of the subwindow. After the subwindow is created, you can set its properties, such as the size, position, background color, and brightness. @@ -144,44 +144,35 @@ Call **getSubWindow** to obtain a subwindow. } sub_windowClass = data; console.info('Succeeded in creating the subwindow. Data: ' + JSON.stringify(data)); - // 1. Obtain an available subwindow. - windowStage_.getSubWindow((err, data) => { - if (err.code) { - console.error('Failed to obtain the subWindow. Cause:' + JSON.stringify(err)); - return; - } - console.info('Succeeded in obtaining the subWindow. Data: ' + JSON.stringify(data)); - sub_windowClass = data; - }); // 2. Set the position, size, and other properties of the subwindow. - sub_windowClass.moveTo(300, 300, (err, data) => { + sub_windowClass.moveTo(300, 300, (err) => { if (err.code) { console.error('Failed to move the window. Cause:' + JSON.stringify(err)); return; } - console.info('Succeeded in moving the window. Data: ' + JSON.stringify(data)); + console.info('Succeeded in moving the window.'); }); - sub_windowClass.resetSize(500, 1000, (err, data) => { + sub_windowClass.resetSize(500, 1000, (err) => { if (err.code) { console.error('Failed to change the window size. Cause:' + JSON.stringify(err)); return; } - console.info('Succeeded in changing the window size. Data: ' + JSON.stringify(data)); + console.info('Succeeded in changing the window size.'); }); // 3. Load the page content to the subwindow. - sub_windowClass.loadContent("pages/page3", (err, data) => { + sub_windowClass.loadContent("pages/page3", (err) => { if (err.code) { console.error('Failed to load the content. Cause:' + JSON.stringify(err)); return; } - console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data)); + console.info('Succeeded in loading the content.'); // 3. Show the subwindow. - sub_windowClass.show((err, data) => { + sub_windowClass.show((err) => { if (err.code) { - console.error('Failed to show the window. Cause:' + JSON.stringify(err)); + console.error('Failed to show the window. Cause: ' + JSON.stringify(err)); return; } - console.info('Succeeded in showing the window. Data: ' + JSON.stringify(data)); + console.info('Succeeded in showing the window.'); }); }); }) @@ -189,18 +180,18 @@ Call **getSubWindow** to obtain a subwindow. destroySubWindow() { // 4. Destroy the subwindow when it is no longer needed (depending on the service logic). - sub_windowClass.destroy((err, data) => { + sub_windowClass.destroy((err) => { if (err.code) { console.error('Failed to destroy the window. Cause: ' + JSON.stringify(err)); return; } - console.info('Succeeded in destroying the window. Data: ' + JSON.stringify(data)); + console.info('Succeeded in destroying the window.'); }); } onWindowStageCreate(windowStage) { windowStage_ = windowStage; - // Create the subwindow when it is needed, for example, when a click event occurs in the main window. Calling onWindowStageCreate is not always necessary. The code here is for reference only. + // Create a subwindow when it is needed, for example, when a click event occurs in the main window. Calling onWindowStageCreate is not always necessary. The code here is for reference only. this.showSubWindow(); } @@ -221,8 +212,9 @@ To create a better video watching and gaming experience, you can use the immersi 1. Obtain the main window. -Call **getMainWindow** to obtain the main window of the application. - + + Call **getMainWindow** to obtain the main window of the application. + 2. Implement the immersive effect. You can use any of the following methods: - Method 1: Call **setFullScreen** to set the main window to be displayed in full screen. In this case, the navigation bar and status bar are hidden. - Method 2: Call **setSystemBarEnable** to hide the navigation bar and status bar. @@ -249,30 +241,30 @@ Call **getMainWindow** to obtain the main window of the application. // 2. Use method 1 to implement the immersive effect. let isFullScreen = true; - windowClass.setFullScreen(isFullScreen, (err, data) => { + windowClass.setFullScreen(isFullScreen, (err) => { if (err.code) { console.error('Failed to enable the full-screen mode. Cause:' + JSON.stringify(err)); return; } - console.info('Succeeded in enabling the full-screen mode. Data: ' + JSON.stringify(data)); + console.info('Succeeded in enabling the full-screen mode.'); }); // 2. Use method 2 to implement the immersive effect. let names = []; - windowClass.setSystemBarEnable(names, (err, data) => { + windowClass.setSystemBarEnable(names, (err) => { if (err.code) { console.error('Failed to set the system bar to be visible. Cause:' + JSON.stringify(err)); return; } - console.info('Succeeded in setting the system bar to be visible. Data: ' + JSON.stringify(data)); + console.info('Succeeded in setting the system bar to be visible.'); }); // 2. Use method 3 to implement the immersive effect. let isLayoutFullScreen = true; - windowClass.setLayoutFullScreen(isLayoutFullScreen, (err, data) => { + windowClass.setLayoutFullScreen(isLayoutFullScreen, (err) => { if (err.code) { console.error('Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(err)); return; } - console.info('Succeeded in setting the window layout to full-screen mode. Data: ' + JSON.stringify(data)); + console.info('Succeeded in setting the window layout to full-screen mode.'); }); let sysBarProps = { statusBarColor: '#ff00ff', @@ -281,21 +273,21 @@ Call **getMainWindow** to obtain the main window of the application. statusBarContentColor: '#ffffff', navigationBarContentColor: '#ffffff' }; - windowClass.setSystemBarProperties(sysBarProps, (err, data) => { + windowClass.setSystemBarProperties(sysBarProps, (err) => { if (err.code) { console.error('Failed to set the system bar properties. Cause: ' + JSON.stringify(err)); return; } - console.info('Succeeded in setting the system bar properties. Data: ' + JSON.stringify(data)); + console.info('Succeeded in setting the system bar properties.'); }); }) // 3. Load the page content to the immersive window. - windowStage.loadContent("pages/page2", (err, data) => { + windowStage.loadContent("pages/page2", (err) => { if (err.code) { console.error('Failed to load the content. Cause:' + JSON.stringify(err)); return; } - console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data)); + console.info('Succeeded in loading the content.'); }); } }; @@ -310,13 +302,13 @@ A floating window is created based on an existing task. It is always displayed i ### How to Develop 1. Apply for permissions. - -To create a floating window (of the **WindowType.TYPE_FLOAT** type), you must configure the **ohos.permission.SYSTEM_FLOAT_WINDOW** permission in the **requestPermissions** field of the **module.json5** file. For details about the file, see [Application Package Structure Configuration File](../quick-start/stage-structure.md). - + + To create a floating window (of the **WindowType.TYPE_FLOAT** type), you must configure the **ohos.permission.SYSTEM_FLOAT_WINDOW** permission in the **requestPermissions** field of the **module.json5** file. For details about the file, see [Application Package Structure Configuration File](../quick-start/stage-structure.md). + > **NOTE** > > If the task for creating the floating window is reclaimed by the system, the floating window will no longer be displayed. If you want the floating window to be displayed in such a case, apply for a [continuous task](../task-management/background-task-overview.md). - + ```json { "module": { @@ -334,7 +326,7 @@ To create a floating window (of the **WindowType.TYPE_FLOAT** type), you must co } } ``` - + 2. Create a floating window. Call **window.create** to create a floating window. @@ -368,43 +360,43 @@ To create a floating window (of the **WindowType.TYPE_FLOAT** type), you must co console.info('Succeeded in creating the floatWindow. Data: ' + JSON.stringify(data)); windowClass = data; // 3. Set the position, size, and properties of the floating window. - windowClass.moveTo(300, 300, (err, data) => { + windowClass.moveTo(300, 300, (err) => { if (err.code) { console.error('Failed to move the window. Cause:' + JSON.stringify(err)); return; } - console.info('Succeeded in moving the window. Data: ' + JSON.stringify(data)); + console.info('Succeeded in moving the window.'); }); - windowClass.resetSize(500, 1000, (err, data) => { + windowClass.resetSize(500, 1000, (err) => { if (err.code) { console.error('Failed to change the window size. Cause:' + JSON.stringify(err)); return; } - console.info('Succeeded in changing the window size. Data: ' + JSON.stringify(data)); + console.info('Succeeded in changing the window size.'); }); // 4. Load the page content to the floating window. - windowClass.loadContent("pages/page4", (err, data) => { + windowClass.loadContent("pages/page4", (err) => { if (err.code) { console.error('Failed to load the content. Cause:' + JSON.stringify(err)); return; } - console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data)); + console.info('Succeeded in loading the content.'); // 4. Show the floating window. - windowClass.show((err, data) => { + windowClass.show((err) => { if (err.code) { console.error('Failed to show the window. Cause: ' + JSON.stringify(err)); return; } - console.info('Succeeded in showing the window. Data: ' + JSON.stringify(data)); + console.info('Succeeded in showing the window.'); }); }); // 5. Destroy the floating window when it is no longer needed (depending on the service logic). - windowClass.destroy((err, data) => { + windowClass.destroy((err) => { if (err.code) { console.error('Failed to destroy the window. Cause: ' + JSON.stringify(err)); return; } - console.info('Succeeded in destroying the window. Data: ' + JSON.stringify(data)); + console.info('Succeeded in destroying the window.'); }); }); } diff --git a/en/application-dev/windowmanager/system-window-stage.md b/en/application-dev/windowmanager/system-window-stage.md index e4e8cf63fd..5df5ada6bf 100644 --- a/en/application-dev/windowmanager/system-window-stage.md +++ b/en/application-dev/windowmanager/system-window-stage.md @@ -65,46 +65,46 @@ export default class ServiceExtensionAbility1 extends ExtensionContext { console.info('Succeeded in creating the volume window.') windowClass = data; // 2. Change the size and position of the volume bar window, or set its properties such as the background color and brightness. - windowClass.moveTo(300, 300, (err, data) => { + windowClass.moveTo(300, 300, (err) => { if (err.code) { console.error('Failed to move the window. Cause:' + JSON.stringify(err)); return; } - console.info('Succeeded in moving the window. Data: ' + JSON.stringify(data)); + console.info('Succeeded in moving the window.'); }); - windowClass.resetSize(500, 1000, (err, data) => { + windowClass.resetSize(500, 1000, (err) => { if (err.code) { console.error('Failed to change the window size. Cause:' + JSON.stringify(err)); return; } - console.info('Succeeded in changing the window size. Data: ' + JSON.stringify(data)); + console.info('Succeeded in changing the window size.'); }); // 3. Load the page content to the volume bar window. - windowClass.loadContent("pages/page_volume", (err, data) => { + windowClass.loadContent("pages/page_volume", (err) => { if (err.code) { console.error('Failed to load the content. Cause:' + JSON.stringify(err)); return; } - console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data)); + console.info('Succeeded in loading the content.'); // 3. Show the volume bar window. - windowClass.show((err, data) => { + windowClass.show((err) => { if (err.code) { console.error('Failed to show the window. Cause:' + JSON.stringify(err)); return; } - console.info('Succeeded in showing the window. Data: ' + JSON.stringify(data)); + console.info('Succeeded in showing the window.'); }); }); // 4. Hide or destroy the volume bar window. // Hide the volume bar window when a click event outside the window is detected. windowClass.on('touchOutside', () => { console.info('touch outside'); - windowClass.hide((err, data) => { + windowClass.hide((err) => { if (err.code) { console.error('Failed to hide the window. Cause: ' + JSON.stringify(err)); return; } - console.info('Succeeded in hidinging the window. Data: ' + JSON.stringify(data)); + console.info('Succeeded in hidinging the window.'); }); }); }); diff --git a/en/application-dev/windowmanager/window-overview.md b/en/application-dev/windowmanager/window-overview.md index e27a032e72..a72dac25d0 100644 --- a/en/application-dev/windowmanager/window-overview.md +++ b/en/application-dev/windowmanager/window-overview.md @@ -63,4 +63,8 @@ You are advised to use the stage model for window development. ## Constraints -You cannot develop system windows in the FA model. +- You cannot develop system windows in the FA model. + +- 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. -- GitLab