forked from NativeScript/nativescript-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanimation-driver.ts
More file actions
18 lines (15 loc) · 970 Bytes
/
animation-driver.ts
File metadata and controls
18 lines (15 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { AnimationKeyframe } from '@angular/core/src/animation/animation_keyframe';
import { AnimationPlayer } from '@angular/core/src/animation/animation_player';
import { AnimationStyles } from '@angular/core/src/animation/animation_styles';
import { AnimationDriver } from '@angular/core/src/animation/animation_driver';
import { NativeScriptAnimationPlayer } from './animation-player';
import {View} from "ui/core/view";
import styleProperty = require('ui/styling/style-property');
export class NativeScriptAnimationDriver implements AnimationDriver {
computeStyle(element: any, prop: string): string {
return (<View>element).style._getValue(styleProperty.getPropertyByCssName(prop));
}
animate(element: any, startingStyles: AnimationStyles, keyframes: AnimationKeyframe[], duration: number, delay: number, easing: string): AnimationPlayer {
return new NativeScriptAnimationPlayer(element, keyframes, duration, delay, easing);
}
}