提交 cb4606f0 编写于 作者: Z zhengjiangliang

doc文档示例代码整改

Change-Id: I575b55db46ebae64b56392192773eab0ff73ce08
Signed-off-by: Nzhengjiangliang <zhengjiangliang@huawei.com>
上级 edf2468e
...@@ -94,7 +94,7 @@ try { ...@@ -94,7 +94,7 @@ try {
displayClass = display.getDefaultDisplaySync(); displayClass = display.getDefaultDisplaySync();
} catch (exception) { } catch (exception) {
console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception)); console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception));
}; }
``` ```
## display.getAllDisplays<sup>9+</sup> ## display.getAllDisplays<sup>9+</sup>
...@@ -204,25 +204,24 @@ hasPrivateWindow(displayId: number): boolean ...@@ -204,25 +204,24 @@ hasPrivateWindow(displayId: number): boolean
let displayClass = null; let displayClass = null;
try { try {
displayClass = display.getDefaultDisplaySync(); displayClass = display.getDefaultDisplaySync();
} catch (exception) {
console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception));
return;
};
let ret = undefined; let ret = undefined;
try { try {
ret = display.hasPrivateWindow(displayClass.id); ret = display.hasPrivateWindow(displayClass.id);
} catch (exception) {
console.error('Failed to check has privateWindow or not. Code: ' + JSON.stringify(exception));
}
if (ret == undefined) {
console.log("Failed to check has privateWindow or not.");
}
if (ret) {
console.log("There has privateWindow.");
} else if (!ret) {
console.log("There has no privateWindow.");
}
} catch (exception) { } catch (exception) {
console.error('Failed to check has privateWindow or not. Code: ' + JSON.stringify(exception)); console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception));
};
if (ret == undefined) {
console.log("Failed to check has privateWindow or not.");
} }
if (ret) {
console.log("There has privateWindow.");
} else if (!ret) {
console.log("There has no privateWindow.");
};
``` ```
## display.on('add'|'remove'|'change') ## display.on('add'|'remove'|'change')
...@@ -250,7 +249,7 @@ try { ...@@ -250,7 +249,7 @@ try {
display.on("add", callback); display.on("add", callback);
} catch (exception) { } catch (exception) {
console.error('Failed to register callback. Code: ' + JSON.stringify(exception)); console.error('Failed to register callback. Code: ' + JSON.stringify(exception));
}; }
``` ```
## display.off('add'|'remove'|'change') ## display.off('add'|'remove'|'change')
...@@ -275,7 +274,7 @@ try { ...@@ -275,7 +274,7 @@ try {
display.off("remove"); display.off("remove");
} catch (exception) { } catch (exception) {
console.error('Failed to unregister callback. Code: ' + JSON.stringify(exception)); console.error('Failed to unregister callback. Code: ' + JSON.stringify(exception));
}; }
``` ```
## display.getDefaultDisplay<sup>(deprecated)</sup> ## display.getDefaultDisplay<sup>(deprecated)</sup>
...@@ -450,17 +449,17 @@ getCutoutInfo(callback: AsyncCallback&lt;CutoutInfo&gt;): void ...@@ -450,17 +449,17 @@ getCutoutInfo(callback: AsyncCallback&lt;CutoutInfo&gt;): void
let displayClass = null; let displayClass = null;
try { try {
displayClass = display.getDefaultDisplaySync(); displayClass = display.getDefaultDisplaySync();
displayClass.getCutoutInfo((err, data) => {
if (err.code) {
console.error('Failed to get cutoutInfo. Code: ' + JSON.stringify(err));
return;
}
console.info('Succeeded in getting cutoutInfo. data: ' + JSON.stringify(data));
});
} catch (exception) { } catch (exception) {
console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception)); console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception));
}; }
displayClass.getCutoutInfo((err, data) => {
if (err.code) {
console.error('Failed to get cutoutInfo. Code: ' + JSON.stringify(err));
return;
}
console.info('Succeeded in getting cutoutInfo. data: ' + JSON.stringify(data));
});
``` ```
### getCutoutInfo<sup>9+</sup> ### getCutoutInfo<sup>9+</sup>
getCutoutInfo(): Promise&lt;CutoutInfo&gt; getCutoutInfo(): Promise&lt;CutoutInfo&gt;
...@@ -489,12 +488,14 @@ getCutoutInfo(): Promise&lt;CutoutInfo&gt; ...@@ -489,12 +488,14 @@ getCutoutInfo(): Promise&lt;CutoutInfo&gt;
let displayClass = null; let displayClass = null;
try { try {
displayClass = display.getDefaultDisplaySync(); displayClass = display.getDefaultDisplaySync();
let promise = displayClass.getCutoutInfo();
promise.then((data) => {
console.info('Succeeded in getting cutoutInfo. Data: ' + JSON.stringify(data));
}).catch((err) => {
console.error('Failed to obtain all the display objects. Code: ' + JSON.stringify(err));
});
} catch (exception) { } catch (exception) {
console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception)); console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception));
}; }
let promise = displayClass.getCutoutInfo();
promise.then((data) => {
console.info('Succeeded in getting cutoutInfo. Data: ' + JSON.stringify(data));
});
``` ```
...@@ -339,7 +339,7 @@ try { ...@@ -339,7 +339,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to create the window. Cause: ' + JSON.stringify(exception)); console.error('Failed to create the window. Cause: ' + JSON.stringify(exception));
}; }
``` ```
## window.createWindow<sup>9+</sup> ## window.createWindow<sup>9+</sup>
...@@ -386,7 +386,7 @@ try { ...@@ -386,7 +386,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to create the window. Cause: ' + JSON.stringify(exception)); console.error('Failed to create the window. Cause: ' + JSON.stringify(exception));
}; }
``` ```
## window.findWindow<sup>9+</sup> ## window.findWindow<sup>9+</sup>
...@@ -412,11 +412,12 @@ findWindow(name: string): Window ...@@ -412,11 +412,12 @@ findWindow(name: string): Window
**示例:** **示例:**
```js ```js
let windowClass = null;
try { try {
let windowClass = window.findWindow('alertWindow'); windowClass = window.findWindow('alertWindow');
} catch (exception) { } catch (exception) {
console.error('Failed to find the Window. Cause: ' + JSON.stringify(exception)); console.error('Failed to find the Window. Cause: ' + JSON.stringify(exception));
}; }
``` ```
## window.getLastWindow<sup>9+</sup> ## window.getLastWindow<sup>9+</sup>
...@@ -458,7 +459,7 @@ try { ...@@ -458,7 +459,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(exception)); console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(exception));
}; }
``` ```
## window.getLastWindow<sup>9+</sup> ## window.getLastWindow<sup>9+</sup>
...@@ -504,7 +505,7 @@ try { ...@@ -504,7 +505,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(exception)); console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(exception));
}; }
``` ```
## window.minimizeAll<sup>9+</sup> ## window.minimizeAll<sup>9+</sup>
...@@ -535,26 +536,25 @@ minimizeAll(id: number, callback: AsyncCallback&lt;void&gt;): void ...@@ -535,26 +536,25 @@ minimizeAll(id: number, callback: AsyncCallback&lt;void&gt;): void
```js ```js
import display from '@ohos.display' import display from '@ohos.display'
import window from '@ohos.window'
let displayClass = null;
try { try {
displayClass = display.getDefaultDisplaySync(); displayClass = display.getDefaultDisplaySync();
} catch (exception) {
console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception));
return;
};
try { try {
window.minimizeAll(displayClass.id, (err) => { window.minimizeAll(displayClass.id, (err) => {
if(err.code) { if(err.code) {
console.error('Failed to minimize all windows. Cause: ' + JSON.stringify(err)); console.error('Failed to minimize all windows. Cause: ' + JSON.stringify(err));
return; return;
} }
console.info('Succeeded in minimizing all windows.'); console.info('Succeeded in minimizing all windows.');
}); });
} catch (exception) {
console.error('Failed to minimize all windows. Cause: ' + JSON.stringify(exception));
}
} catch (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.minimizeAll<sup>9+</sup> ## window.minimizeAll<sup>9+</sup>
...@@ -590,26 +590,24 @@ minimizeAll(id: number): Promise&lt;void&gt; ...@@ -590,26 +590,24 @@ minimizeAll(id: number): Promise&lt;void&gt;
```js ```js
import display from '@ohos.display' import display from '@ohos.display'
import window from '@ohos.window'
let displayClass = null; let displayClass = null;
try { try {
displayClass = display.getDefaultDisplaySync(); displayClass = display.getDefaultDisplaySync();
} catch (exception) {
console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception));
return;
};
try { try {
let promise = window.minimizeAll(displayClass.id); let promise = window.minimizeAll(displayClass.id);
promise.then(()=> { promise.then(()=> {
console.info('Succeeded in minimizing all windows.'); console.info('Succeeded in minimizing all windows.');
}).catch((err)=>{ }).catch((err)=>{
console.error('Failed to minimize all windows. Cause: ' + JSON.stringify(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) { } 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.toggleShownStateForAllAppWindows<sup>9+</sup> ## window.toggleShownStateForAllAppWindows<sup>9+</sup>
...@@ -644,7 +642,7 @@ window.toggleShownStateForAllAppWindows((err) => { ...@@ -644,7 +642,7 @@ window.toggleShownStateForAllAppWindows((err) => {
return; return;
} }
console.info('Succeeded in toggling shown state for all app windows.'); console.info('Succeeded in toggling shown state for all app windows.');
}) });
``` ```
## window.toggleShownStateForAllAppWindows<sup>9+</sup> ## window.toggleShownStateForAllAppWindows<sup>9+</sup>
...@@ -678,7 +676,7 @@ promise.then(()=> { ...@@ -678,7 +676,7 @@ promise.then(()=> {
console.info('Succeeded in toggling shown state for all app windows.'); console.info('Succeeded in toggling shown state for all app windows.');
}).catch((err)=>{ }).catch((err)=>{
console.error('Failed to toggle shown state for all app windows. Cause: ' + JSON.stringify(err)); console.error('Failed to toggle shown state for all app windows. Cause: ' + JSON.stringify(err));
}) });
``` ```
## window.setWindowLayoutMode<sup>9+</sup> ## window.setWindowLayoutMode<sup>9+</sup>
...@@ -718,7 +716,7 @@ try { ...@@ -718,7 +716,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set window layout mode. Cause: ' + JSON.stringify(exception)); console.error('Failed to set window layout mode. Cause: ' + JSON.stringify(exception));
}; }
``` ```
## window.setWindowLayoutMode<sup>9+</sup> ## window.setWindowLayoutMode<sup>9+</sup>
...@@ -762,7 +760,7 @@ try { ...@@ -762,7 +760,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set window layout mode. Cause: ' + JSON.stringify(exception)); console.error('Failed to set window layout mode. Cause: ' + JSON.stringify(exception));
}; }
``` ```
## window.on('systemBarTintChange')<sup>8+</sup> ## window.on('systemBarTintChange')<sup>8+</sup>
...@@ -791,7 +789,7 @@ try { ...@@ -791,7 +789,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to enable the listener for systemBarTint changes. Cause: ' + JSON.stringify(exception)); console.error('Failed to enable the listener for systemBarTint changes. Cause: ' + JSON.stringify(exception));
}; }
``` ```
## window.off('systemBarTintChange')<sup>8+</sup> ## window.off('systemBarTintChange')<sup>8+</sup>
...@@ -818,7 +816,7 @@ try { ...@@ -818,7 +816,7 @@ try {
window.off('systemBarTintChange'); window.off('systemBarTintChange');
} catch (exception) { } catch (exception) {
console.error('Failed to disable the listener for systemBarTint changes. Cause: ' + JSON.stringify(exception)); console.error('Failed to disable the listener for systemBarTint changes. Cause: ' + JSON.stringify(exception));
}; }
``` ```
## window.create<sup>(deprecated)</sup> ## window.create<sup>(deprecated)</sup>
...@@ -1110,7 +1108,7 @@ promise.then((data)=> { ...@@ -1110,7 +1108,7 @@ promise.then((data)=> {
console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data));
}).catch((err)=>{ }).catch((err)=>{
console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(err)); console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(err));
}) });
``` ```
## window.getTopWindow<sup>(deprecated)</sup> ## window.getTopWindow<sup>(deprecated)</sup>
...@@ -1180,7 +1178,7 @@ promise.then((data)=> { ...@@ -1180,7 +1178,7 @@ promise.then((data)=> {
console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data)); console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data));
}).catch((err)=>{ }).catch((err)=>{
console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(err)); console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(err));
}) });
``` ```
## Window ## Window
...@@ -1222,7 +1220,7 @@ windowClass.hide((err) => { ...@@ -1222,7 +1220,7 @@ windowClass.hide((err) => {
return; return;
} }
console.info('Succeeded in hiding the window.'); console.info('Succeeded in hiding the window.');
}) });
``` ```
### hide<sup>7+</sup> ### hide<sup>7+</sup>
...@@ -1257,7 +1255,7 @@ promise.then(()=> { ...@@ -1257,7 +1255,7 @@ promise.then(()=> {
console.info('Succeeded in hiding the window.'); console.info('Succeeded in hiding the window.');
}).catch((err)=>{ }).catch((err)=>{
console.error('Failed to hide the window. Cause: ' + JSON.stringify(err)); console.error('Failed to hide the window. Cause: ' + JSON.stringify(err));
}) });
``` ```
### hideWithAnimation<sup>9+</sup> ### hideWithAnimation<sup>9+</sup>
...@@ -1295,7 +1293,7 @@ windowClass.hideWithAnimation((err) => { ...@@ -1295,7 +1293,7 @@ windowClass.hideWithAnimation((err) => {
return; return;
} }
console.info('Succeeded in hiding the window with animation.'); console.info('Succeeded in hiding the window with animation.');
}) });
``` ```
### hideWithAnimation<sup>9+</sup> ### hideWithAnimation<sup>9+</sup>
...@@ -1332,7 +1330,7 @@ promise.then(()=> { ...@@ -1332,7 +1330,7 @@ promise.then(()=> {
console.info('Succeeded in hiding the window with animation.'); console.info('Succeeded in hiding the window with animation.');
}).catch((err)=>{ }).catch((err)=>{
console.error('Failed to hide the window with animation. Cause: ' + JSON.stringify(err)); console.error('Failed to hide the window with animation. Cause: ' + JSON.stringify(err));
}) });
``` ```
### showWindow<sup>9+</sup> ### showWindow<sup>9+</sup>
...@@ -1437,7 +1435,7 @@ windowClass.showWithAnimation((err) => { ...@@ -1437,7 +1435,7 @@ windowClass.showWithAnimation((err) => {
return; return;
} }
console.info('Succeeded in showing the window with animation.'); console.info('Succeeded in showing the window with animation.');
}) });
``` ```
### showWithAnimation<sup>9+</sup> ### showWithAnimation<sup>9+</sup>
...@@ -1474,7 +1472,7 @@ promise.then(()=> { ...@@ -1474,7 +1472,7 @@ promise.then(()=> {
console.info('Succeeded in showing the window with animation.'); console.info('Succeeded in showing the window with animation.');
}).catch((err)=>{ }).catch((err)=>{
console.error('Failed to show the window with animation. Cause: ' + JSON.stringify(err)); console.error('Failed to show the window with animation. Cause: ' + JSON.stringify(err));
}) });
``` ```
### destroyWindow<sup>9+</sup> ### destroyWindow<sup>9+</sup>
...@@ -1509,7 +1507,7 @@ windowClass.destroyWindow((err) => { ...@@ -1509,7 +1507,7 @@ windowClass.destroyWindow((err) => {
return; return;
} }
console.info('Succeeded in destroying the window.'); console.info('Succeeded in destroying the window.');
}) });
``` ```
### destroyWindow<sup>9+</sup> ### destroyWindow<sup>9+</sup>
...@@ -1543,7 +1541,7 @@ promise.then(()=> { ...@@ -1543,7 +1541,7 @@ promise.then(()=> {
console.info('Succeeded in destroying the window.'); console.info('Succeeded in destroying the window.');
}).catch((err)=>{ }).catch((err)=>{
console.error('Failed to destroy the window. Cause: ' + JSON.stringify(err)); console.error('Failed to destroy the window. Cause: ' + JSON.stringify(err));
}) });
``` ```
### moveWindowTo<sup>9+</sup> ### moveWindowTo<sup>9+</sup>
...@@ -1584,7 +1582,7 @@ try { ...@@ -1584,7 +1582,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to move the window. Cause:' + JSON.stringify(exception)); console.error('Failed to move the window. Cause:' + JSON.stringify(exception));
}; }
``` ```
### moveWindowTo<sup>9+</sup> ### moveWindowTo<sup>9+</sup>
...@@ -1629,7 +1627,7 @@ try { ...@@ -1629,7 +1627,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to move the window. Cause:' + JSON.stringify(exception)); console.error('Failed to move the window. Cause:' + JSON.stringify(exception));
}; }
``` ```
### resize<sup>9+</sup> ### resize<sup>9+</sup>
...@@ -1676,7 +1674,7 @@ try { ...@@ -1676,7 +1674,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to change the window size. Cause:' + JSON.stringify(exception)); console.error('Failed to change the window size. Cause:' + JSON.stringify(exception));
}; }
``` ```
### resize<sup>9+</sup> ### resize<sup>9+</sup>
...@@ -1727,7 +1725,7 @@ try { ...@@ -1727,7 +1725,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to change the window size. Cause: ' + JSON.stringify(exception)); console.error('Failed to change the window size. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### setWindowMode<sup>9+</sup> ### setWindowMode<sup>9+</sup>
...@@ -1770,7 +1768,7 @@ try { ...@@ -1770,7 +1768,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set the window mode. Cause: ' + JSON.stringify(exception)); console.error('Failed to set the window mode. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### setWindowMode<sup>9+</sup> ### setWindowMode<sup>9+</sup>
...@@ -1809,7 +1807,7 @@ setWindowMode(mode: WindowMode): Promise&lt;void&gt; ...@@ -1809,7 +1807,7 @@ setWindowMode(mode: WindowMode): Promise&lt;void&gt;
```js ```js
let mode = window.WindowMode.FULLSCREEN; let mode = window.WindowMode.FULLSCREEN;
try { try {
let promise = windowClass.setWindowMode(type); let promise = windowClass.setWindowMode(mode);
promise.then(()=> { promise.then(()=> {
console.info('Succeeded in setting the window mode.'); console.info('Succeeded in setting the window mode.');
}).catch((err)=>{ }).catch((err)=>{
...@@ -1817,7 +1815,7 @@ try { ...@@ -1817,7 +1815,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set the window mode. Cause: ' + JSON.stringify(exception)); console.error('Failed to set the window mode. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### getWindowProperties<sup>9+</sup> ### getWindowProperties<sup>9+</sup>
...@@ -1849,7 +1847,7 @@ try { ...@@ -1849,7 +1847,7 @@ try {
let properties = windowClass.getWindowProperties(); let properties = windowClass.getWindowProperties();
} catch (exception) { } catch (exception) {
console.error('Failed to obtain the window properties. Cause: ' + JSON.stringify(exception)); console.error('Failed to obtain the window properties. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### getWindowAvoidArea<sup>9+</sup> ### getWindowAvoidArea<sup>9+</sup>
...@@ -1888,7 +1886,7 @@ try { ...@@ -1888,7 +1886,7 @@ try {
let avoidArea = windowClass.getWindowAvoidArea(type); let avoidArea = windowClass.getWindowAvoidArea(type);
} catch (exception) { } catch (exception) {
console.error('Failed to obtain the area. Cause:' + JSON.stringify(exception)); console.error('Failed to obtain the area. Cause:' + JSON.stringify(exception));
}; }
``` ```
### setWindowLayoutFullScreen<sup>9+</sup> ### setWindowLayoutFullScreen<sup>9+</sup>
...@@ -1929,7 +1927,7 @@ try { ...@@ -1929,7 +1927,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(exception)); console.error('Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(exception));
}; }
``` ```
### setWindowLayoutFullScreen<sup>9+</sup> ### setWindowLayoutFullScreen<sup>9+</sup>
...@@ -1974,7 +1972,7 @@ try { ...@@ -1974,7 +1972,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(exception)); console.error('Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(exception));
}; }
``` ```
### setWindowSystemBarEnable<sup>9+</sup> ### setWindowSystemBarEnable<sup>9+</sup>
...@@ -2016,7 +2014,7 @@ try { ...@@ -2016,7 +2014,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set the system bar to be invisible. Cause:' + JSON.stringify(exception)); console.error('Failed to set the system bar to be invisible. Cause:' + JSON.stringify(exception));
}; }
``` ```
### setWindowSystemBarEnable<sup>9+</sup> ### setWindowSystemBarEnable<sup>9+</sup>
...@@ -2062,7 +2060,7 @@ try { ...@@ -2062,7 +2060,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set the system bar to be invisible. Cause:' + JSON.stringify(exception)); console.error('Failed to set the system bar to be invisible. Cause:' + JSON.stringify(exception));
}; }
``` ```
### setWindowSystemBarProperties<sup>9+</sup> ### setWindowSystemBarProperties<sup>9+</sup>
...@@ -2092,7 +2090,7 @@ setWindowSystemBarProperties(systemBarProperties: SystemBarProperties, callback: ...@@ -2092,7 +2090,7 @@ setWindowSystemBarProperties(systemBarProperties: SystemBarProperties, callback:
**示例:** **示例:**
```js ```js
let SystemBarProperties={ let SystemBarProperties = {
statusBarColor: '#ff00ff', statusBarColor: '#ff00ff',
navigationBarColor: '#00ff00', navigationBarColor: '#00ff00',
//以下两个属性从API Version8开始支持 //以下两个属性从API Version8开始支持
...@@ -2109,7 +2107,7 @@ try { ...@@ -2109,7 +2107,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set the system bar properties. Cause: ' + JSON.stringify(exception)); console.error('Failed to set the system bar properties. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### setWindowSystemBarProperties<sup>9+</sup> ### setWindowSystemBarProperties<sup>9+</sup>
...@@ -2144,7 +2142,7 @@ setWindowSystemBarProperties(systemBarProperties: SystemBarProperties): Promise& ...@@ -2144,7 +2142,7 @@ setWindowSystemBarProperties(systemBarProperties: SystemBarProperties): Promise&
**示例:** **示例:**
```js ```js
let SystemBarProperties={ let SystemBarProperties = {
statusBarColor: '#ff00ff', statusBarColor: '#ff00ff',
navigationBarColor: '#00ff00', navigationBarColor: '#00ff00',
//以下两个属性从API Version8开始支持 //以下两个属性从API Version8开始支持
...@@ -2160,7 +2158,7 @@ try { ...@@ -2160,7 +2158,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set the system bar properties. Cause: ' + JSON.stringify(exception)); console.error('Failed to set the system bar properties. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### setPreferredOrientation<sup>9+</sup> ### setPreferredOrientation<sup>9+</sup>
...@@ -2200,7 +2198,7 @@ try { ...@@ -2200,7 +2198,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set window orientation. Cause: ' + JSON.stringify(exception)); console.error('Failed to set window orientation. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### setPreferredOrientation<sup>9+</sup> ### setPreferredOrientation<sup>9+</sup>
...@@ -2244,7 +2242,7 @@ try { ...@@ -2244,7 +2242,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set window orientation. Cause: ' + JSON.stringify(exception)); console.error('Failed to set window orientation. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### setUIContent<sup>9+</sup> ### setUIContent<sup>9+</sup>
...@@ -2284,7 +2282,7 @@ try { ...@@ -2284,7 +2282,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to load the content. Cause:' + JSON.stringify(exception)); console.error('Failed to load the content. Cause:' + JSON.stringify(exception));
}; }
``` ```
### setUIContent<sup>9+</sup> ### setUIContent<sup>9+</sup>
...@@ -2328,7 +2326,7 @@ try { ...@@ -2328,7 +2326,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to load the content. Cause: ' + JSON.stringify(exception)); console.error('Failed to load the content. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### loadContent<sup>9+</sup> ### loadContent<sup>9+</sup>
...@@ -2374,7 +2372,7 @@ try { ...@@ -2374,7 +2372,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to load the content. Cause:' + JSON.stringify(exception)); console.error('Failed to load the content. Cause:' + JSON.stringify(exception));
}; }
``` ```
### loadContent<sup>9+</sup> ### loadContent<sup>9+</sup>
...@@ -2424,7 +2422,7 @@ try { ...@@ -2424,7 +2422,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to load the content. Cause:' + JSON.stringify(exception)); console.error('Failed to load the content. Cause:' + JSON.stringify(exception));
}; }
``` ```
### isWindowShowing<sup>9+</sup> ### isWindowShowing<sup>9+</sup>
...@@ -2457,7 +2455,7 @@ try { ...@@ -2457,7 +2455,7 @@ try {
console.info('Succeeded in checking whether the window is showing. Data: ' + JSON.stringify(data)); console.info('Succeeded in checking whether the window is showing. Data: ' + JSON.stringify(data));
} catch (exception) { } catch (exception) {
console.error('Failed to check whether the window is showing. Cause: ' + JSON.stringify(exception)); console.error('Failed to check whether the window is showing. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### on('windowSizeChange')<sup>7+</sup> ### on('windowSizeChange')<sup>7+</sup>
...@@ -2484,7 +2482,7 @@ try { ...@@ -2484,7 +2482,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to enable the listener for window size changes. Cause: ' + JSON.stringify(exception)); console.error('Failed to enable the listener for window size changes. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### off('windowSizeChange')<sup>7+</sup> ### off('windowSizeChange')<sup>7+</sup>
...@@ -2509,7 +2507,7 @@ try { ...@@ -2509,7 +2507,7 @@ try {
windowClass.off('windowSizeChange'); windowClass.off('windowSizeChange');
} catch (exception) { } catch (exception) {
console.error('Failed to disable the listener for window size changes. Cause: ' + JSON.stringify(exception)); console.error('Failed to disable the listener for window size changes. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### on('avoidAreaChange')<sup>9+</sup> ### on('avoidAreaChange')<sup>9+</sup>
...@@ -2537,7 +2535,7 @@ try { ...@@ -2537,7 +2535,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to enable the listener for system avoid area changes. Cause: ' + JSON.stringify(exception)); console.error('Failed to enable the listener for system avoid area changes. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### off('avoidAreaChange')<sup>9+</sup> ### off('avoidAreaChange')<sup>9+</sup>
...@@ -2562,7 +2560,7 @@ try { ...@@ -2562,7 +2560,7 @@ try {
windowClass.off('avoidAreaChange'); windowClass.off('avoidAreaChange');
} catch (exception) { } catch (exception) {
console.error('Failed to disable the listener for system avoid area changes. Cause: ' + JSON.stringify(exception)); console.error('Failed to disable the listener for system avoid area changes. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### on('keyboardHeightChange')<sup>7+</sup> ### on('keyboardHeightChange')<sup>7+</sup>
...@@ -2589,7 +2587,7 @@ try { ...@@ -2589,7 +2587,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to enable the listener for keyboard height changes. Cause: ' + JSON.stringify(exception)); console.error('Failed to enable the listener for keyboard height changes. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### off('keyboardHeightChange')<sup>7+</sup> ### off('keyboardHeightChange')<sup>7+</sup>
...@@ -2614,7 +2612,7 @@ try { ...@@ -2614,7 +2612,7 @@ try {
windowClass.off('keyboardHeightChange'); windowClass.off('keyboardHeightChange');
} catch (exception) { } catch (exception) {
console.error('Failed to disable the listener for keyboard height changes. Cause: ' + JSON.stringify(exception)); console.error('Failed to disable the listener for keyboard height changes. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### on('touchOutside')<sup>9+</sup> ### on('touchOutside')<sup>9+</sup>
...@@ -2643,7 +2641,7 @@ try { ...@@ -2643,7 +2641,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to register callback. Cause: ' + JSON.stringify(exception)); console.error('Failed to register callback. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### off('touchOutside')<sup>9+</sup> ### off('touchOutside')<sup>9+</sup>
...@@ -2670,7 +2668,7 @@ try { ...@@ -2670,7 +2668,7 @@ try {
windowClass.off('touchOutside'); windowClass.off('touchOutside');
} catch (exception) { } catch (exception) {
console.error('Failed to unregister callback. Cause: ' + JSON.stringify(exception)); console.error('Failed to unregister callback. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### on('screenshot')<sup>9+</sup> ### on('screenshot')<sup>9+</sup>
...@@ -2697,7 +2695,7 @@ try { ...@@ -2697,7 +2695,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to register callback. Cause: ' + JSON.stringify(exception)); console.error('Failed to register callback. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### off('screenshot')<sup>9+</sup> ### off('screenshot')<sup>9+</sup>
...@@ -2718,21 +2716,21 @@ off(type: 'screenshot', callback?: Callback&lt;void&gt;): void ...@@ -2718,21 +2716,21 @@ off(type: 'screenshot', callback?: Callback&lt;void&gt;): void
**示例:** **示例:**
```js ```js
let callback = ()=>{ let callback = () => {
console.info('screenshot happened'); console.info('screenshot happened');
}; };
try { try {
windowClass.on('screenshot', callback); windowClass.on('screenshot', callback);
} catch (exception) { } catch (exception) {
console.error('Failed to register callback. Cause: ' + JSON.stringify(exception)); console.error('Failed to register callback. Cause: ' + JSON.stringify(exception));
}; }
try { try {
windowClass.off('screenshot', callback); windowClass.off('screenshot', callback);
// 如果通过on开启多个callback进行监听,同时关闭所有监听: // 如果通过on开启多个callback进行监听,同时关闭所有监听:
windowClass.off('screenshot'); windowClass.off('screenshot');
} catch (exception) { } catch (exception) {
console.error('Failed to unregister callback. Cause: ' + JSON.stringify(exception)); console.error('Failed to unregister callback. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### on('dialogTargetTouch')<sup>9+</sup> ### on('dialogTargetTouch')<sup>9+</sup>
...@@ -2759,7 +2757,7 @@ try { ...@@ -2759,7 +2757,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to register callback. Cause: ' + JSON.stringify(exception)); console.error('Failed to register callback. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### off('dialogTargetTouch')<sup>9+</sup> ### off('dialogTargetTouch')<sup>9+</sup>
...@@ -2784,7 +2782,7 @@ try { ...@@ -2784,7 +2782,7 @@ try {
windowClass.off('dialogTargetTouch'); windowClass.off('dialogTargetTouch');
} catch (exception) { } catch (exception) {
console.error('Failed to unregister callback. Cause: ' + JSON.stringify(exception)); console.error('Failed to unregister callback. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### bindDialogTarget<sup>9+</sup> ### bindDialogTarget<sup>9+</sup>
...@@ -2817,6 +2815,8 @@ bindDialogTarget(token: rpc.RemoteObject, deathCallback: Callback&lt;void&gt;, c ...@@ -2817,6 +2815,8 @@ bindDialogTarget(token: rpc.RemoteObject, deathCallback: Callback&lt;void&gt;, c
**示例:** **示例:**
```js ```js
import rpc from '@ohos.rpc';
class MyDeathRecipient { class MyDeathRecipient {
onRemoteDied() { onRemoteDied() {
console.log('server died'); console.log('server died');
...@@ -2836,6 +2836,7 @@ class TestRemoteObject extends rpc.RemoteObject { ...@@ -2836,6 +2836,7 @@ class TestRemoteObject extends rpc.RemoteObject {
return false; return false;
} }
} }
let token = new TestRemoteObject('testObject'); let token = new TestRemoteObject('testObject');
try { try {
windowClass.bindDialogTarget(token, () => { windowClass.bindDialogTarget(token, () => {
...@@ -2849,7 +2850,7 @@ try { ...@@ -2849,7 +2850,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to bind dialog target. Cause:' + JSON.stringify(exception)); console.error('Failed to bind dialog target. Cause:' + JSON.stringify(exception));
}; }
``` ```
### bindDialogTarget<sup>9+</sup> ### bindDialogTarget<sup>9+</sup>
...@@ -2887,6 +2888,8 @@ bindDialogTarget(token: rpc.RemoteObject, deathCallback: Callback&lt;void&gt;): ...@@ -2887,6 +2888,8 @@ bindDialogTarget(token: rpc.RemoteObject, deathCallback: Callback&lt;void&gt;):
**示例:** **示例:**
```js ```js
import rpc from '@ohos.rpc';
class MyDeathRecipient { class MyDeathRecipient {
onRemoteDied() { onRemoteDied() {
console.log('server died'); console.log('server died');
...@@ -2906,6 +2909,7 @@ class TestRemoteObject extends rpc.RemoteObject { ...@@ -2906,6 +2909,7 @@ class TestRemoteObject extends rpc.RemoteObject {
return false; return false;
} }
} }
let token = new TestRemoteObject('testObject'); let token = new TestRemoteObject('testObject');
try { try {
let promise = windowClass.bindDialogTarget(token, () => { let promise = windowClass.bindDialogTarget(token, () => {
...@@ -2918,7 +2922,7 @@ try { ...@@ -2918,7 +2922,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to bind dialog target. Cause:' + JSON.stringify(exception)); console.error('Failed to bind dialog target. Cause:' + JSON.stringify(exception));
}; }
``` ```
### isWindowSupportWideGamut<sup>9+</sup> ### isWindowSupportWideGamut<sup>9+</sup>
...@@ -3024,7 +3028,7 @@ try { ...@@ -3024,7 +3028,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set window colorspace. Cause:' + JSON.stringify(exception)); console.error('Failed to set window colorspace. Cause:' + JSON.stringify(exception));
}; }
``` ```
### setWindowColorSpace<sup>9+</sup> ### setWindowColorSpace<sup>9+</sup>
...@@ -3067,7 +3071,7 @@ try { ...@@ -3067,7 +3071,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set window colorspace. Cause:' + JSON.stringify(exception)); console.error('Failed to set window colorspace. Cause:' + JSON.stringify(exception));
}; }
``` ```
### getWindowColorSpace<sup>9+</sup> ### getWindowColorSpace<sup>9+</sup>
...@@ -3128,7 +3132,7 @@ try { ...@@ -3128,7 +3132,7 @@ try {
windowClass.setWindowBackgroundColor(color); windowClass.setWindowBackgroundColor(color);
} catch (exception) { } catch (exception) {
console.error('Failed to set the background color. Cause: ' + JSON.stringify(exception)); console.error('Failed to set the background color. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### setWindowBrightness<sup>9+</sup> ### setWindowBrightness<sup>9+</sup>
...@@ -3169,7 +3173,7 @@ try { ...@@ -3169,7 +3173,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set the brightness. Cause: ' + JSON.stringify(exception)); console.error('Failed to set the brightness. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### setWindowBrightness<sup>9+</sup> ### setWindowBrightness<sup>9+</sup>
...@@ -3214,7 +3218,7 @@ try { ...@@ -3214,7 +3218,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set the brightness. Cause: ' + JSON.stringify(exception)); console.error('Failed to set the brightness. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### setWindowFocusable<sup>9+</sup> ### setWindowFocusable<sup>9+</sup>
...@@ -3244,7 +3248,7 @@ setWindowFocusable(isFocusable: boolean, callback: AsyncCallback&lt;void&gt;): v ...@@ -3244,7 +3248,7 @@ setWindowFocusable(isFocusable: boolean, callback: AsyncCallback&lt;void&gt;): v
**示例:** **示例:**
```js ```js
let isFocusable= true; let isFocusable = true;
try { try {
windowClass.setWindowFocusable(isFocusable, (err) => { windowClass.setWindowFocusable(isFocusable, (err) => {
if (err.code) { if (err.code) {
...@@ -3255,7 +3259,7 @@ try { ...@@ -3255,7 +3259,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set the window to be focusable. Cause:' + JSON.stringify(exception)); console.error('Failed to set the window to be focusable. Cause:' + JSON.stringify(exception));
}; }
``` ```
### setWindowFocusable<sup>9+</sup> ### setWindowFocusable<sup>9+</sup>
...@@ -3290,7 +3294,7 @@ setWindowFocusable(isFocusable: boolean): Promise&lt;void&gt; ...@@ -3290,7 +3294,7 @@ setWindowFocusable(isFocusable: boolean): Promise&lt;void&gt;
**示例:** **示例:**
```js ```js
let isFocusable= true; let isFocusable = true;
try { try {
let promise = windowClass.setWindowFocusable(isFocusable); let promise = windowClass.setWindowFocusable(isFocusable);
promise.then(()=> { promise.then(()=> {
...@@ -3300,7 +3304,7 @@ try { ...@@ -3300,7 +3304,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set the window to be focusable. Cause:' + JSON.stringify(exception)); console.error('Failed to set the window to be focusable. Cause:' + JSON.stringify(exception));
}; }
``` ```
### setWindowKeepScreenOn<sup>9+</sup> ### setWindowKeepScreenOn<sup>9+</sup>
...@@ -3341,7 +3345,7 @@ try { ...@@ -3341,7 +3345,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set the screen to be always on. Cause: ' + JSON.stringify(exception)); console.error('Failed to set the screen to be always on. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### setWindowKeepScreenOn<sup>9+</sup> ### setWindowKeepScreenOn<sup>9+</sup>
...@@ -3386,7 +3390,7 @@ try { ...@@ -3386,7 +3390,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set the screen to be always on. Cause: ' + JSON.stringify(exception)); console.error('Failed to set the screen to be always on. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### setWakeUpScreen()<sup>9+</sup> ### setWakeUpScreen()<sup>9+</sup>
...@@ -3422,7 +3426,7 @@ try { ...@@ -3422,7 +3426,7 @@ try {
windowClass.setWakeUpScreen(wakeUp); windowClass.setWakeUpScreen(wakeUp);
} catch (exception) { } catch (exception) {
console.error('Failed to wake up the screen. Cause: ' + JSON.stringify(exception)); console.error('Failed to wake up the screen. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### setWindowPrivacyMode<sup>9+</sup> ### setWindowPrivacyMode<sup>9+</sup>
...@@ -3464,7 +3468,7 @@ try { ...@@ -3464,7 +3468,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set the window to privacy mode. Cause:' + JSON.stringify(exception)); console.error('Failed to set the window to privacy mode. Cause:' + JSON.stringify(exception));
}; }
``` ```
### setWindowPrivacyMode<sup>9+</sup> ### setWindowPrivacyMode<sup>9+</sup>
...@@ -3510,7 +3514,7 @@ try { ...@@ -3510,7 +3514,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set the window to privacy mode. Cause:' + JSON.stringify(exception)); console.error('Failed to set the window to privacy mode. Cause:' + JSON.stringify(exception));
}; }
``` ```
### setSnapshotSkip<sup>9+</sup> ### setSnapshotSkip<sup>9+</sup>
...@@ -3583,7 +3587,7 @@ try { ...@@ -3583,7 +3587,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set the window to be touchable. Cause:' + JSON.stringify(exception)); console.error('Failed to set the window to be touchable. Cause:' + JSON.stringify(exception));
}; }
``` ```
### setWindowTouchable<sup>9+</sup> ### setWindowTouchable<sup>9+</sup>
...@@ -3628,7 +3632,7 @@ try { ...@@ -3628,7 +3632,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to set the window to be touchable. Cause:' + JSON.stringify(exception)); console.error('Failed to set the window to be touchable. Cause:' + JSON.stringify(exception));
}; }
``` ```
### setForbidSplitMove<sup>9+</sup> ### setForbidSplitMove<sup>9+</sup>
...@@ -3671,7 +3675,7 @@ try { ...@@ -3671,7 +3675,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to forbid window moving in split screen mode. Cause:' + JSON.stringify(exception)); console.error('Failed to forbid window moving in split screen mode. Cause:' + JSON.stringify(exception));
}; }
``` ```
### setForbidSplitMove<sup>9+</sup> ### setForbidSplitMove<sup>9+</sup>
...@@ -3718,7 +3722,7 @@ try { ...@@ -3718,7 +3722,7 @@ try {
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to forbid window moving in split screen mode. Cause:' + JSON.stringify(exception)); console.error('Failed to forbid window moving in split screen mode. Cause:' + JSON.stringify(exception));
}; }
``` ```
### snapshot<sup>9+</sup> ### snapshot<sup>9+</sup>
...@@ -3822,7 +3826,7 @@ try { ...@@ -3822,7 +3826,7 @@ try {
windowClass.opacity(0.5); windowClass.opacity(0.5);
} catch (exception) { } catch (exception) {
console.error('Failed to opacity. Cause: ' + JSON.stringify(exception)); console.error('Failed to opacity. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### scale<sup>9+</sup> ### scale<sup>9+</sup>
...@@ -3863,7 +3867,7 @@ try { ...@@ -3863,7 +3867,7 @@ try {
windowClass.scale(obj); windowClass.scale(obj);
} catch (exception) { } catch (exception) {
console.error('Failed to scale. Cause: ' + JSON.stringify(exception)); console.error('Failed to scale. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### rotate<sup>9+</sup> ### rotate<sup>9+</sup>
...@@ -3905,7 +3909,7 @@ try { ...@@ -3905,7 +3909,7 @@ try {
windowClass.rotate(obj); windowClass.rotate(obj);
} catch (exception) { } catch (exception) {
console.error('Failed to rotate. Cause: ' + JSON.stringify(exception)); console.error('Failed to rotate. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### translate<sup>9+</sup> ### translate<sup>9+</sup>
...@@ -3945,7 +3949,7 @@ try { ...@@ -3945,7 +3949,7 @@ try {
windowClass.translate(obj); windowClass.translate(obj);
} catch (exception) { } catch (exception) {
console.error('Failed to translate. Cause: ' + JSON.stringify(exception)); console.error('Failed to translate. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### getTransitionController<sup>9+</sup> ### getTransitionController<sup>9+</sup>
...@@ -3998,16 +4002,16 @@ controller.animationForHidden = (context : window.TransitionContext) => { ...@@ -3998,16 +4002,16 @@ controller.animationForHidden = (context : window.TransitionContext) => {
toWindow.translate(obj); // 设置动画过程中的属性转换 toWindow.translate(obj); // 设置动画过程中的属性转换
console.info('toWindow translate end'); console.info('toWindow translate end');
} }
) );
console.info('complete transition end'); console.info('complete transition end');
} };
windowClass.hideWithAnimation((err, data) => { windowClass.hideWithAnimation((err, data) => {
if (err.code) { if (err.code) {
console.error('Failed to show the window with animation. Cause: ' + JSON.stringify(err)); console.error('Failed to show the window with animation. Cause: ' + JSON.stringify(err));
return; return;
} }
console.info('Succeeded in showing the window with animation. Data: ' + JSON.stringify(data)); console.info('Succeeded in showing the window with animation. Data: ' + JSON.stringify(data));
}) });
``` ```
### setBlur<sup>9+</sup> ### setBlur<sup>9+</sup>
...@@ -4042,7 +4046,7 @@ try { ...@@ -4042,7 +4046,7 @@ try {
windowClass.setBlur(4.0); windowClass.setBlur(4.0);
} catch (exception) { } catch (exception) {
console.error('Failed to set blur. Cause: ' + JSON.stringify(exception)); console.error('Failed to set blur. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### setBackdropBlur<sup>9+</sup> ### setBackdropBlur<sup>9+</sup>
...@@ -4077,7 +4081,7 @@ try { ...@@ -4077,7 +4081,7 @@ try {
windowClass.setBackdropBlur(4.0); windowClass.setBackdropBlur(4.0);
} catch (exception) { } catch (exception) {
console.error('Failed to set backdrop blur. Cause: ' + JSON.stringify(exception)); console.error('Failed to set backdrop blur. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### setBackdropBlurStyle<sup>9+</sup> ### setBackdropBlurStyle<sup>9+</sup>
...@@ -4112,7 +4116,7 @@ try { ...@@ -4112,7 +4116,7 @@ try {
windowClass.setBackdropBlurStyle(window.BlurStyle.THIN); windowClass.setBackdropBlurStyle(window.BlurStyle.THIN);
} catch (exception) { } catch (exception) {
console.error('Failed to set backdrop blur style. Cause: ' + JSON.stringify(exception)); console.error('Failed to set backdrop blur style. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### setShadow<sup>9+</sup> ### setShadow<sup>9+</sup>
...@@ -4150,7 +4154,7 @@ try { ...@@ -4150,7 +4154,7 @@ try {
windowClass.setShadow(4.0, '#FF00FF00', 2, 3); windowClass.setShadow(4.0, '#FF00FF00', 2, 3);
} catch (exception) { } catch (exception) {
console.error('Failed to set shadow. Cause: ' + JSON.stringify(exception)); console.error('Failed to set shadow. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### setCornerRadius<sup>9+</sup> ### setCornerRadius<sup>9+</sup>
...@@ -4185,7 +4189,7 @@ try { ...@@ -4185,7 +4189,7 @@ try {
windowClass.setCornerRadius(4.0); windowClass.setCornerRadius(4.0);
} catch (exception) { } catch (exception) {
console.error('Failed to set corner radius. Cause: ' + JSON.stringify(exception)); console.error('Failed to set corner radius. Cause: ' + JSON.stringify(exception));
}; }
``` ```
### show<sup>(deprecated)</sup> ### show<sup>(deprecated)</sup>
...@@ -4215,7 +4219,7 @@ windowClass.show((err) => { ...@@ -4215,7 +4219,7 @@ windowClass.show((err) => {
return; return;
} }
console.info('Succeeded in showing the window.'); console.info('Succeeded in showing the window.');
}) });
``` ```
### show<sup>(deprecated)</sup> ### show<sup>(deprecated)</sup>
...@@ -4244,7 +4248,7 @@ promise.then(()=> { ...@@ -4244,7 +4248,7 @@ promise.then(()=> {
console.info('Succeeded in showing the window.'); console.info('Succeeded in showing the window.');
}).catch((err)=>{ }).catch((err)=>{
console.error('Failed to show the window. Cause: ' + JSON.stringify(err)); console.error('Failed to show the window. Cause: ' + JSON.stringify(err));
}) });
``` ```
### destroy<sup>(deprecated)</sup> ### destroy<sup>(deprecated)</sup>
...@@ -4274,7 +4278,7 @@ windowClass.destroy((err) => { ...@@ -4274,7 +4278,7 @@ windowClass.destroy((err) => {
return; return;
} }
console.info('Succeeded in destroying the window.'); console.info('Succeeded in destroying the window.');
}) });
``` ```
### destroy<sup>(deprecated)</sup> ### destroy<sup>(deprecated)</sup>
...@@ -4303,7 +4307,7 @@ promise.then(()=> { ...@@ -4303,7 +4307,7 @@ promise.then(()=> {
console.info('Succeeded in destroying the window.'); console.info('Succeeded in destroying the window.');
}).catch((err)=>{ }).catch((err)=>{
console.error('Failed to destroy the window. Cause: ' + JSON.stringify(err)); console.error('Failed to destroy the window. Cause: ' + JSON.stringify(err));
}) });
``` ```
### moveTo<sup>(deprecated)</sup> ### moveTo<sup>(deprecated)</sup>
...@@ -4335,7 +4339,6 @@ windowClass.moveTo(300, 300, (err)=>{ ...@@ -4335,7 +4339,6 @@ windowClass.moveTo(300, 300, (err)=>{
return; return;
} }
console.info('Succeeded in moving the window.'); console.info('Succeeded in moving the window.');
}); });
``` ```
...@@ -4372,7 +4375,7 @@ promise.then(()=> { ...@@ -4372,7 +4375,7 @@ promise.then(()=> {
console.info('Succeeded in moving the window.'); console.info('Succeeded in moving the window.');
}).catch((err)=>{ }).catch((err)=>{
console.error('Failed to move the window. Cause: ' + JSON.stringify(err)); console.error('Failed to move the window. Cause: ' + JSON.stringify(err));
}) });
``` ```
### resetSize<sup>(deprecated)</sup> ### resetSize<sup>(deprecated)</sup>
...@@ -5144,7 +5147,7 @@ windowClass.isSupportWideGamut((err, data) => { ...@@ -5144,7 +5147,7 @@ windowClass.isSupportWideGamut((err, data) => {
return; return;
} }
console.info('Succeeded in checking whether the window support WideGamut Data: ' + JSON.stringify(data)); console.info('Succeeded in checking whether the window support WideGamut Data: ' + JSON.stringify(data));
}) });
``` ```
### isSupportWideGamut<sup>(deprecated)</sup> ### isSupportWideGamut<sup>(deprecated)</sup>
...@@ -5204,7 +5207,7 @@ windowClass.setColorSpace(window.ColorSpace.WIDE_GAMUT, (err) => { ...@@ -5204,7 +5207,7 @@ windowClass.setColorSpace(window.ColorSpace.WIDE_GAMUT, (err) => {
return; return;
} }
console.info('Succeeded in setting window colorspace.'); console.info('Succeeded in setting window colorspace.');
}) });
``` ```
### setColorSpace<sup>(deprecated)</sup> ### setColorSpace<sup>(deprecated)</sup>
...@@ -5269,7 +5272,7 @@ windowClass.getColorSpace((err, data) => { ...@@ -5269,7 +5272,7 @@ windowClass.getColorSpace((err, data) => {
return; return;
} }
console.info('Succeeded in getting window colorspace. Cause:' + JSON.stringify(data)); console.info('Succeeded in getting window colorspace. Cause:' + JSON.stringify(data));
}) });
``` ```
### getColorSpace<sup>(deprecated)</sup> ### getColorSpace<sup>(deprecated)</sup>
...@@ -5667,7 +5670,7 @@ windowClass.setOutsideTouchable(true, (err) => { ...@@ -5667,7 +5670,7 @@ windowClass.setOutsideTouchable(true, (err) => {
return; return;
} }
console.info('Succeeded in setting the area to be touchable.'); console.info('Succeeded in setting the area to be touchable.');
}) });
``` ```
### setOutsideTouchable<sup>(deprecated)</sup> ### setOutsideTouchable<sup>(deprecated)</sup>
...@@ -5734,7 +5737,6 @@ windowClass.setPrivacyMode(isPrivacyMode, (err) => { ...@@ -5734,7 +5737,6 @@ windowClass.setPrivacyMode(isPrivacyMode, (err) => {
return; return;
} }
console.info('Succeeded in setting the window to privacy mode.'); console.info('Succeeded in setting the window to privacy mode.');
}); });
``` ```
...@@ -5803,7 +5805,6 @@ windowClass.setTouchable(isTouchable, (err) => { ...@@ -5803,7 +5805,6 @@ windowClass.setTouchable(isTouchable, (err) => {
return; return;
} }
console.info('Succeeded in setting the window to be touchable.'); console.info('Succeeded in setting the window to be touchable.');
}); });
``` ```
...@@ -5893,6 +5894,7 @@ getMainWindow(callback: AsyncCallback&lt;Window&gt;): void ...@@ -5893,6 +5894,7 @@ getMainWindow(callback: AsyncCallback&lt;Window&gt;): void
```ts ```ts
import Ability from '@ohos.application.Ability'; import Ability from '@ohos.application.Ability';
class myAbility extends Ability { class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
...@@ -5906,7 +5908,7 @@ class myAbility extends Ability { ...@@ -5906,7 +5908,7 @@ class myAbility extends Ability {
console.info('Succeeded in obtaining the main window. Data: ' + JSON.stringify(data)); console.info('Succeeded in obtaining the main window. Data: ' + JSON.stringify(data));
}); });
} }
} };
``` ```
### getMainWindow<sup>9+</sup> ### getMainWindow<sup>9+</sup>
...@@ -5938,19 +5940,20 @@ getMainWindow(): Promise&lt;Window&gt; ...@@ -5938,19 +5940,20 @@ getMainWindow(): Promise&lt;Window&gt;
```ts ```ts
import Ability from '@ohos.application.Ability'; import Ability from '@ohos.application.Ability';
class myAbility extends Ability { class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
let windowClass = null; let windowClass = null;
let promise = windowStage.getMainWindow(); let promise = windowStage.getMainWindow();
promise.then((data)=> { promise.then((data) => {
windowClass = data; windowClass = data;
console.info('Succeeded in obtaining the main window. Data: ' + JSON.stringify(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)); console.error('Failed to obtain the main window. Cause: ' + JSON.stringify(err));
}); });
} }
} };
``` ```
### getMainWindowSync<sup>9+</sup> ### getMainWindowSync<sup>9+</sup>
...@@ -5982,6 +5985,7 @@ getMainWindowSync(): Window ...@@ -5982,6 +5985,7 @@ getMainWindowSync(): Window
```ts ```ts
import Ability from '@ohos.application.Ability'; import Ability from '@ohos.application.Ability';
class myAbility extends Ability { class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
...@@ -5991,7 +5995,7 @@ class myAbility extends Ability { ...@@ -5991,7 +5995,7 @@ class myAbility extends Ability {
console.error('Failed to obtain the main window. Cause: ' + JSON.stringify(exception)); console.error('Failed to obtain the main window. Cause: ' + JSON.stringify(exception));
}; };
} }
} };
``` ```
### createSubWindow<sup>9+</sup> ### createSubWindow<sup>9+</sup>
...@@ -6024,6 +6028,7 @@ createSubWindow(name: string, callback: AsyncCallback&lt;Window&gt;): void ...@@ -6024,6 +6028,7 @@ createSubWindow(name: string, callback: AsyncCallback&lt;Window&gt;): void
```ts ```ts
import Ability from '@ohos.application.Ability'; import Ability from '@ohos.application.Ability';
class myAbility extends Ability { class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
...@@ -6042,7 +6047,7 @@ class myAbility extends Ability { ...@@ -6042,7 +6047,7 @@ class myAbility extends Ability {
console.error('Failed to create the subwindow. Cause: ' + JSON.stringify(exception)); console.error('Failed to create the subwindow. Cause: ' + JSON.stringify(exception));
}; };
} }
} };
``` ```
### createSubWindow<sup>9+</sup> ### createSubWindow<sup>9+</sup>
...@@ -6079,23 +6084,24 @@ createSubWindow(name: string): Promise&lt;Window&gt; ...@@ -6079,23 +6084,24 @@ createSubWindow(name: string): Promise&lt;Window&gt;
```ts ```ts
import Ability from '@ohos.application.Ability'; import Ability from '@ohos.application.Ability';
class myAbility extends Ability { class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
let windowClass = null; let windowClass = null;
try { try {
let promise = windowStage.createSubWindow('mySubWindow'); let promise = windowStage.createSubWindow('mySubWindow');
promise.then((data)=> { promise.then((data) => {
windowClass = data; windowClass = data;
console.info('Succeeded in creating the subwindow. Data: ' + JSON.stringify(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)); console.error('Failed to create the subwindow. Cause: ' + JSON.stringify(err));
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to create the subwindow. Cause: ' + JSON.stringify(exception)); console.error('Failed to create the subwindow. Cause: ' + JSON.stringify(exception));
}; };
} }
} };
``` ```
### getSubWindow<sup>9+</sup> ### getSubWindow<sup>9+</sup>
...@@ -6126,6 +6132,7 @@ getSubWindow(callback: AsyncCallback&lt;Array&lt;Window&gt;&gt;): void ...@@ -6126,6 +6132,7 @@ getSubWindow(callback: AsyncCallback&lt;Array&lt;Window&gt;&gt;): void
```ts ```ts
import Ability from '@ohos.application.Ability'; import Ability from '@ohos.application.Ability';
class myAbility extends Ability { class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
...@@ -6139,7 +6146,7 @@ class myAbility extends Ability { ...@@ -6139,7 +6146,7 @@ class myAbility extends Ability {
console.info('Succeeded in obtaining the subwindow. Data: ' + JSON.stringify(data)); console.info('Succeeded in obtaining the subwindow. Data: ' + JSON.stringify(data));
}); });
} }
} };
``` ```
### getSubWindow<sup>9+</sup> ### getSubWindow<sup>9+</sup>
...@@ -6169,19 +6176,20 @@ getSubWindow(): Promise&lt;Array&lt;Window&gt;&gt; ...@@ -6169,19 +6176,20 @@ getSubWindow(): Promise&lt;Array&lt;Window&gt;&gt;
```ts ```ts
import Ability from '@ohos.application.Ability'; import Ability from '@ohos.application.Ability';
class myAbility extends Ability { class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
let windowClass = null; let windowClass = null;
let promise = windowStage.getSubWindow(); let promise = windowStage.getSubWindow();
promise.then((data)=> { promise.then((data) => {
windowClass = data; windowClass = data;
console.info('Succeeded in obtaining the subwindow. Data: ' + JSON.stringify(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)); console.error('Failed to obtain the subwindow. Cause: ' + JSON.stringify(err));
}) })
} }
} };
``` ```
### loadContent<sup>9+</sup> ### loadContent<sup>9+</sup>
...@@ -6214,6 +6222,7 @@ loadContent(path: string, storage: LocalStorage, callback: AsyncCallback&lt;void ...@@ -6214,6 +6222,7 @@ loadContent(path: string, storage: LocalStorage, callback: AsyncCallback&lt;void
```ts ```ts
import Ability from '@ohos.application.Ability'; import Ability from '@ohos.application.Ability';
class myAbility extends Ability { class myAbility extends Ability {
storage : LocalStorage storage : LocalStorage
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
...@@ -6232,7 +6241,7 @@ class myAbility extends Ability { ...@@ -6232,7 +6241,7 @@ class myAbility extends Ability {
console.error('Failed to load the content. Cause:' + JSON.stringify(exception)); console.error('Failed to load the content. Cause:' + JSON.stringify(exception));
}; };
} }
} };
``` ```
### loadContent<sup>9+</sup> ### loadContent<sup>9+</sup>
...@@ -6271,6 +6280,7 @@ loadContent(path: string, storage?: LocalStorage): Promise&lt;void&gt; ...@@ -6271,6 +6280,7 @@ loadContent(path: string, storage?: LocalStorage): Promise&lt;void&gt;
```ts ```ts
import Ability from '@ohos.application.Ability'; import Ability from '@ohos.application.Ability';
class myAbility extends Ability { class myAbility extends Ability {
storage : LocalStorage storage : LocalStorage
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
...@@ -6279,16 +6289,16 @@ class myAbility extends Ability { ...@@ -6279,16 +6289,16 @@ class myAbility extends Ability {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
try { try {
let promise = windowStage.loadContent('pages/page2',this.storage); let promise = windowStage.loadContent('pages/page2',this.storage);
promise.then(()=> { promise.then(() => {
console.info('Succeeded in loading the content.'); console.info('Succeeded in loading the content.');
}).catch((err)=>{ }).catch((err) => {
console.error('Failed to load the content. Cause:' + JSON.stringify(err)); console.error('Failed to load the content. Cause:' + JSON.stringify(err));
}); });
} catch (exception) { } catch (exception) {
console.error('Failed to load the content. Cause:' + JSON.stringify(exception)); console.error('Failed to load the content. Cause:' + JSON.stringify(exception));
}; };
} }
} };
``` ```
### loadContent<sup>9+</sup> ### loadContent<sup>9+</sup>
...@@ -6321,6 +6331,7 @@ loadContent(path: string, callback: AsyncCallback&lt;void&gt;): void ...@@ -6321,6 +6331,7 @@ loadContent(path: string, callback: AsyncCallback&lt;void&gt;): void
```ts ```ts
import Ability from '@ohos.application.Ability'; import Ability from '@ohos.application.Ability';
class myAbility extends Ability { class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
...@@ -6336,7 +6347,7 @@ class myAbility extends Ability { ...@@ -6336,7 +6347,7 @@ class myAbility extends Ability {
console.error('Failed to load the content. Cause:' + JSON.stringify(exception)); console.error('Failed to load the content. Cause:' + JSON.stringify(exception));
}; };
} }
} };
``` ```
### on('windowStageEvent')<sup>9+</sup> ### on('windowStageEvent')<sup>9+</sup>
...@@ -6369,6 +6380,7 @@ on(eventType: 'windowStageEvent', callback: Callback&lt;WindowStageEventType&gt; ...@@ -6369,6 +6380,7 @@ on(eventType: 'windowStageEvent', callback: Callback&lt;WindowStageEventType&gt;
```ts ```ts
import Ability from '@ohos.application.Ability'; import Ability from '@ohos.application.Ability';
class myAbility extends Ability { class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
...@@ -6382,7 +6394,7 @@ class myAbility extends Ability { ...@@ -6382,7 +6394,7 @@ class myAbility extends Ability {
JSON.stringify(exception)); JSON.stringify(exception));
}; };
} }
} };
``` ```
### off('windowStageEvent')<sup>9+</sup> ### off('windowStageEvent')<sup>9+</sup>
...@@ -6415,6 +6427,7 @@ off(eventType: 'windowStageEvent', callback?: Callback&lt;WindowStageEventType&g ...@@ -6415,6 +6427,7 @@ off(eventType: 'windowStageEvent', callback?: Callback&lt;WindowStageEventType&g
```ts ```ts
import Ability from '@ohos.application.Ability'; import Ability from '@ohos.application.Ability';
class myAbility extends Ability { class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
...@@ -6425,7 +6438,7 @@ class myAbility extends Ability { ...@@ -6425,7 +6438,7 @@ class myAbility extends Ability {
JSON.stringify(exception)); JSON.stringify(exception));
}; };
} }
} };
``` ```
### disableWindowDecor()<sup>9+</sup> ### disableWindowDecor()<sup>9+</sup>
...@@ -6453,12 +6466,13 @@ disableWindowDecor(): void ...@@ -6453,12 +6466,13 @@ disableWindowDecor(): void
```ts ```ts
import Ability from '@ohos.application.Ability'; import Ability from '@ohos.application.Ability';
class myAbility extends Ability { class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('disableWindowDecor'); console.log('disableWindowDecor');
windowStage.disableWindowDecor(); windowStage.disableWindowDecor();
} }
} };
``` ```
### setShowOnLockScreen()<sup>9+</sup> ### setShowOnLockScreen()<sup>9+</sup>
...@@ -6492,6 +6506,7 @@ setShowOnLockScreen(showOnLockScreen: boolean): void ...@@ -6492,6 +6506,7 @@ setShowOnLockScreen(showOnLockScreen: boolean): void
```ts ```ts
import Ability from '@ohos.application.Ability'; import Ability from '@ohos.application.Ability';
class myAbility extends Ability { class myAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate'); console.log('onWindowStageCreate');
...@@ -6501,7 +6516,7 @@ class myAbility extends Ability { ...@@ -6501,7 +6516,7 @@ class myAbility extends Ability {
console.error('Failed to show on lockscreen. Cause:' + JSON.stringify(exception)); console.error('Failed to show on lockscreen. Cause:' + JSON.stringify(exception));
}; };
} }
} };
``` ```
## TransitionContext<sup>9+</sup> ## TransitionContext<sup>9+</sup>
...@@ -6555,7 +6570,7 @@ controller.animationForShown = (context : window.TransitionContext) => { ...@@ -6555,7 +6570,7 @@ controller.animationForShown = (context : window.TransitionContext) => {
toWindow.translate(obj); toWindow.translate(obj);
console.info('toWindow translate end'); console.info('toWindow translate end');
} }
) );
try { try {
context.completeTransition(true) context.completeTransition(true)
} catch (exception) { } catch (exception) {
...@@ -6610,9 +6625,9 @@ controller.animationForShown = (context : window.TransitionContext) => { ...@@ -6610,9 +6625,9 @@ controller.animationForShown = (context : window.TransitionContext) => {
toWindow.translate(obj); toWindow.translate(obj);
console.info('toWindow translate end'); console.info('toWindow translate end');
} }
) );
console.info('complete transition end'); console.info('complete transition end');
} };
``` ```
### animationForHidden<sup>9+</sup> ### animationForHidden<sup>9+</sup>
...@@ -6658,5 +6673,5 @@ controller.animationForHidden = (context : window.TransitionContext) => { ...@@ -6658,5 +6673,5 @@ controller.animationForHidden = (context : window.TransitionContext) => {
} }
) )
console.info('complete transition end'); console.info('complete transition end');
} };
``` ```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册