提交 be5b104b 编写于 作者: G Gloria

Update docs against 11441+11494+11688

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 0612bb09
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
The **WindowAnimationManager** module provides APIs to listen for application start/exit events and window minimization/maximization events and associate animations with these events. The **WindowAnimationManager** module provides APIs to listen for application start/exit events and window minimization/maximization events and associate animations with these events.
> **NOTE** > **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 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. > The APIs provided by this module are system APIs.
...@@ -61,7 +62,7 @@ let controller = { ...@@ -61,7 +62,7 @@ let controller = {
console.log('onScreenUnlock called'); console.log('onScreenUnlock called');
finishCallback.onAnimationFinish(); finishCallback.onAnimationFinish();
}, },
onWindowAnimationTargetsUpdate(fullScreenWindowTarget: windowAnimationManager.WindowAnimationTarget, floatingWindowTargets: Array<windowAnimationManager.WindowAnimationTarget>): void{ onWindowAnimationTargetsUpdate(fullScreenWindowTarget: windowAnimationManager.WindowAnimationTarget, floatingWindowTargets: Array<windowAnimationManager.WindowAnimationTarget>): void {
console.log('onWindowAnimationTargetsUpdate, the fullScreenWindowTarget is: ' + fullScreenWindowTarget); console.log('onWindowAnimationTargetsUpdate, the fullScreenWindowTarget is: ' + fullScreenWindowTarget);
console.log('onWindowAnimationTargetsUpdate, the floatingWindowTargets are: ' + floatingWindowTargets); console.log('onWindowAnimationTargetsUpdate, the floatingWindowTargets are: ' + floatingWindowTargets);
} }
...@@ -83,7 +84,7 @@ Minimizes the window that displays the animation. This API uses an asynchronous ...@@ -83,7 +84,7 @@ Minimizes the window that displays the animation. This API uses an asynchronous
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| windowTarget | [WindowAnimationTarget](#windowanimationtarget) | Yes| Target window to minimize.| | windowTarget | [WindowAnimationTarget](#windowanimationtarget) | Yes| Target window to minimize.|
| callback | AsyncCallback&lt;[WindowAnimationFinishedCallback](#windowanimationfinishedcallback)&gt; | Yes| Callback invoked when the animation is finished.| | callback | AsyncCallback&lt;[WindowAnimationFinishedCallback](#windowanimationfinishedcallback)&gt; | Yes| Callback used to return the result. If the target window is minimized, **err** is **undefined** and **data** is the **WindowAnimationFinishedCallback** obtained; otherwise, **err.code** is **-1** and **data** is **undefined**.|
**Example** **Example**
...@@ -92,52 +93,59 @@ let target: WindowAnimationTarget = undefined; ...@@ -92,52 +93,59 @@ let target: WindowAnimationTarget = undefined;
let controller = { let controller = {
onStartAppFromLauncher(startingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { onStartAppFromLauncher(startingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void {
console.log('onStartAppFromLauncher, the startingWindowTarget is: ' + startingWindowTarget); console.log('onStartAppFromLauncher, the startingWindowTarget is: ' + startingWindowTarget);
target = startingWindowTarget;
finishCallback.onAnimationFinish(); finishCallback.onAnimationFinish();
}, },
onStartAppFromRecent(startingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { onStartAppFromRecent(startingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void {
console.log('onStartAppFromRecent, the startingWindowTarget is: ' + startingWindowTarget); console.log('onStartAppFromRecent, the startingWindowTarget is: ' + startingWindowTarget);
target = startingWindowTarget;
finishCallback.onAnimationFinish(); finishCallback.onAnimationFinish();
}, },
onStartAppFromOther(startingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { onStartAppFromOther(startingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void {
console.log('onStartAppFromOther, the startingWindowTarget is: ' + startingWindowTarget); console.log('onStartAppFromOther, the startingWindowTarget is: ' + startingWindowTarget);
target = startingWindowTarget;
finishCallback.onAnimationFinish(); finishCallback.onAnimationFinish();
}, },
onAppTransition(fromWindowTarget: windowAnimationManager.WindowAnimationTarget, toWindowTarget: WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { onAppTransition(fromWindowTarget: windowAnimationManager.WindowAnimationTarget, toWindowTarget: WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void {
console.log('onAppTransition, the fromWindowTarget is: ' + fromWindowTarget); console.log('onAppTransition, the fromWindowTarget is: ' + fromWindowTarget);
console.log('onAppTransition, the toWindowTarget is: ' + toWindowTarget); console.log('onAppTransition, the toWindowTarget is: ' + toWindowTarget);
target = toWindowTarget;
finishCallback.onAnimationFinish(); finishCallback.onAnimationFinish();
}, },
onMinimizeWindow(minimizingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { onMinimizeWindow(minimizingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void {
console.log('onMinimizeWindow, the minimizingWindowTarget is: ' + minimizingWindowTarget); console.log('onMinimizeWindow, the minimizingWindowTarget is: ' + minimizingWindowTarget);
target = minimizingWindowTarget;
finishCallback.onAnimationFinish(); finishCallback.onAnimationFinish();
}, },
onCloseWindow(closingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { onCloseWindow(closingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void {
console.log('onCloseWindow, the closingWindowTarget is: ' + closingWindowTarget); console.log('onCloseWindow, the closingWindowTarget is: ' + closingWindowTarget);
target = closingWindowTarget;
finishCallback.onAnimationFinish(); finishCallback.onAnimationFinish();
}, },
onScreenUnlock(finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { onScreenUnlock(finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void {
console.log('onScreenUnlock called'); console.log('onScreenUnlock called');
finishCallback.onAnimationFinish(); finishCallback.onAnimationFinish();
}, },
onWindowAnimationTargetsUpdate(fullScreenWindowTarget: windowAnimationManager.WindowAnimationTarget, floatingWindowTargets: Array<windowAnimationManager.WindowAnimationTarget>): void{ onWindowAnimationTargetsUpdate(fullScreenWindowTarget: windowAnimationManager.WindowAnimationTarget, floatingWindowTargets: Array<windowAnimationManager.WindowAnimationTarget>): void {
console.log('onWindowAnimationTargetsUpdate, the fullScreenWindowTarget is: ' + fullScreenWindowTarget); console.log('onWindowAnimationTargetsUpdate, the fullScreenWindowTarget is: ' + fullScreenWindowTarget);
console.log('onWindowAnimationTargetsUpdate, the floatingWindowTargets are: ' + floatingWindowTargets); console.log('onWindowAnimationTargetsUpdate, the floatingWindowTargets are: ' + floatingWindowTargets);
target = fullScreenWindowTarget;
} }
} }
windowAnimationManager.setController(controller) windowAnimationManager.setController(controller)
let finishedCallback = null; let finishedCallback: windowAnimationManager.WindowAnimationFinishedCallback = undefined;
windowAnimationManager.minimizeWindowWithAnimation(target, (err, data) => { windowAnimationManager.minimizeWindowWithAnimation(target, (err, data) => {
if (err.code) { if (err) {
console.error('Failed to minimize the window target. Cause: ' + JSON.stringify(err)); console.error('Failed to minimize the window target. Cause: ' + JSON.stringify(err));
return; return;
} }
finishedCallback = data; finishedCallback = data;
});
finishedCallback.onAnimationFinish(); // After the callback is received, the window starts to play the animation. After the animation is finished, the **onAnimationFinish** callback is invoked.
finishedCallback.onAnimationFinish();
});
``` ```
## windowAnimationManager.minimizeWindowWithAnimation ## windowAnimationManager.minimizeWindowWithAnimation
...@@ -195,7 +203,7 @@ let controller = { ...@@ -195,7 +203,7 @@ let controller = {
console.log('onScreenUnlock called'); console.log('onScreenUnlock called');
finishCallback.onAnimationFinish(); finishCallback.onAnimationFinish();
}, },
onWindowAnimationTargetsUpdate(fullScreenWindowTarget: windowAnimationManager.WindowAnimationTarget, floatingWindowTargets: Array<windowAnimationManager.WindowAnimationTarget>): void{ onWindowAnimationTargetsUpdate(fullScreenWindowTarget: windowAnimationManager.WindowAnimationTarget, floatingWindowTargets: Array<windowAnimationManager.WindowAnimationTarget>): void {
console.log('onWindowAnimationTargetsUpdate, the fullScreenWindowTarget is: ' + fullScreenWindowTarget); console.log('onWindowAnimationTargetsUpdate, the fullScreenWindowTarget is: ' + fullScreenWindowTarget);
console.log('onWindowAnimationTargetsUpdate, the floatingWindowTargets are: ' + floatingWindowTargets); console.log('onWindowAnimationTargetsUpdate, the floatingWindowTargets are: ' + floatingWindowTargets);
} }
...@@ -374,22 +382,22 @@ Defines a window to display animation. ...@@ -374,22 +382,22 @@ Defines a window to display animation.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Type | Description| | Name | Type | Mandatory| Description|
| ------- | ------ | ----------------------- | | ------- | ------ | ------ | ----------------------- |
| bundleName | string | Bundle name corresponding to the target window.| | bundleName | string | Yes|Bundle name corresponding to the target window.|
| abilityName | string | Ability name corresponding to the target window.| | abilityName | string | Yes|Ability name corresponding to the target window.|
| windowBounds | [RRect](#rrect) | Actual size of the target window.| | windowBounds | [RRect](#rrect) | Yes|Actual size of the target window.|
| missionId | number | Mission ID.| | missionId | number | Yes|Mission ID, which is used to match an ability when there are multiple missions.|
## RRect ## RRect
Describes a rounded rectangle. Describes a rounded rectangle.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Type | Description| | Name | Type | Mandatory| Description|
| ------- | ------ | ----------------------- | | ------- | ------ | ------|----------------------- |
| left | number | Horizontal coordinate of the upper left corner of the target window relative to the screen.| | left | number | Yes|Horizontal coordinate of the upper left corner of the target window relative to the screen.|
| top | number | Vertical coordinate of the upper left corner of the target window relative to the screen.| | top | number | Yes|Vertical coordinate of the upper left corner of the target window relative to the screen.|
| width | number | Width of the target window.| | width | number | Yes|Width of the target window.|
| height | number | Height of the target window.| | height | number | Yes|Height of the target window.|
| radius | number | Radius of the rounded corner of the target window.| | radius | number | Yes|Radius of the rounded corner of the target window.|
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册