feat:Add cancelAnimation and clearAnimation

This commit is contained in:
pengfei.zhou
2021-04-22 11:46:24 +08:00
committed by osborn
parent 15a62bad8a
commit e7ced92281
10 changed files with 132 additions and 94 deletions

View File

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

View File

@@ -199,8 +199,8 @@ export class View {
}
});
}
cancelAnimation(context, animation) {
return this.nativeChannel(context, "cancelAnimation")(animation.id).then(() => {
clearAnimation(context, animation) {
return this.nativeChannel(context, "clearAnimation")(animation.id).then(() => {
this.__dirty_props__.translationX = this.translationX || 0;
this.__dirty_props__.translationY = this.translationY || 0;
this.__dirty_props__.scaleX = this.scaleX || 1;
@@ -208,6 +208,9 @@ export class View {
this.__dirty_props__.rotation = this.rotation || 0;
});
}
cancelAnimation(context, animation) {
return this.nativeChannel(context, "cancelAnimation")(animation.id);
}
}
__decorate([
Property,