提交 f3431b51 编写于 作者: G Gloria

Update docs against 9952+9950+9996+9795+9831

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 b3466bf4
......@@ -78,7 +78,7 @@ export default class MyWindowExtensionAbility extends WindowExtensionAbility {
## WindowExtensionAbility.onWindowReady
onWindowReady(window: Window): void
onWindowReady(window: window.Window): void
Called when a window is ready.
......@@ -88,7 +88,7 @@ Called when a window is ready.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| window | [Window](js-apis-window.md) | Yes| Current **Window** instance.|
| window | [window.Window](js-apis-window.md#window) | Yes| Current **Window** instance.|
**Example**
......@@ -99,7 +99,7 @@ export default class MyWindowExtensionAbility extends WindowExtensionAbility {
onWindowReady(window) {
window.loadContent('WindowExtAbility/pages/index1').then(() => {
window.getProperties().then((pro) => {
console.log("WindowExtension " + JSON.stringify(pro));
console.log('WindowExtension ' + JSON.stringify(pro));
})
window.show();
})
......
......@@ -303,8 +303,8 @@ Creates a subwindow. This API uses an asynchronous callback to return the result
**Example**
```js
var windowClass = null;
window.create("first", window.WindowType.TYPE_APP,(err,data) => {
let windowClass = null;
window.create('first', window.WindowType.TYPE_APP,(err,data) => {
if(err.code){
console.error('Failed to create the subWindow. Cause: ' + JSON.stringify(err));
return;
......@@ -340,8 +340,8 @@ Creates a subwindow. This API uses a promise to return the result.
**Example**
```js
var windowClass = null;
let promise = window.create("first", window.WindowType.TYPE_APP);
let windowClass = null;
let promise = window.create('first', window.WindowType.TYPE_APP);
promise.then((data)=> {
windowClass = data;
console.info('Succeeded in creating the subWindow. Data: ' + JSON.stringify(data));
......@@ -370,8 +370,8 @@ Creates a subwindow (in API version 8) or a system window (from API version 9).
**Example**
```js
var windowClass = null;
window.create(this.context, "alertWindow", window.WindowType.TYPE_SYSTEM_ALERT, (err, data) => {
let windowClass = null;
window.create(this.context, 'alertWindow', window.WindowType.TYPE_SYSTEM_ALERT, (err, data) => {
if (err.code) {
console.error('Failed to create the window. Cause: ' + JSON.stringify(err));
return;
......@@ -407,8 +407,8 @@ Creates a subwindow (in API version 8) or a system window (from API version 9).
**Example**
```js
var windowClass = null;
let promise = window.create(this.context, "alertWindow", window.WindowType.TYPE_SYSTEM_ALERT);
let windowClass = null;
let promise = window.create(this.context, 'alertWindow', window.WindowType.TYPE_SYSTEM_ALERT);
promise.then((data)=> {
windowClass = data;
console.info('Succeeded in creating the window. Data:' + JSON.stringify(data));
......@@ -435,8 +435,8 @@ Finds a window based on the ID. This API uses an asynchronous callback to return
**Example**
```js
var windowClass = null;
window.find("alertWindow", (err, data) => {
let windowClass = null;
window.find('alertWindow', (err, data) => {
if (err.code) {
console.error('Failed to find the Window. Cause: ' + JSON.stringify(err));
return;
......@@ -469,8 +469,8 @@ Finds a window based on the ID. This API uses a promise to return the result.
**Example**
```js
var windowClass = null;
let promise = window.find("alertWindow");
let windowClass = null;
let promise = window.find('alertWindow');
promise.then((data)=> {
windowClass = data;
console.info('Succeeded in finding the window. Data: ' + JSON.stringify(data));
......@@ -498,7 +498,7 @@ Obtains the top window of the current application. This API uses an asynchronous
**Example**
```js
var windowClass = null;
let windowClass = null;
window.getTopWindow((err, data) => {
if (err.code) {
console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(err));
......@@ -528,7 +528,7 @@ Obtains the top window of the current application. This API uses a promise to re
**Example**
```js
var windowClass = null;
let windowClass = null;
let promise = window.getTopWindow();
promise.then((data)=> {
windowClass = data;
......@@ -556,7 +556,7 @@ Obtains the top window of the current application. This API uses an asynchronous
**Example**
```js
var windowClass = null;
let windowClass = null;
window.getTopWindow(this.context, (err, data) => {
if (err.code) {
console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(err));
......@@ -590,7 +590,7 @@ Obtains the top window of the current application. This API uses a promise to re
**Example**
```js
var windowClass = null;
let windowClass = null;
let promise = window.getTopWindow(this.context);
promise.then((data)=> {
windowClass = data;
......@@ -622,7 +622,7 @@ Minimizes all windows on a display. This API uses an asynchronous callback to re
import display from '@ohos.display'
import window from '@ohos.window'
var displayClass = null;
let displayClass = null;
display.getDefaultDisplay((err, data) => {
if(err.code) {
return;
......@@ -665,7 +665,7 @@ Minimizes all windows on a display. This API uses a promise to return the result
import display from '@ohos.display'
import window from '@ohos.window'
var displayClass = null;
let displayClass = null;
display.getDefaultDisplay((err, data) => {
if(err.code) {
return;
......@@ -1255,7 +1255,7 @@ Sets the type of this window. This API uses an asynchronous callback to return t
**Example**
```js
var type = window.WindowType.TYPE_APP;
let type = window.WindowType.TYPE_APP;
windowClass.setWindowType(type, (err, data) => {
if (err.code) {
console.error('Failed to set the window type. Cause: ' + JSON.stringify(err));
......@@ -1294,7 +1294,7 @@ Sets the type of this window. This API uses a promise to return the result.
**Example**
```js
var type = window.WindowType.TYPE_APP;
let type = window.WindowType.TYPE_APP;
let promise = windowClass.setWindowType(type);
promise.then((data)=> {
console.info('Succeeded in setting the window type. Data: ' + JSON.stringify(data));
......@@ -1372,7 +1372,7 @@ Obtains the area where this window cannot be displayed, for example, the system
**Example**
```js
var type = window.AvoidAreaType.TYPE_SYSTEM;
let type = window.AvoidAreaType.TYPE_SYSTEM;
windowClass.getAvoidArea(type, (err, data) => {
if (err.code) {
console.error('Failed to obtain the area. Cause:' + JSON.stringify(err));
......@@ -1405,7 +1405,7 @@ Obtains the area where this window cannot be displayed, for example, the system
**Example**
```js
var type = window.AvoidAreaType.TYPE_SYSTEM;
let type = window.AvoidAreaType.TYPE_SYSTEM;
let promise = windowClass.getAvoidArea(type);
promise.then((data)=> {
console.info('Succeeded in obtaining the area. Data:' + JSON.stringify(data));
......@@ -1432,7 +1432,7 @@ Sets whether to enable the full-screen mode for this window. This API uses an as
**Example**
```js
var isFullScreen = true;
let isFullScreen = true;
windowClass.setFullScreen(isFullScreen, (err, data) => {
if (err.code) {
console.error('Failed to enable the full-screen mode. Cause: ' + JSON.stringify(err));
......@@ -1465,7 +1465,7 @@ Sets whether to enable the full-screen mode for this window. This API uses a pro
**Example**
```js
var isFullScreen = true;
let isFullScreen = true;
let promise = windowClass.setFullScreen(isFullScreen);
promise.then((data)=> {
console.info('Succeeded in enabling the full-screen mode. Data: ' + JSON.stringify(data));
......@@ -1492,7 +1492,7 @@ Sets whether to enable the full-screen mode for the window layout. This API uses
**Example**
```js
var isLayoutFullScreen= true;
let isLayoutFullScreen= true;
windowClass.setLayoutFullScreen(isLayoutFullScreen, (err, data) => {
if (err.code) {
console.error('Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(err));
......@@ -1525,7 +1525,7 @@ Sets whether to enable the full-screen mode for the window layout. This API uses
**Example**
```js
var isLayoutFullScreen = true;
let isLayoutFullScreen = true;
let promise = windowClass.setLayoutFullScreen(isLayoutFullScreen);
promise.then((data)=> {
console.info('Succeeded in setting the window layout to full-screen mode. Data: ' + JSON.stringify(data));
......@@ -1546,14 +1546,14 @@ Sets whether to display the status bar and navigation bar in this window. This A
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ------------------------------------------------------------ |
| names | Array | Yes | Whether to display the status bar and navigation bar.<br>For example, to display the status bar and navigation bar, set this parameter to `["status", "navigation"]`. By default, they are not displayed.|
| names | Array | Yes | Whether to display the status bar and navigation bar.<br>For example, to display the status bar and navigation bar, set this parameter to `['status', 'navigation']`. By default, they are not displayed.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Example**
```js
// In this example, the status bar and navigation bar are not displayed.
var names = [];
let names = [];
windowClass.setSystemBarEnable(names, (err, data) => {
if (err.code) {
console.error('Failed to set the system bar to be invisible. Cause:' + JSON.stringify(err));
......@@ -1575,7 +1575,7 @@ Sets whether to display the status bar and navigation bar in this window. This A
| Name| Type | Mandatory| Description |
| ------ | ----- | ---- | ------------------------------------------------------------ |
| names | Array | Yes | Whether to display the status bar and navigation bar.<br>For example, to display the status bar and navigation bar, set this parameter to `["status", "navigation"]`. By default, they are not displayed.|
| names | Array | Yes | Whether to display the status bar and navigation bar.<br>For example, to display the status bar and navigation bar, set this parameter to `['status', 'navigation']`. By default, they are not displayed.|
**Return value**
......@@ -1587,7 +1587,7 @@ Sets whether to display the status bar and navigation bar in this window. This A
```js
// In this example, the status bar and navigation bar are not displayed.
var names = [];
let names = [];
let promise = windowClass.setSystemBarEnable(names);
promise.then((data)=> {
console.info('Succeeded in setting the system bar to be invisible. Data: ' + JSON.stringify(data));
......@@ -1614,7 +1614,7 @@ Sets the properties of the status bar and navigation bar in this window. This AP
**Example**
```js
var SystemBarProperties={
let SystemBarProperties={
statusBarColor: '#ff00ff',
navigationBarColor: '#00ff00',
// The following properties are supported since API version 7.
......@@ -1656,7 +1656,7 @@ Sets the properties of the status bar and navigation bar in this window. This AP
**Example**
```js
var SystemBarProperties={
let SystemBarProperties={
statusBarColor: '#ff00ff',
navigationBarColor: '#00ff00',
// The following properties are supported since API version 7.
......@@ -1692,7 +1692,7 @@ Sets the preferred orientation for this window. This API uses an asynchronous ca
**Example**
```js
var orientation = window.Orientation.AUTO_ROTATION;
let orientation = window.Orientation.AUTO_ROTATION;
windowClass.setPreferredOrientation(orientation, (err, data) => {
if (err.code) {
console.error('Failed to set window orientation. Cause: ' + JSON.stringify(err));
......@@ -1725,7 +1725,7 @@ Sets the preferred orientation for this window. This API uses a promise to retur
**Example**
```js
var orientation = window.Orientation.AUTO_ROTATION;
let orientation = window.Orientation.AUTO_ROTATION;
let promise = windowClass.setPreferredOrientation(orientation);
promise.then((data)=> {
console.info('Succeeded in setting the window orientation. Data: ' + JSON.stringify(data));
......@@ -1752,7 +1752,7 @@ Loads content from a page to this window. This API uses an asynchronous callback
**Example**
```js
windowClass.loadContent("pages/page2/page2", (err, data) => {
windowClass.loadContent('pages/page2/page2', (err, data) => {
if (err.code) {
console.error('Failed to load the content. Cause:' + JSON.stringify(err));
return;
......@@ -1784,7 +1784,7 @@ Loads content from a page to this window. This API uses a promise to return the
**Example**
```js
let promise = windowClass.loadContent("pages/page2/page2");
let promise = windowClass.loadContent('pages/page2/page2');
promise.then((data)=> {
console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data));
}).catch((err)=>{
......@@ -1816,9 +1816,9 @@ class myAbility extends Ability {
storage : LocalStorage
onWindowStageCreate(windowStage) {
this.storage = new LocalStorage();
this.storage.setOrCreate("storageSimpleProp",121);
this.storage.setOrCreate('storageSimpleProp',121);
console.log('onWindowStageCreate');
windowStage.loadContent("pages/page2",this.storage,(err, data) => {
windowStage.loadContent('pages/page2',this.storage,(err, data) => {
if (err.code) {
console.error('Failed to load the content. Cause:' + JSON.stringify(err));
return;
......@@ -1859,10 +1859,10 @@ class myAbility extends Ability {
storage : LocalStorage
onWindowStageCreate(windowStage) {
this.storage = new LocalStorage();
this.storage.setOrCreate("storageSimpleProp",121);
this.storage.setOrCreate('storageSimpleProp',121);
console.log('onWindowStageCreate');
var windowClass = null;
let promise = windowStage.loadContent("pages/page2",this.storage);
let windowClass = null;
let promise = windowStage.loadContent('pages/page2',this.storage);
promise.then((data)=> {
windowClass = data;
console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data));
......@@ -2195,7 +2195,7 @@ Unsubscribes from screenshot events.
**Example**
```js
var callback = ()=>{
let callback = ()=>{
console.info('screenshot happened');
}
windowClass.on('screenshot', callback)
......@@ -2272,7 +2272,7 @@ Binds the modal window to the target window, and adds a callback to listen for m
```js
class MyDeathRecipient {
onRemoteDied() {
console.log("server died");
console.log('server died');
}
}
class TestRemoteObject extends rpc.RemoteObject {
......@@ -2289,7 +2289,7 @@ class TestRemoteObject extends rpc.RemoteObject {
return false;
}
}
let token = new TestRemoteObject("testObject");
let token = new TestRemoteObject('testObject');
windowClass.bindDialogTarget(token, () => {
console.info('Dialog Window Need Destroy.');
}, (err, data) => {
......@@ -2329,7 +2329,7 @@ Binds the modal window to the target window, and adds a callback to listen for m
```js
class MyDeathRecipient {
onRemoteDied() {
console.log("server died");
console.log('server died');
}
}
class TestRemoteObject extends rpc.RemoteObject {
......@@ -2346,7 +2346,7 @@ class TestRemoteObject extends rpc.RemoteObject {
return false;
}
}
let token = new TestRemoteObject("testObject");
let token = new TestRemoteObject('testObject');
let promise = windowClass.bindDialogTarget(token, () => {
console.info('Dialog Window Need Destroy.');
});
......@@ -2535,7 +2535,7 @@ Sets the background color for this window. This API uses an asynchronous callbac
**Example**
```js
var color = '#00ff33';
let color = '#00ff33';
windowClass.setBackgroundColor(color, (err, data) => {
if (err.code) {
console.error('Failed to set the background color. Cause: ' + JSON.stringify(err));
......@@ -2568,7 +2568,7 @@ Sets the background color for this window. This API uses a promise to return the
**Example**
```js
var color = '#00ff33';
let color = '#00ff33';
let promise = windowClass.setBackgroundColor(color);
promise.then((data)=> {
console.info('Succeeded in setting the background color. Data: ' + JSON.stringify(data));
......@@ -2596,7 +2596,7 @@ Wakes up the screen.
**Example**
```js
var wakeUp = true;
let wakeUp = true;
windowClass.setWakeUpScreen(wakeUp);
```
......@@ -2618,7 +2618,7 @@ Sets the screen brightness for this window. This API uses an asynchronous callba
**Example**
```js
var brightness = 1;
let brightness = 1;
windowClass.setBrightness(brightness, (err, data) => {
if (err.code) {
console.error('Failed to set the brightness. Cause: ' + JSON.stringify(err));
......@@ -2651,7 +2651,7 @@ Sets the screen brightness for this window. This API uses a promise to return th
**Example**
```js
var brightness = 1;
let brightness = 1;
let promise = windowClass.setBrightness(brightness);
promise.then((data)=> {
console.info('Succeeded in setting the brightness. Data: ' + JSON.stringify(data));
......@@ -2748,7 +2748,7 @@ Sets whether this window can gain focus. This API uses an asynchronous callback
**Example**
```js
var isFocusable= true;
let isFocusable= true;
windowClass.setFocusable(isFocusable, (err, data) => {
if (err.code) {
console.error('Failed to set the window to be focusable. Cause:' + JSON.stringify(err));
......@@ -2781,7 +2781,7 @@ Sets whether this window can gain focus. This API uses a promise to return the r
**Example**
```js
var isFocusable= true;
let isFocusable= true;
let promise = windowClass.setFocusable(isFocusable);
promise.then((data)=> {
console.info('Succeeded in setting the window to be focusable. Data: ' + JSON.stringify(data));
......@@ -2808,7 +2808,7 @@ Sets whether to keep the screen always on. This API uses an asynchronous callbac
**Example**
```js
var isKeepScreenOn = true;
let isKeepScreenOn = true;
windowClass.setKeepScreenOn(isKeepScreenOn, (err, data) => {
if (err.code) {
console.error('Failed to set the screen to be always on. Cause: ' + JSON.stringify(err));
......@@ -2841,7 +2841,7 @@ Sets whether to keep the screen always on. This API uses a promise to return the
**Example**
```js
var isKeepScreenOn = true;
let isKeepScreenOn = true;
let promise = windowClass.setKeepScreenOn(isKeepScreenOn);
promise.then((data) => {
console.info('Succeeded in setting the screen to be always on. Data: ' + JSON.stringify(data));
......@@ -2938,7 +2938,7 @@ Sets whether this window is in privacy mode. This API uses an asynchronous callb
**Example**
```js
var isPrivacyMode = true;
let isPrivacyMode = true;
windowClass.setPrivacyMode(isPrivacyMode, (err, data) => {
if (err.code) {
console.error('Failed to set the window to privacy mode. Cause:' + JSON.stringify(err));
......@@ -2972,7 +2972,7 @@ Sets whether this window is in privacy mode. This API uses a promise to return t
**Example**
```js
var isPrivacyMode = true;
let isPrivacyMode = true;
let promise = windowClass.setPrivacyMode(isPrivacyMode);
promise.then((data)=> {
console.info('Succeeded in setting the window to privacy mode. Data: ' + JSON.stringify(data));
......@@ -2996,7 +2996,7 @@ Sets whether to ignore this window during screen capturing or recording.
| ------------- | ------- | ---- | -------------------- |
| isSkip | boolean | Yes | Whether to ignore the window. The default value is `false`.<br>The value `true` means that the window is ignored, and `false` means the opposite.<br>|
```js
var isSkip = true;
let isSkip = true;
windowClass.setSnapshotSkip(isSkip);
```
......@@ -3018,7 +3018,7 @@ Sets whether this window is touchable. This API uses an asynchronous callback to
**Example**
```js
var isTouchable = true;
let isTouchable = true;
windowClass.setTouchable(isTouchable, (err, data) => {
if (err.code) {
console.error('Failed to set the window to be touchable. Cause:' + JSON.stringify(err));
......@@ -3052,7 +3052,7 @@ Sets whether this window is touchable. This API uses a promise to return the res
**Example**
```js
var isTouchable = true;
let isTouchable = true;
let promise = windowClass.setTouchable(isTouchable);
promise.then((data)=> {
console.info('Succeeded in setting the window to be touchable. Data: ' + JSON.stringify(data));
......@@ -3081,7 +3081,7 @@ Sets whether this window is forbidden to move in split-screen mode. This API use
**Example**
```js
var isForbidSplitMove = true;
let isForbidSplitMove = true;
windowClass.setForbidSplitMove(isForbidSplitMove, (err, data) => {
if (err.code) {
console.error('Failed to forbid window moving in split screen mode. Cause:' + JSON.stringify(err));
......@@ -3117,7 +3117,7 @@ Sets whether this window is forbidden to move in split-screen mode. This API use
**Example**
```js
var isForbidSplitMove = true;
let isForbidSplitMove = true;
let promise = windowClass.setForbidSplitMove(isForbidSplitMove);
promise.then((data)=> {
console.info('Succeeded in forbidding window moving in split screen mode. Data: ' + JSON.stringify(data));
......@@ -3333,7 +3333,7 @@ Sets the scale parameters for this window.
**Example**
```js
var obj : window.ScaleOptions = {
let obj : window.ScaleOptions = {
x : 2.0,
y : 1.0,
pivotX = 0.5;
......@@ -3361,7 +3361,7 @@ Sets the rotation parameters for this window.
**Example**
```js
var obj : window.RotateOptions = {
let obj : window.RotateOptions = {
x : 1.0,
y : 1.0,
z : 45.0,
......@@ -3390,7 +3390,7 @@ Sets the translation parameters for this window.
**Example**
```js
var obj : window.TranslateOptions = {
let obj : window.TranslateOptions = {
x : 100.0,
y : 0.0,
z : 0.0
......@@ -3431,7 +3431,7 @@ controller.animationForHidden = (context : window.TransitionContext) => {
context.completeTransition(true)
}
}, () => {
var obj : window.TranslateOptions = {
let obj : window.TranslateOptions = {
x : 100.0,
y : 0.0,
z : 0.0
......@@ -3495,7 +3495,7 @@ import Ability from '@ohos.application.Ability';
class myAbility extends Ability {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
var windowClass = null;
let windowClass = null;
windowStage.getMainWindow((err, data) => {
if (err.code) {
console.error('Failed to obtain the main window. Cause: ' + JSON.stringify(err));
......@@ -3530,7 +3530,7 @@ import Ability from '@ohos.application.Ability';
class myAbility extends Ability {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
var windowClass = null;
let windowClass = null;
let promise = windowStage.getMainWindow();
promise.then((data)=> {
windowClass = data;
......@@ -3565,8 +3565,8 @@ import Ability from '@ohos.application.Ability';
class myAbility extends Ability {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
var windowClass = null;
windowStage.createSubWindow("mySubWindow", (err, data) => {
let windowClass = null;
windowStage.createSubWindow('mySubWindow', (err, data) => {
if (err.code) {
console.error('Failed to create the subwindow. Cause: ' + JSON.stringify(err));
return;
......@@ -3607,8 +3607,8 @@ import Ability from '@ohos.application.Ability';
class myAbility extends Ability {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
var windowClass = null;
let promise = windowStage.createSubWindow("mySubWindow");
let windowClass = null;
let promise = windowStage.createSubWindow('mySubWindow');
promise.then((data)=> {
windowClass = data;
console.info('Succeeded in creating the subwindow. Data: ' + JSON.stringify(data));
......@@ -3641,7 +3641,7 @@ import Ability from '@ohos.application.Ability';
class myAbility extends Ability {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
var windowClass = null;
let windowClass = null;
windowStage.getSubWindow((err, data) => {
if (err.code) {
console.error('Failed to obtain the subwindow. Cause: ' + JSON.stringify(err));
......@@ -3676,7 +3676,7 @@ import Ability from '@ohos.application.Ability';
class myAbility extends Ability {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
var windowClass = null;
let windowClass = null;
let promise = windowStage.getSubWindow();
promise.then((data)=> {
windowClass = data;
......@@ -3713,9 +3713,9 @@ class myAbility extends Ability {
storage : LocalStorage
onWindowStageCreate(windowStage) {
this.storage = new LocalStorage();
this.storage.setOrCreate("storageSimpleProp",121);
this.storage.setOrCreate('storageSimpleProp',121);
console.log('onWindowStageCreate');
windowStage.loadContent("pages/page2",this.storage,(err, data) => {
windowStage.loadContent('pages/page2',this.storage,(err, data) => {
if (err.code) {
console.error('Failed to load the content. Cause:' + JSON.stringify(err));
return;
......@@ -3757,10 +3757,10 @@ class myAbility extends Ability {
storage : LocalStorage
onWindowStageCreate(windowStage) {
this.storage = new LocalStorage();
this.storage.setOrCreate("storageSimpleProp",121);
this.storage.setOrCreate('storageSimpleProp',121);
console.log('onWindowStageCreate');
var windowClass = null;
let promise = windowStage.loadContent("pages/page2",this.storage);
let windowClass = null;
let promise = windowStage.loadContent('pages/page2',this.storage);
promise.then((data)=> {
windowClass = data;
console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data));
......@@ -3795,7 +3795,7 @@ import Ability from '@ohos.application.Ability';
class myAbility extends Ability {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
windowStage.loadContent("pages/page2", (err, data) => {
windowStage.loadContent('pages/page2', (err, data) => {
if (err.code) {
console.error('Failed to load the content. Cause:' + JSON.stringify(err));
return;
......@@ -3963,7 +3963,7 @@ controller.animationForShown = (context : window.TransitionContext) => {
iterations: 1, // Number of playback times.
playMode: PlayMode.Normal // Animation playback mode.
}, () => {
var obj : window.TranslateOptions = {
let obj : window.TranslateOptions = {
x : 100.0,
y : 0.0,
z : 0.0
......@@ -4014,7 +4014,7 @@ controller.animationForShown = (context : window.TransitionContext) => {
context.completeTransition(true)
}
}, () => {
var obj : window.TranslateOptions = {
let obj : window.TranslateOptions = {
x : 100.0,
y : 0.0,
z : 0.0
......@@ -4060,7 +4060,7 @@ controller.animationForHidden = (context : window.TransitionContext) => {
context.completeTransition(true)
}
}, () => {
var obj : window.TranslateOptions = {
let obj : window.TranslateOptions = {
x : 100.0,
y : 0.0,
z : 0.0
......
......@@ -2,7 +2,6 @@
The **WindowAnimationManager** module provides APIs to listen for application start/exit events and window minimization/maximization events and associate animations with these events.
> **NOTE**
>
> The APIs of this module are supported since API version 9. Updates will be marked with a superscript to indicate their earliest API version.
>
> The APIs provided by this module are system APIs.
......@@ -32,7 +31,7 @@ Before using other APIs of **windowAnimationManager**, you must call this API to
**Example**
```js
var controller = {
let controller = {
onStartAppFromLauncher(startingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void {
console.log('onStartAppFromLauncher, the startingWindowTarget is: ' + startingWindowTarget);
finishCallback.onAnimationFinish();
......@@ -89,8 +88,8 @@ Minimizes the window that displays the animation. This API uses an asynchronous
**Example**
```js
var target: WindowAnimationTarget = undefined;
var controller = {
let target: WindowAnimationTarget = undefined;
let controller = {
onStartAppFromLauncher(startingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void {
console.log('onStartAppFromLauncher, the startingWindowTarget is: ' + startingWindowTarget);
finishCallback.onAnimationFinish();
......@@ -128,7 +127,7 @@ var controller = {
windowAnimationManager.setController(controller)
var finishedCallback = null;
let finishedCallback = null;
windowAnimationManager.minimizeWindowWithAnimation(target, (err, data) => {
if (err.code) {
console.error('Failed to minimize the window target. Cause: ' + JSON.stringify(err));
......@@ -165,8 +164,8 @@ Minimizes the window that displays the animation. This API uses a promise to ret
**Example**
```js
var target: WindowAnimationTarget = undefined;
var controller = {
let target: WindowAnimationTarget = undefined;
let controller = {
onStartAppFromLauncher(startingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void {
console.log('onStartAppFromLauncher, the startingWindowTarget is: ' + startingWindowTarget);
finishCallback.onAnimationFinish();
......
......@@ -339,8 +339,8 @@ let strXml =
let arrayBuffer = new ArrayBuffer(strXml.length);
let bufView = new Uint8Array(arrayBuffer);
let strLen = strXml.length;
for (var i = 0; i < strLen; ++i) {
bufView[i] = strXml.charCodeAt(i);
for (var tmp = 0; tmp < strLen; ++tmp) {
bufView[tmp] = strXml.charCodeAt(tmp);
}
let that = new xml.XmlPullParser(arrayBuffer);
let arrTag = {};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册