feat:iOS Affects Transformation

This commit is contained in:
pengfei.zhou
2019-12-02 18:07:03 +08:00
parent 7f278073f3
commit 1cd84d8720
6 changed files with 298 additions and 56 deletions

View File

@@ -27,7 +27,6 @@ export enum RepeatMode {
export interface IAnimation extends Modeling {
duration: number
delay?: number
fillMode: FillMode
}
export interface Changeable {
@@ -215,7 +214,6 @@ export class AnimationSet implements IAnimation {
private animations: IAnimation[] = []
_duration = 0
delay?: number
fillMode = FillMode.Removed
addAnimation(anim: IAnimation) {
this.animations.push(anim)
}
@@ -234,7 +232,6 @@ export class AnimationSet implements IAnimation {
animations: this.animations.map(e => {
return e.toModel()
}) as Model,
fillMode: this.fillMode,
delay: this.delay,
}
}

View File

@@ -336,7 +336,12 @@ export abstract class View implements Modeling, IView {
/**----------transform----------*/
doAnimation(context: BridgeContext, animation: IAnimation) {
return this.nativeChannel(context, "doAnimation")(animation.toModel())
return this.nativeChannel(context, "doAnimation")(animation.toModel()).then((args) => {
for (let key in args) {
Reflect.set(this, key, Reflect.get(args, key, args), this)
Reflect.deleteProperty(this.__dirty_props__, key)
}
})
}
}