From 35bc4821cd7386dc8616ebaa98498589d25897ba Mon Sep 17 00:00:00 2001 From: Gloria Date: Tue, 13 Jun 2023 17:11:03 +0800 Subject: [PATCH] Update docs against 19193+19086 Signed-off-by: wusongqing --- .../reference/apis/js-apis-window.md | 51 ++++++++++++++++++- .../windowmanager/application-window-fa.md | 6 +-- .../windowmanager/application-window-stage.md | 8 +-- 3 files changed, 57 insertions(+), 8 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-window.md b/en/application-dev/reference/apis/js-apis-window.md index 726f05fc58..754fdb6358 100644 --- a/en/application-dev/reference/apis/js-apis-window.md +++ b/en/application-dev/reference/apis/js-apis-window.md @@ -236,7 +236,7 @@ Describes the window properties. | dimBehindValue(deprecated) | number | Yes | Yes | Dimness of the window that is not on top. The value ranges from 0 to 1. The value **1** indicates the maximum dimness.
**NOTE**
This property is supported since API version 7 and deprecated since API version 9.
| | isKeepScreenOn | boolean | Yes | Yes | Whether the screen is always on. The default value is **false**. The value **true** means that the screen is always on, and **false** means the opposite.| | isPrivacyMode7+ | boolean | Yes | Yes | Whether the window is in privacy mode. The default value is **false**. The value **true** means that the window is in privacy mode, and **false** means the opposite.| -| isRoundCorner(deprecated) | boolean | Yes | Yes | Whether the window has rounded corners. The default value is **false**. The value **true** means that the window has rounded corners, and **false** means the opposite.
**NOTE**
This property is supported since API version 7 and deprecated since API version 9.
| +| isRoundCorner(deprecated) | boolean | Yes | Yes | Whether the window has rounded corners. The default value is **false**. The value **true** means that the window has rounded corners, and **false** means the opposite.
**NOTE**
This property is supported since API version 7 and deprecated since API version 9.
| | isTransparent7+ | boolean | Yes | Yes | Whether the window is transparent. The default value is **false**. The value **true** means that the window is transparent, and **false** means the opposite.| | id9+ | number | Yes | No | Window ID. The default value is **0.0**. | @@ -2418,6 +2418,53 @@ try { } ``` +### getUIContext10+ + +getUIContext(): UIContext + +Obtain a **UIContext** instance. + +**Model restriction**: This API can be used only in the stage model. + +**System capability**: SystemCapability.WindowManager.WindowManager.Core + +**Return value** + +| Type | Description | +| ---------- | ---------------------- | +| [UIContext](./js-apis-arkui-UIContext.md#uicontext) | **UIContext** instance obtained.| + +**Example** + +```ts +import UIAbility from '@ohos.app.ability.UIAbility'; + +export default class EntryAbility extends UIAbility { + onWindowStageCreate(windowStage) { + // Load content for the main window. + 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.'); + }); + // Obtain the main window. + let windowClass = null; + windowStage.getMainWindow((err, data) => { + if (err.code) { + console.error('Failed to obtain the main window. Cause: ' + JSON.stringify(err)); + return; + } + windowClass = data; + console.info('Succeeded in obtaining the main window. Data: ' + JSON.stringify(data)); + // Obtain a UIContext instance. + globalThis.uiContext = windowClass.getUIContext(); + }) + } +}; +``` + ### setUIContent9+ setUIContent(path: string, callback: AsyncCallback<void>): void @@ -7439,3 +7486,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-fa.md b/en/application-dev/windowmanager/application-window-fa.md index 3ffee6d646..89337707dc 100644 --- a/en/application-dev/windowmanager/application-window-fa.md +++ b/en/application-dev/windowmanager/application-window-fa.md @@ -133,7 +133,7 @@ You can create a subwindow, such as a dialog box, and set its properties. ## Experiencing the Immersive Window Feature -To create a better video watching and gaming experience, you can use the immersive window feature to hide the system windows, including the status bar and navigation bar. To achieve this effect, you can use the immersive window feature, which is available only for the main window of an application. +To create a better video watching and gaming experience, you can use the immersive window feature to hide the system windows, including the status bar and navigation bar. This feature is available only for the main window of an application. Since API version 10, the immersive window has the same size as the full screen by default; its layout is controlled by the component module; the background color of its status bar and navigation bar is transparent, and the text color is black. When an application window calls **setWindowLayoutFullScreen**, with **true** passed in, the component module controls the immersive full-screen layout of the status bar and navigation bar. If **false** is passed in, the component module controls the non-immersive full-screen layout of the status bar and navigation bar. ### How to Develop @@ -163,8 +163,8 @@ To create a better video watching and gaming experience, you can use the immersi 2. Implement the immersive effect. You can use either of the following methods: - - Method 1: Call **setWindowSystemBarEnable** to hide the navigation bar and status bar. - - Method 2: Call **setWindowLayoutFullScreen** to enable the full-screen mode for the main window layout. Call **setSystemProperties** to set the opacity, background color, text color, and highlighted icon of the navigation bar and status bar to ensure that their display effect is consistent with that of the main window. + - Method 1: When the main window of the application is a full-screen window, call **setWindowSystemBarEnable** to hide the status bar and navigation bar. + - Method 2: Call **setWindowLayoutFullScreen** to enable the full-screen mode for the main window layout. Call **setSystemProperties** to set the opacity, background color, text color, and highlighted icon of the status bar and navigation bar to ensure that their display effect is consistent with that of the main window. ```js diff --git a/en/application-dev/windowmanager/application-window-stage.md b/en/application-dev/windowmanager/application-window-stage.md index 68c923de34..e5155946df 100644 --- a/en/application-dev/windowmanager/application-window-stage.md +++ b/en/application-dev/windowmanager/application-window-stage.md @@ -202,7 +202,7 @@ You can create an application subwindow, such as a dialog box, and set its prope ## Experiencing the Immersive Window Feature -To create a better video watching and gaming experience, you can use the immersive window feature to hide the system windows, including the status bar and navigation bar. To achieve this effect, you can use the immersive window feature, which is available only for the main window of an application. +To create a better video watching and gaming experience, you can use the immersive window feature to hide the system windows, including the status bar and navigation bar. Tis feature is available only for the main window of an application. Since API version 10, the immersive window has the same size as the full screen by default; its layout is controlled by the component module; the background color of its status bar and navigation bar is transparent, and the text color is black. When an application window calls **setWindowLayoutFullScreen**, with **true** passed in, the component module controls the immersive full-screen layout of the status bar and navigation bar. If **false** is passed in, the component module controls the non-immersive full-screen layout of the status bar and navigation bar. ### How to Develop @@ -212,8 +212,8 @@ To create a better video watching and gaming experience, you can use the immersi Call **getMainWindow** to obtain the main window of the application. 2. Implement the immersive effect. You can use either of the following methods: - - Method 1: Call **setWindowSystemBarEnable** to hide the navigation bar and status bar. - - Method 2: Call **setWindowLayoutFullScreen** to enable the full-screen mode for the main window layout. Call **setWindowSystemBarProperties** to set the opacity, background color, text color, and highlighted icon of the navigation bar and status bar to ensure that their display effect is consistent with that of the main window. + - Method 1: When the main window of the application is a full-screen window, call **setWindowSystemBarEnable** to hide the status bar and navigation bar. + - Method 2: Call **setWindowLayoutFullScreen** to enable the full-screen mode for the main window layout. Call **setWindowSystemBarProperties** to set the opacity, background color, text color, and highlighted icon of the status bar and navigation bar to ensure that their display effect is consistent with that of the main window. 3. Load content for the immersive window and show it. @@ -387,4 +387,4 @@ A floating window is created based on an existing task. It is always displayed i }); } }; - ``` \ No newline at end of file + ``` -- GitLab