未验证 提交 7c4f0fe7 编写于 作者: O openharmony_ci 提交者: Gitee

!14060 翻译完成:13602 windowmanager文件夹更新

Merge pull request !14060 from wusongqing/TR13602
......@@ -52,7 +52,7 @@ You can create a subwindow, such as a dialog box, and set its properties.
let windowClass = null;
// Method 1: Create a subwindow.
let config = {name: "subWindow", windowType: window.WindowType.TYPE_APP, ctx: this.context};
let config = {name: "subWindow", windowType: window.WindowType.TYPE_APP};
window.createWindow(config, (err, data) => {
if (err.code) {
console.error('Failed to create the subWindow. Cause: ' + JSON.stringify(err));
......
......@@ -67,9 +67,9 @@ In the stage model, the main window of an application is created and maintained
Call **loadContent** to load the page content to the main window.
```ts
import Ability from '@ohos.application.Ability'
import UIAbility from '@ohos.app.ability.UIAbility';
class MainAbility extends Ability {
export default class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
// 1. Obtain the main window of the application.
let windowClass = null;
......@@ -127,11 +127,11 @@ You can create an application subwindow, such as a dialog box, and set its prope
When the subwindow is no longer needed, you can call **destroyWindow** to destroy it.
```ts
import Ability from '@ohos.application.Ability'
import UIAbility from '@ohos.app.ability.UIAbility';
let windowStage_ = null;
let sub_windowClass = null;
class MainAbility extends Ability {
export default class EntryAbility extends UIAbility {
showSubWindow() {
// 1. Create a subwindow.
windowStage_.createSubWindow("mySubWindow", (err, data) => {
......@@ -220,9 +220,9 @@ To create a better video watching and gaming experience, you can use the immersi
Call **loadContent** to load the content to the immersive window.
```ts
import Ability from '@ohos.application.Ability'
import UIAbility from '@ohos.app.ability.UIAbility';
class MainAbility extends Ability {
export default class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
// 1. Obtain the main window of the application.
let windowClass = null;
......@@ -303,7 +303,7 @@ A floating window is created based on an existing task. It is always displayed i
"name" : "ohos.permission.SYSTEM_FLOAT_WINDOW",
"usedScene": {
"abilities": [
"MainAbility"
"EntryAbility"
],
"when":"inuse"
}
......@@ -330,11 +330,11 @@ A floating window is created based on an existing task. It is always displayed i
When the floating window is no longer needed, you can call **destroyWindow** to destroy it.
```ts
import Ability from '@ohos.application.Ability'
import ExtensionContext from '@ohos.application.ServiceExtensionAbility';
import UIAbility from '@ohos.app.ability.UIAbility';
import ExtensionContext from '@ohos.app.ability.ServiceExtensionAbility';
import window from '@ohos.window';
class MainAbility extends Ability {
export default class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
// 2. Create a floating window.
let windowClass = null;
......@@ -390,4 +390,3 @@ A floating window is created based on an existing task. It is always displayed i
};
```
<!--no_check-->
\ No newline at end of file
......@@ -58,12 +58,11 @@ This section uses the volume bar as an example to describe how to develop a syst
When the volume bar window is no longer needed, you can call **hide** or **destroyWindow** to hide or destroy it.
```ts
import ExtensionContext from '@ohos.application.ServiceExtensionAbility';
import ExtensionContext from '@ohos.app.ability.ServiceExtensionAbility';
import window from '@ohos.window';
export default class ServiceExtensionAbility1 extends ExtensionContext {
onCreate(want) {
console.log("[Demo] MainAbility onCreate")
globalThis.abilityWant = want;
// 1. Create a volume bar window.
let windowClass = null;
......@@ -151,7 +150,6 @@ import window from '@ohos.window';
export default class ServiceExtensionAbility1 extends ExtensionContext {
onCreate(want) {
console.log("[Demo] MainAbility onCreate")
globalThis.abilityWant = want;
// Create a volume bar window.
let windowClass = null;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册