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

@@ -131,7 +131,7 @@ export declare abstract class View implements Modeling {
flexConfig?: FlexConfig;
doAnimation(context: BridgeContext, animation: IAnimation): Promise<void>;
clearAnimation(context: BridgeContext, animation: IAnimation): Promise<void>;
cancelAnimation(context: BridgeContext, animation: IAnimation): Promise<any>;
cancelAnimation(context: BridgeContext, animation: IAnimation): Promise<void>;
}
export declare abstract class Superview extends View {
subviewById(id: string): View | undefined;

View File

@@ -10,6 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
import { obj2Model } from "../util/types";
import { uniqueId } from "../util/uniqueId";
import { loge } from "../util/log";
import { modal } from "../native/modal";
const PROP_CONSIST = 1;
const PROP_INCONSIST = 2;
export function Property(target, propKey) {
@@ -209,7 +210,13 @@ export class View {
});
}
cancelAnimation(context, animation) {
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)
}
modal(context).alert(JSON.stringify(this.__dirty_props__));
});
}
}
__decorate([