Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
d1716868
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d1716868
编写于
9月 09, 2022
作者:
Z
zouwei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Maintain: Modify the document of WindowAnimationManager
Signed-off-by:
N
zouwei
<
zouwei33@huawei.com
>
上级
4771f9f8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
108 addition
and
87 deletion
+108
-87
zh-cn/application-dev/reference/apis/js-apis-windowAnimationManager.md
...tion-dev/reference/apis/js-apis-windowAnimationManager.md
+108
-87
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-windowAnimationManager.md
浏览文件 @
d1716868
...
...
@@ -16,7 +16,9 @@ import windowAnimationManager from '@ohos.animation.windowAnimationManager'
setController(controller: WindowAnimationController): void
设置窗口动画控制器。
设置窗口动画控制器。窗口动画控制器的说明请参考
[
WindowAnimationController
](
#windowanimationcontroller
)
。
在使用windowAnimationManager的其他接口前,需要预先调用本接口设置窗口动画控制器。
**系统能力:**
SystemCapability.WindowManager.WindowManager.Core
...
...
@@ -30,22 +32,38 @@ setController(controller: WindowAnimationController): void
```
js
var
controller
=
{
onStartAppFromLauncher
(
startingWindowTarget
:
WindowAnimationTarget
,
finishCallback
:
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onStartAppFromLauncher
'
,
startingWindowTarget
);
},
onStartAppFromRecent
(
startingWindowTarget
:
WindowAnimationTarget
,
finishCallback
:
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onStartAppFromRecent
'
,
startingWindowTarget
);
onStartAppFromLauncher
(
startingWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onStartAppFromLauncher, the startingWindowTarget is:
'
+
startingWindowTarget
);
finishCallback
.
onAnimationFinish
();
},
onStartAppFromRecent
(
startingWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onStartAppFromRecent, the startingWindowTarget is:
'
+
startingWindowTarget
);
finishCallback
.
onAnimationFinish
();
},
onStartAppFromOther
(
startingWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onStartAppFromOther, the startingWindowTarget is:
'
+
startingWindowTarget
);
finishCallback
.
onAnimationFinish
();
},
onStartAppFromOther
(
startingWindowTarget
:
WindowAnimationTarget
,
finishCallback
:
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onStartAppFromOther
'
,
startingWindowTarget
);
onAppTransition
(
fromWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
toWindowTarget
:
WindowAnimationTarget
,
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onAppTransition, the fromWindowTarget is:
'
+
fromWindowTarget
);
console
.
log
(
'
onAppTransition, the toWindowTarget is:
'
+
toWindowTarget
);
finishCallback
.
onAnimationFinish
();
},
onAppTransition
(
fromWindowTarget
:
WindowAnimationTarget
,
toWindowTarget
:
WindowAnimationTarget
,
finishCallback
:
WindowAnimationFinishedCallback
):
void
{
onMinimizeWindow
(
minimizingWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onMinimizeWindow, the minimizingWindowTarget is:
'
+
minimizingWindowTarget
);
finishCallback
.
onAnimationFinish
();
},
onMinimizeWindow
(
minimizingWindowTarget
:
WindowAnimationTarget
,
finishCallback
:
WindowAnimationFinishedCallback
):
void
{
onCloseWindow
(
closingWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onCloseWindow, the closingWindowTarget is:
'
+
closingWindowTarget
);
finishCallback
.
onAnimationFinish
();
},
onCloseWindow
(
closingWindowTarget
:
WindowAnimationTarget
,
finishCallback
:
WindowAnimationFinishedCallback
):
void
{
onScreenUnlock
(
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onScreenUnlock called
'
);
finishCallback
.
onAnimationFinish
();
},
onScreenUnlock
(
finishCallback
:
WindowAnimationFinishedCallback
):
void
{
onWindowAnimationTargetsUpdate
(
fullScreenWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
floatingWindowTargets
:
Array
<
windowAnimationManager
.
WindowAnimationTarget
>
):
void
{
console
.
log
(
'
onWindowAnimationTargetsUpdate, the fullScreenWindowTarget is:
'
+
fullScreenWindowTarget
);
console
.
log
(
'
onWindowAnimationTargetsUpdate, the floatingWindowTargets are:
'
+
floatingWindowTargets
);
}
}
...
...
@@ -56,7 +74,7 @@ windowAnimationManager.setController(controller)
minimizeWindowWithAnimation(windowTarget: WindowAnimationTarget, callback: AsyncCallback
<
WindowAnimationFinishedCallback
>
): void
最小化动画目标窗口,并返回动画完成的回调。
最小化动画目标窗口,并返回动画完成的回调。
使用callback异步回调
**系统能力:**
SystemCapability.WindowManager.WindowManager.Core
...
...
@@ -72,9 +90,39 @@ minimizeWindowWithAnimation(windowTarget: WindowAnimationTarget, callback: Async
```
js
var
target
:
WindowAnimationTarget
=
undefined
;
var
controller
=
{
onWindowAnimationTargetsUpdate
(
fullScreenWindowTarget
:
WindowAnimationTarget
,
floatingWindowTargets
:
Array
<
WindowAnimationTarget
>
):
void
{
target
=
fullScreenWindowTarget
;
},
onStartAppFromLauncher
(
startingWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onStartAppFromLauncher, the startingWindowTarget is:
'
+
startingWindowTarget
);
finishCallback
.
onAnimationFinish
();
},
onStartAppFromRecent
(
startingWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onStartAppFromRecent, the startingWindowTarget is:
'
+
startingWindowTarget
);
finishCallback
.
onAnimationFinish
();
},
onStartAppFromOther
(
startingWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onStartAppFromOther, the startingWindowTarget is:
'
+
startingWindowTarget
);
finishCallback
.
onAnimationFinish
();
},
onAppTransition
(
fromWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
toWindowTarget
:
WindowAnimationTarget
,
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onAppTransition, the fromWindowTarget is:
'
+
fromWindowTarget
);
console
.
log
(
'
onAppTransition, the toWindowTarget is:
'
+
toWindowTarget
);
finishCallback
.
onAnimationFinish
();
},
onMinimizeWindow
(
minimizingWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onMinimizeWindow, the minimizingWindowTarget is:
'
+
minimizingWindowTarget
);
finishCallback
.
onAnimationFinish
();
},
onCloseWindow
(
closingWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onCloseWindow, the closingWindowTarget is:
'
+
closingWindowTarget
);
finishCallback
.
onAnimationFinish
();
},
onScreenUnlock
(
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onScreenUnlock called
'
);
finishCallback
.
onAnimationFinish
();
},
onWindowAnimationTargetsUpdate
(
fullScreenWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
floatingWindowTargets
:
Array
<
windowAnimationManager
.
WindowAnimationTarget
>
):
void
{
console
.
log
(
'
onWindowAnimationTargetsUpdate, the fullScreenWindowTarget is:
'
+
fullScreenWindowTarget
);
console
.
log
(
'
onWindowAnimationTargetsUpdate, the floatingWindowTargets are:
'
+
floatingWindowTargets
);
}
}
windowAnimationManager
.
setController
(
controller
)
...
...
@@ -96,7 +144,7 @@ finishedCallback.onAnimationFinish();
minimizeWindowWithAnimation(windowTarget: WindowAnimationTarget): Promise
<
WindowAnimationFinishedCallback
>
最小化动画目标窗口,并返回动画完成的回调。
最小化动画目标窗口,并返回动画完成的回调。
使用Promise异步回调。
**系统能力:**
SystemCapability.WindowManager.WindowManager.Core
...
...
@@ -118,9 +166,39 @@ minimizeWindowWithAnimation(windowTarget: WindowAnimationTarget): Promise<Win
```
js
var
target
:
WindowAnimationTarget
=
undefined
;
var
controller
=
{
onWindowAnimationTargetsUpdate
(
fullScreenWindowTarget
:
WindowAnimationTarget
,
floatingWindowTargets
:
Array
<
WindowAnimationTarget
>
):
void
{
target
=
fullScreenWindowTarget
;
},
onStartAppFromLauncher
(
startingWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onStartAppFromLauncher, the startingWindowTarget is:
'
+
startingWindowTarget
);
finishCallback
.
onAnimationFinish
();
},
onStartAppFromRecent
(
startingWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onStartAppFromRecent, the startingWindowTarget is:
'
+
startingWindowTarget
);
finishCallback
.
onAnimationFinish
();
},
onStartAppFromOther
(
startingWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onStartAppFromOther, the startingWindowTarget is:
'
+
startingWindowTarget
);
finishCallback
.
onAnimationFinish
();
},
onAppTransition
(
fromWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
toWindowTarget
:
WindowAnimationTarget
,
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onAppTransition, the fromWindowTarget is:
'
+
fromWindowTarget
);
console
.
log
(
'
onAppTransition, the toWindowTarget is:
'
+
toWindowTarget
);
finishCallback
.
onAnimationFinish
();
},
onMinimizeWindow
(
minimizingWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onMinimizeWindow, the minimizingWindowTarget is:
'
+
minimizingWindowTarget
);
finishCallback
.
onAnimationFinish
();
},
onCloseWindow
(
closingWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onCloseWindow, the closingWindowTarget is:
'
+
closingWindowTarget
);
finishCallback
.
onAnimationFinish
();
},
onScreenUnlock
(
finishCallback
:
windowAnimationManager
.
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onScreenUnlock called
'
);
finishCallback
.
onAnimationFinish
();
},
onWindowAnimationTargetsUpdate
(
fullScreenWindowTarget
:
windowAnimationManager
.
WindowAnimationTarget
,
floatingWindowTargets
:
Array
<
windowAnimationManager
.
WindowAnimationTarget
>
):
void
{
console
.
log
(
'
onWindowAnimationTargetsUpdate, the fullScreenWindowTarget is:
'
+
fullScreenWindowTarget
);
console
.
log
(
'
onWindowAnimationTargetsUpdate, the floatingWindowTargets are:
'
+
floatingWindowTargets
);
}
}
windowAnimationManager
.
setController
(
controller
)
...
...
@@ -136,7 +214,7 @@ promise.then((data) => {
## WindowAnimationController
窗口动画控制器。
窗口动画控制器。
在创建一个WindowAnimationController对象时,需要实现其中的所有回调函数。
**系统能力:**
SystemCapability.WindowManager.WindowManager.Core
...
...
@@ -155,13 +233,7 @@ onStartAppFromLauncher(startingWindowTarget: WindowAnimationTarget,finishCallbac
**示例:**
```
js
var
controller
=
{
onStartAppFromLauncher
(
startingWindowTarget
:
WindowAnimationTarget
,
finishCallback
:
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onStartAppFromLauncher
'
,
startingWindowTarget
);
}
}
```
请参考
[
windowAnimationManager.setController
](
#windowanimationmanagersetcontroller
)
的示例代码。
### onStartAppFromRecent
...
...
@@ -178,13 +250,7 @@ onStartAppFromRecent(startingWindowTarget: WindowAnimationTarget,finishCallback:
**示例:**
```
js
var
controller
=
{
onStartAppFromRecent
(
startingWindowTarget
:
WindowAnimationTarget
,
finishCallback
:
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onStartAppFromRecent
'
,
startingWindowTarget
);
}
}
```
请参考
[
windowAnimationManager.setController
](
#windowanimationmanagersetcontroller
)
的示例代码。
### onStartAppFromOther
...
...
@@ -201,13 +267,7 @@ onStartAppFromOther(startingWindowTarget: WindowAnimationTarget,finishCallback:
**示例:**
```
js
var
controller
=
{
onStartAppFromOther
(
startingWindowTarget
:
WindowAnimationTarget
,
finishCallback
:
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onStartAppFromOther
'
,
startingWindowTarget
);
}
}
```
请参考
[
windowAnimationManager.setController
](
#windowanimationmanagersetcontroller
)
的示例代码。
### onAppTransition
...
...
@@ -225,14 +285,7 @@ onAppTransition(fromWindowTarget: WindowAnimationTarget, toWindowTarget: WindowA
**示例:**
```
js
var
controller
=
{
onAppTransition
(
fromWindowTarget
:
WindowAnimationTarget
,
toWindowTarget
:
WindowAnimationTarget
,
finishCallback
:
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onAppTransition
'
,
fromWindowTarget
);
}
}
```
请参考
[
windowAnimationManager.setController
](
#windowanimationmanagersetcontroller
)
的示例代码。
### onMinimizeWindow
...
...
@@ -249,13 +302,7 @@ onMinimizeWindow(minimizingWindowTarget: WindowAnimationTarget,finishCallback: W
**示例:**
```
js
var
controller
=
{
onMinimizeWindow
(
minimizingWindowTarget
:
WindowAnimationTarget
,
finishCallback
:
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onMinimizeWindow
'
,
minimizingWindowTarget
);
}
}
```
请参考
[
windowAnimationManager.setController
](
#windowanimationmanagersetcontroller
)
的示例代码。
### onCloseWindow
...
...
@@ -272,13 +319,7 @@ onCloseWindow(closingWindowTarget: WindowAnimationTarget,finishCallback: WindowA
**示例:**
```
js
var
controller
=
{
onCloseWindow
(
closingWindowTarget
:
WindowAnimationTarget
,
finishCallback
:
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onCloseWindow
'
,
closingWindowTarget
);
}
}
```
请参考
[
windowAnimationManager.setController
](
#windowanimationmanagersetcontroller
)
的示例代码。
### onScreenUnlock
...
...
@@ -294,13 +335,7 @@ onScreenUnlock(finishCallback: [WindowAnimationFinishedCallback](#windowanimatio
**示例:**
```
js
var
controller
=
{
onScreenUnlock
(
finishCallback
:
WindowAnimationFinishedCallback
):
void
{
console
.
log
(
'
onScreenUnlock
'
.);
}
}
```
请参考
[
windowAnimationManager.setController
](
#windowanimationmanagersetcontroller
)
的示例代码。
### onWindowAnimationTargetsUpdate
...
...
@@ -317,15 +352,7 @@ onWindowAnimationTargetsUpdate(fullScreenWindowTarget: WindowAnimationTarget, fl
**示例:**
```
js
var
controller
=
{
onWindowAnimationTargetsUpdate
(
fullScreenWindowTarget
:
WindowAnimationTarget
,
floatingWindowTargets
:
Array
<
WindowAnimationTarget
>
):
void
{
console
.
log
(
'
onWindowAnimationTargetsUpdate
'
.);
}
}
windowAnimationManager
.
setController
(
controller
)
```
请参考
[
windowAnimationManager.setController
](
#windowanimationmanagersetcontroller
)
的示例代码。
## WindowAnimationFinishedCallback
动画完成后的回调。
...
...
@@ -340,13 +367,7 @@ onAnimationFinish():void
**示例:**
```
js
var
controller
=
{
onCloseWindow
(
closingWindowTarget
:
WindowAnimationTarget
,
finishCallback
:
WindowAnimationFinishedCallback
):
void
{
finishCallback
.
onAnimationFinish
();
}
}
```
请参考
[
windowAnimationManager.setController
](
#windowanimationmanagersetcontroller
)
的示例代码。
## WindowAnimationTarget
动画目标窗口,用来实现动画。
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录