1e41f4b71Sopenharmony_ci# @ohos.animation.windowAnimationManager (Window Animation Management) (System API) 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciThe **WindowAnimationManager** module provides APIs to listen for application start/exit events and window minimization/maximization events and associate animations with these events. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci> **NOTE** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci> - The APIs of this module are supported since API version 9. Updates will be marked with a superscript to indicate their earliest API version. 8e41f4b71Sopenharmony_ci> 9e41f4b71Sopenharmony_ci> - The APIs provided by this module are system APIs. 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ci## Modules to Import 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci```ts 14e41f4b71Sopenharmony_ciimport { windowAnimationManager } from '@kit.ArkUI'; 15e41f4b71Sopenharmony_ci``` 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci## windowAnimationManager.setController 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_cisetController(controller: WindowAnimationController): void 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ciSets a window animation controller. For details about the controller, see [WindowAnimationController](#windowanimationcontroller). 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ciBefore using other APIs of **windowAnimationManager**, you must call this API to set a window animation controller. 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci**System capability**: SystemCapability.WindowManager.WindowManager.Core 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci**Parameters** 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 30e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | 31e41f4b71Sopenharmony_ci| controller | [WindowAnimationController](#windowanimationcontroller) | Yes | Window animation controller to set.| 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci**Example** 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ci```ts 36e41f4b71Sopenharmony_cilet controller: windowAnimationManager.WindowAnimationController = { 37e41f4b71Sopenharmony_ci onStartAppFromLauncher(startingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 38e41f4b71Sopenharmony_ci console.log('onStartAppFromLauncher, the startingWindowTarget is: ' + startingWindowTarget); 39e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 40e41f4b71Sopenharmony_ci }, 41e41f4b71Sopenharmony_ci onStartAppFromRecent(startingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 42e41f4b71Sopenharmony_ci console.log('onStartAppFromRecent, the startingWindowTarget is: ' + startingWindowTarget); 43e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 44e41f4b71Sopenharmony_ci }, 45e41f4b71Sopenharmony_ci onStartAppFromOther(startingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 46e41f4b71Sopenharmony_ci console.log('onStartAppFromOther, the startingWindowTarget is: ' + startingWindowTarget); 47e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 48e41f4b71Sopenharmony_ci }, 49e41f4b71Sopenharmony_ci onAppTransition(fromWindowTarget: windowAnimationManager.WindowAnimationTarget, toWindowTarget: WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 50e41f4b71Sopenharmony_ci console.log('onAppTransition, the fromWindowTarget is: ' + fromWindowTarget); 51e41f4b71Sopenharmony_ci console.log('onAppTransition, the toWindowTarget is: ' + toWindowTarget); 52e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 53e41f4b71Sopenharmony_ci }, 54e41f4b71Sopenharmony_ci onMinimizeWindow(minimizingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 55e41f4b71Sopenharmony_ci console.log('onMinimizeWindow, the minimizingWindowTarget is: ' + minimizingWindowTarget); 56e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 57e41f4b71Sopenharmony_ci }, 58e41f4b71Sopenharmony_ci onCloseWindow(closingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 59e41f4b71Sopenharmony_ci console.log('onCloseWindow, the closingWindowTarget is: ' + closingWindowTarget); 60e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 61e41f4b71Sopenharmony_ci }, 62e41f4b71Sopenharmony_ci onScreenUnlock(finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 63e41f4b71Sopenharmony_ci console.log('onScreenUnlock called'); 64e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 65e41f4b71Sopenharmony_ci }, 66e41f4b71Sopenharmony_ci onWindowAnimationTargetsUpdate(fullScreenWindowTarget: windowAnimationManager.WindowAnimationTarget, floatingWindowTargets: Array<windowAnimationManager.WindowAnimationTarget>): void { 67e41f4b71Sopenharmony_ci console.log('onWindowAnimationTargetsUpdate, the fullScreenWindowTarget is: ' + fullScreenWindowTarget); 68e41f4b71Sopenharmony_ci console.log('onWindowAnimationTargetsUpdate, the floatingWindowTargets are: ' + floatingWindowTargets); 69e41f4b71Sopenharmony_ci } 70e41f4b71Sopenharmony_ci} 71e41f4b71Sopenharmony_ci 72e41f4b71Sopenharmony_ciwindowAnimationManager.setController(controller); 73e41f4b71Sopenharmony_ci``` 74e41f4b71Sopenharmony_ci 75e41f4b71Sopenharmony_ci## windowAnimationManager.minimizeWindowWithAnimation 76e41f4b71Sopenharmony_ci 77e41f4b71Sopenharmony_ciminimizeWindowWithAnimation(windowTarget: WindowAnimationTarget, callback: AsyncCallback<WindowAnimationFinishedCallback>): void 78e41f4b71Sopenharmony_ci 79e41f4b71Sopenharmony_ciMinimizes the window that displays the animation. This API uses an asynchronous callback to return the result. 80e41f4b71Sopenharmony_ci 81e41f4b71Sopenharmony_ci**System capability**: SystemCapability.WindowManager.WindowManager.Core 82e41f4b71Sopenharmony_ci 83e41f4b71Sopenharmony_ci**Parameters** 84e41f4b71Sopenharmony_ci 85e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 86e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | 87e41f4b71Sopenharmony_ci| windowTarget | [WindowAnimationTarget](#windowanimationtarget) | Yes | Target window to minimize.| 88e41f4b71Sopenharmony_ci| callback | AsyncCallback<[WindowAnimationFinishedCallback](#windowanimationfinishedcallback)> | 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**.| 89e41f4b71Sopenharmony_ci 90e41f4b71Sopenharmony_ci**Example** 91e41f4b71Sopenharmony_ci 92e41f4b71Sopenharmony_ci```ts 93e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 94e41f4b71Sopenharmony_ci 95e41f4b71Sopenharmony_cilet target: windowAnimationManager.WindowAnimationTarget | null = null; 96e41f4b71Sopenharmony_cilet controller: windowAnimationManager.WindowAnimationController = { 97e41f4b71Sopenharmony_ci onStartAppFromLauncher(startingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 98e41f4b71Sopenharmony_ci console.log('onStartAppFromLauncher, the startingWindowTarget is: ' + startingWindowTarget); 99e41f4b71Sopenharmony_ci target = startingWindowTarget; 100e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 101e41f4b71Sopenharmony_ci }, 102e41f4b71Sopenharmony_ci onStartAppFromRecent(startingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 103e41f4b71Sopenharmony_ci console.log('onStartAppFromRecent, the startingWindowTarget is: ' + startingWindowTarget); 104e41f4b71Sopenharmony_ci target = startingWindowTarget; 105e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 106e41f4b71Sopenharmony_ci }, 107e41f4b71Sopenharmony_ci onStartAppFromOther(startingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 108e41f4b71Sopenharmony_ci console.log('onStartAppFromOther, the startingWindowTarget is: ' + startingWindowTarget); 109e41f4b71Sopenharmony_ci target = startingWindowTarget; 110e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 111e41f4b71Sopenharmony_ci }, 112e41f4b71Sopenharmony_ci onAppTransition(fromWindowTarget: windowAnimationManager.WindowAnimationTarget, toWindowTarget: WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 113e41f4b71Sopenharmony_ci console.log('onAppTransition, the fromWindowTarget is: ' + fromWindowTarget); 114e41f4b71Sopenharmony_ci console.log('onAppTransition, the toWindowTarget is: ' + toWindowTarget); 115e41f4b71Sopenharmony_ci target = toWindowTarget; 116e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 117e41f4b71Sopenharmony_ci }, 118e41f4b71Sopenharmony_ci onMinimizeWindow(minimizingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 119e41f4b71Sopenharmony_ci console.log('onMinimizeWindow, the minimizingWindowTarget is: ' + minimizingWindowTarget); 120e41f4b71Sopenharmony_ci target = minimizingWindowTarget; 121e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 122e41f4b71Sopenharmony_ci }, 123e41f4b71Sopenharmony_ci onCloseWindow(closingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 124e41f4b71Sopenharmony_ci console.log('onCloseWindow, the closingWindowTarget is: ' + closingWindowTarget); 125e41f4b71Sopenharmony_ci target = closingWindowTarget; 126e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 127e41f4b71Sopenharmony_ci }, 128e41f4b71Sopenharmony_ci onScreenUnlock(finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 129e41f4b71Sopenharmony_ci console.log('onScreenUnlock called'); 130e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 131e41f4b71Sopenharmony_ci }, 132e41f4b71Sopenharmony_ci onWindowAnimationTargetsUpdate(fullScreenWindowTarget: windowAnimationManager.WindowAnimationTarget, floatingWindowTargets: Array<windowAnimationManager.WindowAnimationTarget>): void { 133e41f4b71Sopenharmony_ci console.log('onWindowAnimationTargetsUpdate, the fullScreenWindowTarget is: ' + fullScreenWindowTarget); 134e41f4b71Sopenharmony_ci console.log('onWindowAnimationTargetsUpdate, the floatingWindowTargets are: ' + floatingWindowTargets); 135e41f4b71Sopenharmony_ci target = fullScreenWindowTarget; 136e41f4b71Sopenharmony_ci } 137e41f4b71Sopenharmony_ci} 138e41f4b71Sopenharmony_ci 139e41f4b71Sopenharmony_ciwindowAnimationManager.setController(controller); 140e41f4b71Sopenharmony_ci 141e41f4b71Sopenharmony_cilet finishedCallback: windowAnimationManager.WindowAnimationFinishedCallback; 142e41f4b71Sopenharmony_ciwindowAnimationManager.minimizeWindowWithAnimation(target, (err: BusinessError, data: windowAnimationManager.WindowAnimationFinishedCallback) => { 143e41f4b71Sopenharmony_ci if (err) { 144e41f4b71Sopenharmony_ci console.error('Failed to minimize the window target. Cause: ' + JSON.stringify(err)); 145e41f4b71Sopenharmony_ci return; 146e41f4b71Sopenharmony_ci } 147e41f4b71Sopenharmony_ci finishedCallback = data; 148e41f4b71Sopenharmony_ci 149e41f4b71Sopenharmony_ci // After the callback is received, the window starts to play the animation. After the animation is finished, the **onAnimationFinish** callback is invoked. 150e41f4b71Sopenharmony_ci finishedCallback.onAnimationFinish(); 151e41f4b71Sopenharmony_ci}); 152e41f4b71Sopenharmony_ci``` 153e41f4b71Sopenharmony_ci 154e41f4b71Sopenharmony_ci## windowAnimationManager.minimizeWindowWithAnimation 155e41f4b71Sopenharmony_ci 156e41f4b71Sopenharmony_ciminimizeWindowWithAnimation(windowTarget: WindowAnimationTarget): Promise<WindowAnimationFinishedCallback> 157e41f4b71Sopenharmony_ci 158e41f4b71Sopenharmony_ciMinimizes the window that displays the animation. This API uses a promise to return the result. 159e41f4b71Sopenharmony_ci 160e41f4b71Sopenharmony_ci**System capability**: SystemCapability.WindowManager.WindowManager.Core 161e41f4b71Sopenharmony_ci 162e41f4b71Sopenharmony_ci**Parameters** 163e41f4b71Sopenharmony_ci 164e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 165e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | 166e41f4b71Sopenharmony_ci| windowTarget | [WindowAnimationTarget](#windowanimationtarget) | Yes | Target window to display the animation.| 167e41f4b71Sopenharmony_ci 168e41f4b71Sopenharmony_ci**Return value** 169e41f4b71Sopenharmony_ci 170e41f4b71Sopenharmony_ci| Type | Description | 171e41f4b71Sopenharmony_ci| -------------------------------- | --------------------------------------- | 172e41f4b71Sopenharmony_ci| Promise<[WindowAnimationFinishedCallback](#windowanimationfinishedcallback)> | Promise used to return a call when the animation is finished. | 173e41f4b71Sopenharmony_ci 174e41f4b71Sopenharmony_ci 175e41f4b71Sopenharmony_ci**Example** 176e41f4b71Sopenharmony_ci 177e41f4b71Sopenharmony_ci```ts 178e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 179e41f4b71Sopenharmony_ci 180e41f4b71Sopenharmony_cilet target: windowAnimationManager.WindowAnimationTarget | null = null; 181e41f4b71Sopenharmony_cilet controller: windowAnimationManager.WindowAnimationController = { 182e41f4b71Sopenharmony_ci onStartAppFromLauncher(startingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 183e41f4b71Sopenharmony_ci console.log('onStartAppFromLauncher, the startingWindowTarget is: ' + startingWindowTarget); 184e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 185e41f4b71Sopenharmony_ci }, 186e41f4b71Sopenharmony_ci onStartAppFromRecent(startingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 187e41f4b71Sopenharmony_ci console.log('onStartAppFromRecent, the startingWindowTarget is: ' + startingWindowTarget); 188e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 189e41f4b71Sopenharmony_ci }, 190e41f4b71Sopenharmony_ci onStartAppFromOther(startingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 191e41f4b71Sopenharmony_ci console.log('onStartAppFromOther, the startingWindowTarget is: ' + startingWindowTarget); 192e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 193e41f4b71Sopenharmony_ci }, 194e41f4b71Sopenharmony_ci onAppTransition(fromWindowTarget: windowAnimationManager.WindowAnimationTarget, toWindowTarget: WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 195e41f4b71Sopenharmony_ci console.log('onAppTransition, the fromWindowTarget is: ' + fromWindowTarget); 196e41f4b71Sopenharmony_ci console.log('onAppTransition, the toWindowTarget is: ' + toWindowTarget); 197e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 198e41f4b71Sopenharmony_ci }, 199e41f4b71Sopenharmony_ci onMinimizeWindow(minimizingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 200e41f4b71Sopenharmony_ci console.log('onMinimizeWindow, the minimizingWindowTarget is: ' + minimizingWindowTarget); 201e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 202e41f4b71Sopenharmony_ci }, 203e41f4b71Sopenharmony_ci onCloseWindow(closingWindowTarget: windowAnimationManager.WindowAnimationTarget, finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 204e41f4b71Sopenharmony_ci console.log('onCloseWindow, the closingWindowTarget is: ' + closingWindowTarget); 205e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 206e41f4b71Sopenharmony_ci }, 207e41f4b71Sopenharmony_ci onScreenUnlock(finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void { 208e41f4b71Sopenharmony_ci console.log('onScreenUnlock called'); 209e41f4b71Sopenharmony_ci finishCallback.onAnimationFinish(); 210e41f4b71Sopenharmony_ci }, 211e41f4b71Sopenharmony_ci onWindowAnimationTargetsUpdate(fullScreenWindowTarget: windowAnimationManager.WindowAnimationTarget, floatingWindowTargets: Array<windowAnimationManager.WindowAnimationTarget>): void { 212e41f4b71Sopenharmony_ci console.log('onWindowAnimationTargetsUpdate, the fullScreenWindowTarget is: ' + fullScreenWindowTarget); 213e41f4b71Sopenharmony_ci console.log('onWindowAnimationTargetsUpdate, the floatingWindowTargets are: ' + floatingWindowTargets); 214e41f4b71Sopenharmony_ci } 215e41f4b71Sopenharmony_ci} 216e41f4b71Sopenharmony_ci 217e41f4b71Sopenharmony_ciwindowAnimationManager.setController(controller); 218e41f4b71Sopenharmony_ci 219e41f4b71Sopenharmony_cilet promise: Promise<windowAnimationManager.WindowAnimationFinishedCallback> = windowAnimationManager.minimizeWindowWithAnimation(target); 220e41f4b71Sopenharmony_cipromise.then((data: windowAnimationManager.WindowAnimationFinishedCallback) => { 221e41f4b71Sopenharmony_ci data.onAnimationFinish(); 222e41f4b71Sopenharmony_ci}).catch((err: BusinessError)=>{ 223e41f4b71Sopenharmony_ci console.error('Failed to minimize the window target. Cause: ' + JSON.stringify(err)); 224e41f4b71Sopenharmony_ci return; 225e41f4b71Sopenharmony_ci}); 226e41f4b71Sopenharmony_ci``` 227e41f4b71Sopenharmony_ci 228e41f4b71Sopenharmony_ci## WindowAnimationController 229e41f4b71Sopenharmony_ci 230e41f4b71Sopenharmony_ciImplements the window animation controller. When creating a **WindowAnimationController** object, you must implement all callbacks in the object. 231e41f4b71Sopenharmony_ci 232e41f4b71Sopenharmony_ci**System capability**: SystemCapability.WindowManager.WindowManager.Core 233e41f4b71Sopenharmony_ci 234e41f4b71Sopenharmony_ci### onStartAppFromLauncher 235e41f4b71Sopenharmony_ci 236e41f4b71Sopenharmony_cionStartAppFromLauncher(startingWindowTarget: WindowAnimationTarget,finishCallback: WindowAnimationFinishedCallback): void 237e41f4b71Sopenharmony_ci 238e41f4b71Sopenharmony_ciCalled when an application is started from the home screen. 239e41f4b71Sopenharmony_ci 240e41f4b71Sopenharmony_ci**System capability**: SystemCapability.WindowManager.WindowManager.Core 241e41f4b71Sopenharmony_ci 242e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 243e41f4b71Sopenharmony_ci| -------------------- | ------------------------------------------------------------ | ---- | ------------------ | 244e41f4b71Sopenharmony_ci| startingWindowTarget | [WindowAnimationTarget](#windowanimationtarget) | Yes | Target window to display the animation. | 245e41f4b71Sopenharmony_ci| finishCallback | [WindowAnimationFinishedCallback](#windowanimationfinishedcallback) | Yes | Callback invoked when the animation is finished. | 246e41f4b71Sopenharmony_ci 247e41f4b71Sopenharmony_ci**Example** 248e41f4b71Sopenharmony_ci 249e41f4b71Sopenharmony_ciFor details, see the sample code under [windowAnimationManager.setController](#windowanimationmanagersetcontroller). 250e41f4b71Sopenharmony_ci 251e41f4b71Sopenharmony_ci### onStartAppFromRecent 252e41f4b71Sopenharmony_ci 253e41f4b71Sopenharmony_cionStartAppFromRecent(startingWindowTarget: WindowAnimationTarget,finishCallback:WindowAnimationFinishedCallback): void 254e41f4b71Sopenharmony_ci 255e41f4b71Sopenharmony_ciCalled when an application is started from the recent task list. 256e41f4b71Sopenharmony_ci 257e41f4b71Sopenharmony_ci**System capability**: SystemCapability.WindowManager.WindowManager.Core 258e41f4b71Sopenharmony_ci 259e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 260e41f4b71Sopenharmony_ci| -------------------- | ------------------------------------------------------------ | ---- | ------------------ | 261e41f4b71Sopenharmony_ci| startingWindowTarget | [WindowAnimationTarget](#windowanimationtarget) | Yes | Target window to display the animation. | 262e41f4b71Sopenharmony_ci| finishCallback | [WindowAnimationFinishedCallback](#windowanimationfinishedcallback) | Yes | Callback invoked when the animation is finished. | 263e41f4b71Sopenharmony_ci 264e41f4b71Sopenharmony_ci**Example** 265e41f4b71Sopenharmony_ci 266e41f4b71Sopenharmony_ciFor details, see the sample code under [windowAnimationManager.setController](#windowanimationmanagersetcontroller). 267e41f4b71Sopenharmony_ci 268e41f4b71Sopenharmony_ci### onStartAppFromOther 269e41f4b71Sopenharmony_ci 270e41f4b71Sopenharmony_cionStartAppFromOther(startingWindowTarget: WindowAnimationTarget,finishCallback: WindowAnimationFinishedCallback): void 271e41f4b71Sopenharmony_ci 272e41f4b71Sopenharmony_ciCalled when an application is started from a place other than the home screen and recent task list. 273e41f4b71Sopenharmony_ci 274e41f4b71Sopenharmony_ci**System capability**: SystemCapability.WindowManager.WindowManager.Core 275e41f4b71Sopenharmony_ci 276e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 277e41f4b71Sopenharmony_ci| -------------------- | ------------------------------------------------------------ | ---- | ------------------ | 278e41f4b71Sopenharmony_ci| startingWindowTarget | [WindowAnimationTarget](#windowanimationtarget) | Yes | Target window to display the animation. | 279e41f4b71Sopenharmony_ci| finishCallback | [WindowAnimationFinishedCallback](#windowanimationfinishedcallback) | Yes | Callback invoked when the animation is finished. | 280e41f4b71Sopenharmony_ci 281e41f4b71Sopenharmony_ci**Example** 282e41f4b71Sopenharmony_ci 283e41f4b71Sopenharmony_ciFor details, see the sample code under [windowAnimationManager.setController](#windowanimationmanagersetcontroller). 284e41f4b71Sopenharmony_ci 285e41f4b71Sopenharmony_ci### onAppTransition 286e41f4b71Sopenharmony_ci 287e41f4b71Sopenharmony_cionAppTransition(fromWindowTarget: WindowAnimationTarget, toWindowTarget: WindowAnimationTarget,finishCallback: WindowAnimationFinishedCallback): void 288e41f4b71Sopenharmony_ci 289e41f4b71Sopenharmony_ciCalled during application transition. 290e41f4b71Sopenharmony_ci 291e41f4b71Sopenharmony_ci**System capability**: SystemCapability.WindowManager.WindowManager.Core 292e41f4b71Sopenharmony_ci 293e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 294e41f4b71Sopenharmony_ci| -------------------- | ------------------------------- | ---- | ---------------- | 295e41f4b71Sopenharmony_ci| fromWindowTarget | [WindowAnimationTarget](#windowanimationtarget) | Yes | Window that displays the animation before the transition. | 296e41f4b71Sopenharmony_ci| toWindowTarget | [WindowAnimationTarget](#windowanimationtarget) | Yes | Window that displays the animation after the transition. | 297e41f4b71Sopenharmony_ci| finishCallback | [WindowAnimationFinishedCallback](#windowanimationfinishedcallback) | Yes | Callback invoked when the animation is finished. | 298e41f4b71Sopenharmony_ci 299e41f4b71Sopenharmony_ci**Example** 300e41f4b71Sopenharmony_ci 301e41f4b71Sopenharmony_ciFor details, see the sample code under [windowAnimationManager.setController](#windowanimationmanagersetcontroller). 302e41f4b71Sopenharmony_ci 303e41f4b71Sopenharmony_ci### onMinimizeWindow 304e41f4b71Sopenharmony_ci 305e41f4b71Sopenharmony_cionMinimizeWindow(minimizingWindowTarget: WindowAnimationTarget,finishCallback: WindowAnimationFinishedCallback): void 306e41f4b71Sopenharmony_ci 307e41f4b71Sopenharmony_ciCalled when a window is minimized. 308e41f4b71Sopenharmony_ci 309e41f4b71Sopenharmony_ci**System capability**: SystemCapability.WindowManager.WindowManager.Core 310e41f4b71Sopenharmony_ci 311e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 312e41f4b71Sopenharmony_ci| -------------------- | ------------------------------- | ---- | ---------------- | 313e41f4b71Sopenharmony_ci| minimizingWindowTarget | [WindowAnimationTarget](#windowanimationtarget) | Yes | Target window to display the animation. | 314e41f4b71Sopenharmony_ci| finishCallback | [WindowAnimationFinishedCallback](#windowanimationfinishedcallback) | Yes | Callback invoked when the animation is finished. | 315e41f4b71Sopenharmony_ci 316e41f4b71Sopenharmony_ci**Example** 317e41f4b71Sopenharmony_ci 318e41f4b71Sopenharmony_ciFor details, see the sample code under [windowAnimationManager.setController](#windowanimationmanagersetcontroller). 319e41f4b71Sopenharmony_ci 320e41f4b71Sopenharmony_ci### onCloseWindow 321e41f4b71Sopenharmony_ci 322e41f4b71Sopenharmony_cionCloseWindow(closingWindowTarget: WindowAnimationTarget,finishCallback: WindowAnimationFinishedCallback): void 323e41f4b71Sopenharmony_ci 324e41f4b71Sopenharmony_ciCalled when a window is closed. 325e41f4b71Sopenharmony_ci 326e41f4b71Sopenharmony_ci**System capability**: SystemCapability.WindowManager.WindowManager.Core 327e41f4b71Sopenharmony_ci 328e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 329e41f4b71Sopenharmony_ci| -------------------- | ------------------------------- | ---- | ---------------- | 330e41f4b71Sopenharmony_ci| closingWindowTarget | [WindowAnimationTarget](#windowanimationtarget) | Yes | Target window to display the animation. | 331e41f4b71Sopenharmony_ci| finishCallback | [WindowAnimationFinishedCallback](#windowanimationfinishedcallback) | Yes | Callback invoked when the animation is finished. | 332e41f4b71Sopenharmony_ci 333e41f4b71Sopenharmony_ci**Example** 334e41f4b71Sopenharmony_ci 335e41f4b71Sopenharmony_ciFor details, see the sample code under [windowAnimationManager.setController](#windowanimationmanagersetcontroller). 336e41f4b71Sopenharmony_ci 337e41f4b71Sopenharmony_ci### onScreenUnlock 338e41f4b71Sopenharmony_ci 339e41f4b71Sopenharmony_cionScreenUnlock(finishCallback: [WindowAnimationFinishedCallback](#windowanimationfinishedcallback)): void 340e41f4b71Sopenharmony_ci 341e41f4b71Sopenharmony_ciCalled when the screen is unlocked. 342e41f4b71Sopenharmony_ci 343e41f4b71Sopenharmony_ci**System capability**: SystemCapability.WindowManager.WindowManager.Core 344e41f4b71Sopenharmony_ci 345e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 346e41f4b71Sopenharmony_ci| -------------- | ------------------------------------------------------------ | ---- | ------------------ | 347e41f4b71Sopenharmony_ci| finishCallback | [WindowAnimationFinishedCallback](#windowanimationfinishedcallback) | Yes | Callback invoked when the animation is finished. | 348e41f4b71Sopenharmony_ci 349e41f4b71Sopenharmony_ci**Example** 350e41f4b71Sopenharmony_ci 351e41f4b71Sopenharmony_ciFor details, see the sample code under [windowAnimationManager.setController](#windowanimationmanagersetcontroller). 352e41f4b71Sopenharmony_ci 353e41f4b71Sopenharmony_ci### onWindowAnimationTargetsUpdate 354e41f4b71Sopenharmony_ci 355e41f4b71Sopenharmony_cionWindowAnimationTargetsUpdate(fullScreenWindowTarget: WindowAnimationTarget, floatingWindowTargets: Array<WindowAnimationTarget>): void 356e41f4b71Sopenharmony_ci 357e41f4b71Sopenharmony_ciCalled when the window that displays the animation is updated. 358e41f4b71Sopenharmony_ci 359e41f4b71Sopenharmony_ci**System capability**: SystemCapability.WindowManager.WindowManager.Core 360e41f4b71Sopenharmony_ci 361e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 362e41f4b71Sopenharmony_ci| -------------------- | ------------------------------- | ---- | ---------------- | 363e41f4b71Sopenharmony_ci| fullScreenWindowTarget | [WindowAnimationTarget](#windowanimationtarget) | Yes | Target window in full-screen mode.| 364e41f4b71Sopenharmony_ci| floatingWindowTargets| Array<[WindowAnimationTarget](#windowanimationtarget)> | Yes | Target window in the form of a floating window. | 365e41f4b71Sopenharmony_ci 366e41f4b71Sopenharmony_ci**Example** 367e41f4b71Sopenharmony_ci 368e41f4b71Sopenharmony_ciFor details, see the sample code under [windowAnimationManager.setController](#windowanimationmanagersetcontroller). 369e41f4b71Sopenharmony_ci 370e41f4b71Sopenharmony_ci## WindowAnimationFinishedCallback 371e41f4b71Sopenharmony_ciImplements a callback that is invoked when the animation is finished. 372e41f4b71Sopenharmony_ci 373e41f4b71Sopenharmony_ci### onAnimationFinish 374e41f4b71Sopenharmony_ci 375e41f4b71Sopenharmony_cionAnimationFinish():void 376e41f4b71Sopenharmony_ci 377e41f4b71Sopenharmony_ciCalled when the animation is finished. 378e41f4b71Sopenharmony_ci 379e41f4b71Sopenharmony_ci**System capability**: SystemCapability.WindowManager.WindowManager.Core 380e41f4b71Sopenharmony_ci 381e41f4b71Sopenharmony_ci**Example** 382e41f4b71Sopenharmony_ci 383e41f4b71Sopenharmony_ciFor details, see the sample code under [windowAnimationManager.setController](#windowanimationmanagersetcontroller). 384e41f4b71Sopenharmony_ci 385e41f4b71Sopenharmony_ci## WindowAnimationTarget 386e41f4b71Sopenharmony_ciDefines a window to display animation. 387e41f4b71Sopenharmony_ci 388e41f4b71Sopenharmony_ci**System capability**: SystemCapability.WindowManager.WindowManager.Core 389e41f4b71Sopenharmony_ci 390e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 391e41f4b71Sopenharmony_ci| ------- | ------ | ------ | ----------------------- | 392e41f4b71Sopenharmony_ci| bundleName | string | Yes |Bundle name corresponding to the target window. | 393e41f4b71Sopenharmony_ci| abilityName | string | Yes |Ability name corresponding to the target window. | 394e41f4b71Sopenharmony_ci| windowBounds | [RRect](#rrect) | Yes |Actual size of the target window. | 395e41f4b71Sopenharmony_ci| missionId | number | Yes |Mission ID, which is used to match an ability when there are multiple missions.| 396e41f4b71Sopenharmony_ci 397e41f4b71Sopenharmony_ci## RRect 398e41f4b71Sopenharmony_ciDescribes a rounded rectangle. 399e41f4b71Sopenharmony_ci 400e41f4b71Sopenharmony_ci**System capability**: SystemCapability.WindowManager.WindowManager.Core 401e41f4b71Sopenharmony_ci 402e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 403e41f4b71Sopenharmony_ci| ------- | ------ | ------|----------------------- | 404e41f4b71Sopenharmony_ci| left | number | Yes |Horizontal coordinate of the upper left corner of the target window relative to the screen. | 405e41f4b71Sopenharmony_ci| top | number | Yes |Vertical coordinate of the upper left corner of the target window relative to the screen. | 406e41f4b71Sopenharmony_ci| width | number | Yes |Width of the target window. | 407e41f4b71Sopenharmony_ci| height | number | Yes |Height of the target window. | 408e41f4b71Sopenharmony_ci| radius | number | Yes |Radius of the rounded corner of the target window. | 409