feat:Add cancelAnimation and clearAnimation
This commit is contained in:
@@ -399,6 +399,19 @@ var View = /** @class */ (function () {
|
||||
}
|
||||
});
|
||||
};
|
||||
View.prototype.clearAnimation = function (context, animation) {
|
||||
var _this = this;
|
||||
return this.nativeChannel(context, "clearAnimation")(animation.id).then(function () {
|
||||
_this.__dirty_props__.translationX = _this.translationX || 0;
|
||||
_this.__dirty_props__.translationY = _this.translationY || 0;
|
||||
_this.__dirty_props__.scaleX = _this.scaleX || 1;
|
||||
_this.__dirty_props__.scaleY = _this.scaleY || 1;
|
||||
_this.__dirty_props__.rotation = _this.rotation || 0;
|
||||
});
|
||||
};
|
||||
View.prototype.cancelAnimation = function (context, animation) {
|
||||
return this.nativeChannel(context, "cancelAnimation")(animation.id);
|
||||
};
|
||||
__decorate$d([
|
||||
Property,
|
||||
__metadata$d("design:type", Number)
|
||||
|
@@ -314,8 +314,8 @@ 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;
|
||||
@@ -323,6 +323,9 @@ class View {
|
||||
this.__dirty_props__.rotation = this.rotation || 0;
|
||||
});
|
||||
}
|
||||
cancelAnimation(context, animation) {
|
||||
return this.nativeChannel(context, "cancelAnimation")(animation.id);
|
||||
}
|
||||
}
|
||||
__decorate$d([
|
||||
Property,
|
||||
|
@@ -1835,8 +1835,8 @@ 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;
|
||||
@@ -1844,6 +1844,9 @@ class View {
|
||||
this.__dirty_props__.rotation = this.rotation || 0;
|
||||
});
|
||||
}
|
||||
cancelAnimation(context, animation) {
|
||||
return this.nativeChannel(context, "cancelAnimation")(animation.id);
|
||||
}
|
||||
}
|
||||
__decorate$d([
|
||||
Property,
|
||||
|
3
doric-js/index.d.ts
vendored
3
doric-js/index.d.ts
vendored
@@ -298,7 +298,8 @@ declare module 'doric/lib/src/ui/view' {
|
||||
*/
|
||||
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 abstract class Superview extends View {
|
||||
subviewById(id: string): View | undefined;
|
||||
|
3
doric-js/lib/src/ui/view.d.ts
vendored
3
doric-js/lib/src/ui/view.d.ts
vendored
@@ -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;
|
||||
|
@@ -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,
|
||||
|
@@ -352,6 +352,10 @@ export abstract class View implements Modeling {
|
||||
this.__dirty_props__.rotation = this.rotation || 0
|
||||
})
|
||||
}
|
||||
|
||||
cancelAnimation(context: BridgeContext, animation: IAnimation) {
|
||||
return this.nativeChannel(context, "cancelAnimation")(animation.id)
|
||||
}
|
||||
}
|
||||
|
||||
export abstract class Superview extends View {
|
||||
|
Reference in New Issue
Block a user