mirror of
https://gitee.com/openharmony-tpc/ImageKnife.git
synced 2026-05-24 17:25:44 +08:00
@@ -19,7 +19,22 @@ import { AnimatorOption, ImageKnifeAnimatorComponent,ImageKnifeOption } from "@o
|
||||
struct ImageAnimatorPage {
|
||||
@Local animatorOption: AnimatorOption = new AnimatorOption({
|
||||
state: AnimationStatus.Running,
|
||||
iterations: -1
|
||||
iterations: -1,
|
||||
onFinish:()=>{
|
||||
console.log("ImageKnifeAnimatorComponent animatorOption onFinish")
|
||||
},
|
||||
onStart:()=>{
|
||||
console.log("ImageKnifeAnimatorComponent animatorOption onStart")
|
||||
},
|
||||
onPause:()=>{
|
||||
console.log("ImageKnifeAnimatorComponent animatorOption onPause")
|
||||
},
|
||||
onCancel:()=>{
|
||||
console.log("ImageKnifeAnimatorComponent animatorOption onCancel")
|
||||
},
|
||||
onRepeat:()=>{
|
||||
console.log("ImageKnifeAnimatorComponent animatorOption onRepeat")
|
||||
}
|
||||
})
|
||||
@Local animatorOption1: AnimatorOption = new AnimatorOption({
|
||||
state: AnimationStatus.Initial
|
||||
@@ -33,15 +48,9 @@ struct ImageAnimatorPage {
|
||||
Flex(){
|
||||
Button("播放").onClick(()=>{
|
||||
this.animatorOption.state = AnimationStatus.Running
|
||||
this.animatorOption.onStart = ()=>{
|
||||
console.log("ImageKnifeAnimatorComponent animatorOption onStart")
|
||||
}
|
||||
})
|
||||
Button("暂停").onClick(()=>{
|
||||
this.animatorOption.state = AnimationStatus.Paused
|
||||
this.animatorOption.onFinish = ()=>{
|
||||
console.log("ImageKnifeAnimatorComponent animatorOption onFinish")
|
||||
}
|
||||
})
|
||||
Button("停止").onClick(()=>{
|
||||
this.animatorOption.state = AnimationStatus.Stopped
|
||||
|
||||
Reference in New Issue
Block a user