feat:when cancel Animation,sync the properties from native

This commit is contained in:
pengfei.zhou
2021-04-22 14:54:25 +08:00
committed by osborn
parent 819feb1617
commit cdd25caa7d
12 changed files with 377 additions and 324 deletions

View File

@@ -354,7 +354,12 @@ export abstract class View implements Modeling {
}
cancelAnimation(context: BridgeContext, animation: IAnimation) {
return this.nativeChannel(context, "cancelAnimation")(animation.id)
return this.nativeChannel(context, "cancelAnimation")(animation.id).then((args) => {
for (let key in args) {
Reflect.set(this, key, Reflect.get(args, key, args), this)
Reflect.deleteProperty(this.__dirty_props__, key)
}
})
}
}

View File

@@ -21,6 +21,7 @@ import { BridgeContext } from "../runtime/global";
import { LayoutConfig } from '../util/layoutconfig'
import { IAnimation } from "./animation";
import { FlexConfig } from "../util/flexbox";
import { modal } from "../native/modal";
const PROP_CONSIST = 1;
const PROP_INCONSIST = 2;
@@ -363,7 +364,12 @@ export abstract class View implements Modeling {
}
cancelAnimation(context: BridgeContext, animation: IAnimation) {
return this.nativeChannel(context, "cancelAnimation")(animation.id)
return this.nativeChannel(context, "cancelAnimation")(animation.id).then((args) => {
for (let key in args) {
Reflect.set(this, key, Reflect.get(args, key, args), this)
Reflect.deleteProperty(this.__dirty_props__, key)
}
})
}
}