js: add onAnimationEnd for image

This commit is contained in:
pengfei.zhou 2021-12-17 16:52:20 +08:00 committed by osborn
parent e4b27af938
commit e1b10b10bb
9 changed files with 35 additions and 1 deletions

View File

@ -2360,6 +2360,10 @@ var Image = /** @class */ (function (_super) {
Property, Property,
__metadata$b("design:type", Object) __metadata$b("design:type", Object)
], Image.prototype, "stretchInset", void 0); ], Image.prototype, "stretchInset", void 0);
__decorate$b([
Property,
__metadata$b("design:type", Function)
], Image.prototype, "onAnimationEnd", void 0);
return Image; return Image;
}(View)); }(View));
function image(config) { function image(config) {

View File

@ -1778,6 +1778,10 @@ __decorate$b([
Property, Property,
__metadata$b("design:type", Object) __metadata$b("design:type", Object)
], Image.prototype, "stretchInset", void 0); ], Image.prototype, "stretchInset", void 0);
__decorate$b([
Property,
__metadata$b("design:type", Function)
], Image.prototype, "onAnimationEnd", void 0);
function image(config) { function image(config) {
const ret = new Image; const ret = new Image;
ret.layoutConfig = layoutConfig().fit(); ret.layoutConfig = layoutConfig().fit();

View File

@ -3306,6 +3306,10 @@ __decorate$b([
Property, Property,
__metadata$b("design:type", Object) __metadata$b("design:type", Object)
], Image.prototype, "stretchInset", void 0); ], Image.prototype, "stretchInset", void 0);
__decorate$b([
Property,
__metadata$b("design:type", Function)
], Image.prototype, "onAnimationEnd", void 0);
function image(config) { function image(config) {
const ret = new Image; const ret = new Image;
ret.layoutConfig = layoutConfig().fit(); ret.layoutConfig = layoutConfig().fit();

4
doric-js/index.d.ts vendored
View File

@ -690,6 +690,10 @@ declare module 'doric/lib/src/widget/image' {
right: number; right: number;
bottom: number; bottom: number;
}; };
/**
* Called if loaded image is animated and played end.
*/
onAnimationEnd?: () => void;
isAnimating(context: BridgeContext): Promise<boolean>; isAnimating(context: BridgeContext): Promise<boolean>;
startAnimating(context: BridgeContext): Promise<any>; startAnimating(context: BridgeContext): Promise<any>;
stopAnimating(context: BridgeContext): Promise<any>; stopAnimating(context: BridgeContext): Promise<any>;

View File

@ -74,6 +74,10 @@ export declare class Image extends View {
right: number; right: number;
bottom: number; bottom: number;
}; };
/**
* Called if loaded image is animated and played end.
*/
onAnimationEnd?: () => void;
isAnimating(context: BridgeContext): Promise<boolean>; isAnimating(context: BridgeContext): Promise<boolean>;
startAnimating(context: BridgeContext): Promise<any>; startAnimating(context: BridgeContext): Promise<any>;
stopAnimating(context: BridgeContext): Promise<any>; stopAnimating(context: BridgeContext): Promise<any>;

View File

@ -116,6 +116,10 @@ __decorate([
Property, Property,
__metadata("design:type", Object) __metadata("design:type", Object)
], Image.prototype, "stretchInset", void 0); ], Image.prototype, "stretchInset", void 0);
__decorate([
Property,
__metadata("design:type", Function)
], Image.prototype, "onAnimationEnd", void 0);
export function image(config) { export function image(config) {
const ret = new Image; const ret = new Image;
ret.layoutConfig = layoutConfig().fit(); ret.layoutConfig = layoutConfig().fit();

View File

@ -115,6 +115,12 @@ export class Image extends View {
bottom: number bottom: number
} }
/**
* Called if loaded image is animated and played end.
*/
@Property
onAnimationEnd?: () => void
isAnimating(context: BridgeContext) { isAnimating(context: BridgeContext) {
return this.nativeChannel(context, "isAnimating")() as Promise<boolean> return this.nativeChannel(context, "isAnimating")() as Promise<boolean>
} }

View File

@ -3380,6 +3380,10 @@ __decorate$b([
Property, Property,
__metadata$b("design:type", Object) __metadata$b("design:type", Object)
], Image.prototype, "stretchInset", void 0); ], Image.prototype, "stretchInset", void 0);
__decorate$b([
Property,
__metadata$b("design:type", Function)
], Image.prototype, "onAnimationEnd", void 0);
function image(config) { function image(config) {
const ret = new Image; const ret = new Image;
ret.layoutConfig = layoutConfig().fit(); ret.layoutConfig = layoutConfig().fit();

File diff suppressed because one or more lines are too long