@akylas/nativescript 8.2.2 → 8.2.4-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accessibility/index.ios.js +1 -1
- package/accessibility/index.ios.js.map +1 -1
- package/application/application-common.d.ts +4 -0
- package/application/application-common.js +8 -0
- package/application/application-common.js.map +1 -1
- package/application/index.android.d.ts +2 -2
- package/application/index.android.js +10 -3
- package/application/index.android.js.map +1 -1
- package/application/index.ios.d.ts +2 -0
- package/application/index.ios.js +11 -0
- package/application/index.ios.js.map +1 -1
- package/core-types/index.d.ts +1 -0
- package/core-types/index.js.map +1 -1
- package/css/LICENSE +9 -0
- package/css/Readme.md +278 -0
- package/css-value/LICENSE +9 -0
- package/css-value/Readme.md +45 -0
- package/css-value/UPGRADING.md +26 -0
- package/fetch/LICENSE +20 -0
- package/fetch/README.md +1 -0
- package/file-system/file-system-access.android.d.ts +1 -0
- package/file-system/file-system-access.android.js +1 -0
- package/file-system/file-system-access.android.js.map +1 -1
- package/file-system/file-system-access.ios.d.ts +2 -0
- package/file-system/file-system-access.ios.js +3 -0
- package/file-system/file-system-access.ios.js.map +1 -1
- package/file-system/index.js +17 -7
- package/file-system/index.js.map +1 -1
- package/index.d.ts +9 -2
- package/index.js +14 -2
- package/index.js.map +1 -1
- package/js-libs/easysax/LICENSE +20 -0
- package/js-libs/easysax/README.md +46 -0
- package/js-libs/esprima/LICENSE.BSD +19 -0
- package/js-libs/esprima/README.md +24 -0
- package/js-libs/polymer-expressions/LICENSE +27 -0
- package/js-libs/polymer-expressions/README.md +0 -0
- package/package.json +5 -13
- package/platforms/README.md +1 -0
- package/platforms/android/widgets-release.aar +0 -0
- package/ui/animation/animation-common.d.ts +7 -4
- package/ui/animation/animation-common.js +55 -117
- package/ui/animation/animation-common.js.map +1 -1
- package/ui/animation/animation-interfaces.d.ts +3 -2
- package/ui/animation/index.android.d.ts +15 -14
- package/ui/animation/index.android.js +99 -22
- package/ui/animation/index.android.js.map +1 -1
- package/ui/animation/index.ios.d.ts +33 -16
- package/ui/animation/index.ios.js +256 -202
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/animation/keyframe-animation.d.ts +0 -1
- package/ui/animation/keyframe-animation.js +51 -51
- package/ui/animation/keyframe-animation.js.map +1 -1
- package/ui/button/index.ios.js +1 -1
- package/ui/button/index.ios.js.map +1 -1
- package/ui/core/properties/index.d.ts +37 -6
- package/ui/core/properties/index.js +434 -643
- package/ui/core/properties/index.js.map +1 -1
- package/ui/core/view/index.android.d.ts +1 -0
- package/ui/core/view/index.android.js +5 -2
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.d.ts +5 -0
- package/ui/core/view/index.ios.d.ts +4 -2
- package/ui/core/view/index.ios.js +31 -10
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.d.ts +1 -0
- package/ui/core/view/view-common.js +6 -3
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.ios.js +2 -2
- package/ui/core/view-base/index.js +4 -5
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/editable-text-base/editable-text-base-common.js +2 -1
- package/ui/editable-text-base/editable-text-base-common.js.map +1 -1
- package/ui/frame/frame-common.d.ts +1 -1
- package/ui/frame/frame-common.js +15 -15
- package/ui/frame/frame-common.js.map +1 -1
- package/ui/frame/index.android.js +8 -3
- package/ui/frame/index.android.js.map +1 -1
- package/ui/html-view/html-view-common.js +2 -1
- package/ui/html-view/html-view-common.js.map +1 -1
- package/ui/image/image-common.js +2 -2
- package/ui/image/image-common.js.map +1 -1
- package/ui/label/index.ios.js +1 -1
- package/ui/label/index.ios.js.map +1 -1
- package/ui/layouts/root-layout/root-layout-common.js +2 -0
- package/ui/layouts/root-layout/root-layout-common.js.map +1 -1
- package/ui/list-view/list-view-common.js +2 -2
- package/ui/list-view/list-view-common.js.map +1 -1
- package/ui/page/page-common.js +2 -1
- package/ui/page/page-common.js.map +1 -1
- package/ui/proxy-view-container/index.d.ts +2 -0
- package/ui/proxy-view-container/index.js +28 -0
- package/ui/proxy-view-container/index.js.map +1 -1
- package/ui/search-bar/search-bar-common.js +3 -2
- package/ui/search-bar/search-bar-common.js.map +1 -1
- package/ui/segmented-bar/segmented-bar-common.js +2 -1
- package/ui/segmented-bar/segmented-bar-common.js.map +1 -1
- package/ui/styling/background.android.js +2 -0
- package/ui/styling/background.android.js.map +1 -1
- package/ui/styling/background.ios.js +21 -5
- package/ui/styling/background.ios.js.map +1 -1
- package/ui/styling/css-animation-parser.js +3 -2
- package/ui/styling/css-animation-parser.js.map +1 -1
- package/ui/styling/style/index.d.ts +1 -0
- package/ui/styling/style/index.js.map +1 -1
- package/ui/styling/style-properties.d.ts +1 -0
- package/ui/styling/style-properties.js +57 -69
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/styling/style-scope.js +4 -10
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/switch/switch-common.js +2 -1
- package/ui/switch/switch-common.js.map +1 -1
- package/ui/tab-view/index.ios.d.ts +1 -0
- package/ui/tab-view/index.ios.js +54 -24
- package/ui/tab-view/index.ios.js.map +1 -1
- package/ui/tab-view/tab-view-common.js +5 -4
- package/ui/tab-view/tab-view-common.js.map +1 -1
- package/ui/text-base/index.android.js +10 -1
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.d.ts +5 -0
- package/ui/text-base/index.ios.js +20 -0
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-base/text-base-common.d.ts +3 -0
- package/ui/text-base/text-base-common.js +12 -0
- package/ui/text-base/text-base-common.js.map +1 -1
- package/ui/text-view/index.android.js +1 -11
- package/ui/text-view/index.android.js.map +1 -1
- package/ui/text-view/index.ios.js +1 -13
- package/ui/text-view/index.ios.js.map +1 -1
- package/ui/text-view/text-view-common.d.ts +0 -2
- package/ui/text-view/text-view-common.js +0 -6
- package/ui/text-view/text-view-common.js.map +1 -1
- package/utils/index.d.ts +6 -0
- package/utils/mainthread-helper.android.d.ts +1 -0
- package/utils/mainthread-helper.android.js +7 -0
- package/utils/mainthread-helper.android.js.map +1 -1
- package/utils/mainthread-helper.d.ts +6 -0
- package/utils/mainthread-helper.ios.d.ts +1 -0
- package/utils/mainthread-helper.ios.js +10 -0
- package/utils/mainthread-helper.ios.js.map +1 -1
- package/utils/native-helper.android.d.ts +2 -0
- package/utils/native-helper.android.js +127 -0
- package/utils/native-helper.android.js.map +1 -1
- package/utils/native-helper.d.ts +17 -0
- package/utils/native-helper.ios.d.ts +2 -0
- package/utils/native-helper.ios.js +80 -0
- package/utils/native-helper.ios.js.map +1 -1
- package/utils/types.d.ts +2 -0
- package/utils/types.js +6 -0
- package/utils/types.js.map +1 -1
- package/utils/utils-common.d.ts +1 -0
- package/utils/utils-common.js +4 -1
- package/utils/utils-common.js.map +1 -1
- package/platforms/android/core.aar +0 -0
- package/platforms/android/nativescript.aar +0 -0
|
@@ -1,82 +1,85 @@
|
|
|
1
1
|
// Requires
|
|
2
2
|
import { AnimationBase, Properties, CubicBezierAnimationCurve } from './animation-common';
|
|
3
3
|
import { Trace } from '../../trace';
|
|
4
|
-
import {
|
|
4
|
+
import { rotateProperty, rotateXProperty, rotateYProperty, translateXProperty, translateYProperty, scaleXProperty, scaleYProperty, heightProperty, widthProperty, PercentLength } from '../styling/style-properties';
|
|
5
5
|
import { iOSNativeHelper } from '../../utils/native-helper';
|
|
6
6
|
import { Screen } from '../../platform';
|
|
7
|
+
import { Color } from '../../color';
|
|
7
8
|
export * from './animation-common';
|
|
8
9
|
export { KeyframeAnimation, KeyframeAnimationInfo, KeyframeDeclaration, KeyframeInfo } from './keyframe-animation';
|
|
9
10
|
const _transform = '_transform';
|
|
10
11
|
const _skip = '_skip';
|
|
11
|
-
const FLT_MAX = 340282346638528859811704183484516925440.0;
|
|
12
12
|
class AnimationInfo {
|
|
13
13
|
}
|
|
14
|
+
export function applyAnimationProperty(styleOrView, property, value, setKeyFrame) {
|
|
15
|
+
styleOrView[setKeyFrame && property['keyframe'] ? property['keyframe'] : property.name] = value;
|
|
16
|
+
}
|
|
14
17
|
var AnimationDelegateImpl = /** @class */ (function (_super) {
|
|
15
18
|
__extends(AnimationDelegateImpl, _super);
|
|
16
19
|
function AnimationDelegateImpl() {
|
|
17
20
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
18
21
|
}
|
|
19
|
-
AnimationDelegateImpl.initWithFinishedCallback = function (
|
|
22
|
+
AnimationDelegateImpl.initWithFinishedCallback = function (animation, propertyAnimation) {
|
|
20
23
|
var delegate = AnimationDelegateImpl.new();
|
|
21
|
-
delegate.
|
|
24
|
+
delegate._animation = animation;
|
|
22
25
|
delegate._propertyAnimation = propertyAnimation;
|
|
23
|
-
delegate._valueSource = valueSource;
|
|
24
26
|
return delegate;
|
|
25
27
|
};
|
|
26
28
|
AnimationDelegateImpl.prototype.animationDidStart = function (anim) {
|
|
29
|
+
var _a;
|
|
27
30
|
var value = this._propertyAnimation.value;
|
|
28
|
-
var
|
|
31
|
+
var animation = (_a = this._animation) === null || _a === void 0 ? void 0 : _a.get();
|
|
32
|
+
var setKeyFrame = (animation === null || animation === void 0 ? void 0 : animation.valueSource) === 'keyframe';
|
|
29
33
|
var targetStyle = this._propertyAnimation.target.style;
|
|
30
34
|
this._propertyAnimation.target._suspendPresentationLayerUpdates();
|
|
31
|
-
switch (this._propertyAnimation.
|
|
32
|
-
case Properties.backgroundColor:
|
|
33
|
-
targetStyle[setLocal ? backgroundColorProperty.name : backgroundColorProperty.keyframe] = value;
|
|
34
|
-
break;
|
|
35
|
-
case Properties.opacity:
|
|
36
|
-
targetStyle[setLocal ? opacityProperty.name : opacityProperty.keyframe] = value;
|
|
37
|
-
break;
|
|
35
|
+
switch (this._propertyAnimation.propertyName) {
|
|
38
36
|
case Properties.rotate:
|
|
39
|
-
targetStyle
|
|
40
|
-
targetStyle
|
|
41
|
-
targetStyle
|
|
37
|
+
applyAnimationProperty(targetStyle, rotateXProperty, value.x, setKeyFrame);
|
|
38
|
+
applyAnimationProperty(targetStyle, rotateYProperty, value.y, setKeyFrame);
|
|
39
|
+
applyAnimationProperty(targetStyle, rotateProperty, value.z, setKeyFrame);
|
|
42
40
|
break;
|
|
43
41
|
case Properties.translate:
|
|
44
|
-
targetStyle
|
|
45
|
-
targetStyle
|
|
46
|
-
break;
|
|
47
|
-
case Properties.height:
|
|
48
|
-
targetStyle[setLocal ? heightProperty.name : heightProperty.keyframe] = value;
|
|
49
|
-
break;
|
|
50
|
-
case Properties.width:
|
|
51
|
-
targetStyle[setLocal ? widthProperty.name : widthProperty.keyframe] = value;
|
|
42
|
+
applyAnimationProperty(targetStyle, translateXProperty, value.x, setKeyFrame);
|
|
43
|
+
applyAnimationProperty(targetStyle, translateYProperty, value.y, setKeyFrame);
|
|
52
44
|
break;
|
|
53
45
|
case Properties.scale:
|
|
54
|
-
targetStyle
|
|
55
|
-
targetStyle
|
|
46
|
+
applyAnimationProperty(targetStyle, scaleXProperty, value.x || 1e-6, setKeyFrame);
|
|
47
|
+
applyAnimationProperty(targetStyle, scaleYProperty, value.y || 1e-6, setKeyFrame);
|
|
56
48
|
break;
|
|
57
49
|
case _transform:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
targetStyle
|
|
50
|
+
var translateValue = value[Properties.rotate];
|
|
51
|
+
if (translateValue !== undefined) {
|
|
52
|
+
applyAnimationProperty(targetStyle, translateXProperty, translateValue.x, setKeyFrame);
|
|
53
|
+
applyAnimationProperty(targetStyle, translateYProperty, translateValue.y, setKeyFrame);
|
|
61
54
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
targetStyle
|
|
65
|
-
targetStyle
|
|
55
|
+
var rotateValue = value[Properties.rotate];
|
|
56
|
+
if (rotateValue !== undefined) {
|
|
57
|
+
applyAnimationProperty(targetStyle, rotateXProperty, rotateValue.x, setKeyFrame);
|
|
58
|
+
applyAnimationProperty(targetStyle, rotateYProperty, rotateValue.y, setKeyFrame);
|
|
59
|
+
applyAnimationProperty(targetStyle, rotateProperty, rotateValue.z, setKeyFrame);
|
|
66
60
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
targetStyle
|
|
61
|
+
var scaleValue = value[Properties.scale];
|
|
62
|
+
if (scaleValue !== undefined) {
|
|
63
|
+
var x = scaleValue.x;
|
|
64
|
+
var y = scaleValue.y;
|
|
65
|
+
applyAnimationProperty(targetStyle, scaleXProperty, scaleValue.x || 1e-6, setKeyFrame);
|
|
66
|
+
applyAnimationProperty(targetStyle, scaleYProperty, scaleValue.y || 1e-6, setKeyFrame);
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
default:
|
|
70
|
+
var property = this._propertyAnimation.property;
|
|
71
|
+
if (property) {
|
|
72
|
+
applyAnimationProperty(targetStyle, property, value, setKeyFrame);
|
|
72
73
|
}
|
|
73
74
|
break;
|
|
74
75
|
}
|
|
75
76
|
this._propertyAnimation.target._resumePresentationLayerUpdates();
|
|
76
77
|
};
|
|
77
78
|
AnimationDelegateImpl.prototype.animationDidStopFinished = function (anim, finished) {
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
var _a;
|
|
80
|
+
var animation = (_a = this._animation) === null || _a === void 0 ? void 0 : _a.get();
|
|
81
|
+
if (animation) {
|
|
82
|
+
animation.animationFinishedCallback(!finished);
|
|
80
83
|
}
|
|
81
84
|
if (finished && this.nextAnimation) {
|
|
82
85
|
this.nextAnimation();
|
|
@@ -116,6 +119,8 @@ export function _resolveAnimationCurve(curve) {
|
|
|
116
119
|
export class Animation extends AnimationBase {
|
|
117
120
|
constructor(animationDefinitions, playSequentially) {
|
|
118
121
|
super(animationDefinitions, playSequentially);
|
|
122
|
+
this._wasCancelled = false;
|
|
123
|
+
this.usePropertyAnimator = false;
|
|
119
124
|
this._valueSource = 'animation';
|
|
120
125
|
if (animationDefinitions.length > 0 && animationDefinitions[0].valueSource !== undefined) {
|
|
121
126
|
this._valueSource = animationDefinitions[0].valueSource;
|
|
@@ -132,46 +137,49 @@ export class Animation extends AnimationBase {
|
|
|
132
137
|
else {
|
|
133
138
|
this._mergedPropertyAnimations = this._propertyAnimations;
|
|
134
139
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
140
|
+
this._iOSAnimationFunction = this._createiOSAnimationFunction(this._mergedPropertyAnimations, 0, this._playSequentially);
|
|
141
|
+
}
|
|
142
|
+
get valueSource() {
|
|
143
|
+
return this._valueSource;
|
|
144
|
+
}
|
|
145
|
+
animationFinishedCallback(cancelled) {
|
|
146
|
+
if (this._playSequentially) {
|
|
147
|
+
// This function will be called by the last animation when done or by another animation if the user cancels them halfway through.
|
|
148
|
+
if (cancelled) {
|
|
149
|
+
this._rejectAnimationFinishedPromise();
|
|
145
150
|
}
|
|
146
151
|
else {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
152
|
+
this._resolveAnimationFinishedPromise();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
// This callback will be called by each INDIVIDUAL animation when it finishes or is cancelled.
|
|
157
|
+
if (cancelled) {
|
|
158
|
+
this._cancelledAnimations++;
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
this._finishedAnimations++;
|
|
162
|
+
}
|
|
163
|
+
if (this._cancelledAnimations > 0 && this._cancelledAnimations + this._finishedAnimations === this._mergedPropertyAnimations.length) {
|
|
164
|
+
if (Trace.isEnabled()) {
|
|
165
|
+
Trace.write(this._cancelledAnimations + ' animations cancelled.', Trace.categories.Animation);
|
|
159
166
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
167
|
+
this._rejectAnimationFinishedPromise();
|
|
168
|
+
}
|
|
169
|
+
else if (this._finishedAnimations === this._mergedPropertyAnimations.length) {
|
|
170
|
+
if (Trace.isEnabled()) {
|
|
171
|
+
Trace.write(this._finishedAnimations + ' animations finished.', Trace.categories.Animation);
|
|
165
172
|
}
|
|
173
|
+
this._resolveAnimationFinishedPromise();
|
|
166
174
|
}
|
|
167
|
-
}
|
|
168
|
-
this._iOSAnimationFunction = Animation._createiOSAnimationFunction(this._mergedPropertyAnimations, 0, this._playSequentially, this._valueSource, animationFinishedCallback);
|
|
175
|
+
}
|
|
169
176
|
}
|
|
170
177
|
play() {
|
|
171
178
|
if (this.isPlaying) {
|
|
172
179
|
return this._rejectAlreadyPlaying();
|
|
173
180
|
}
|
|
174
181
|
const animationFinishedPromise = super.play();
|
|
182
|
+
this._wasCancelled = false;
|
|
175
183
|
this._finishedAnimations = 0;
|
|
176
184
|
this._cancelledAnimations = 0;
|
|
177
185
|
this._iOSAnimationFunction();
|
|
@@ -182,6 +190,11 @@ export class Animation extends AnimationBase {
|
|
|
182
190
|
Trace.write('Animation is not currently playing.', Trace.categories.Animation, Trace.messageType.warn);
|
|
183
191
|
return;
|
|
184
192
|
}
|
|
193
|
+
this._wasCancelled = true;
|
|
194
|
+
// this._iOSAnimators.forEach((animator) => {
|
|
195
|
+
// animator.stopAnimation(false);
|
|
196
|
+
// animator.finishAnimationAtPosition(UIViewAnimatingPosition.Current);
|
|
197
|
+
// });
|
|
185
198
|
let i = 0;
|
|
186
199
|
const length = this._mergedPropertyAnimations.length;
|
|
187
200
|
for (; i < length; i++) {
|
|
@@ -195,64 +208,40 @@ export class Animation extends AnimationBase {
|
|
|
195
208
|
_resolveAnimationCurve(curve) {
|
|
196
209
|
return _resolveAnimationCurve(curve);
|
|
197
210
|
}
|
|
198
|
-
|
|
211
|
+
_createiOSAnimationFunction(propertyAnimations, index, playSequentially) {
|
|
199
212
|
return (cancelled) => {
|
|
200
|
-
if (cancelled
|
|
213
|
+
if (cancelled) {
|
|
201
214
|
if (Trace.isEnabled()) {
|
|
202
215
|
Trace.write('Animation ' + (index - 1).toString() + ' was cancelled. Will skip the rest of animations and call finishedCallback(true).', Trace.categories.Animation);
|
|
203
216
|
}
|
|
204
|
-
|
|
217
|
+
this.animationFinishedCallback(cancelled);
|
|
205
218
|
return;
|
|
206
219
|
}
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
if (animation.curve === 'spring') {
|
|
210
|
-
Animation._createNativeSpringAnimation(propertyAnimations, index, playSequentially, args, animation, valueSource, finishedCallback);
|
|
211
|
-
}
|
|
212
|
-
else {
|
|
213
|
-
Animation._createNativeAnimation(propertyAnimations, index, playSequentially, args, animation, valueSource, finishedCallback);
|
|
214
|
-
}
|
|
220
|
+
const animationInfo = propertyAnimations[index];
|
|
221
|
+
this._createNativeUIViewAnimation(propertyAnimations, index, playSequentially, animationInfo);
|
|
215
222
|
};
|
|
216
223
|
}
|
|
217
|
-
|
|
224
|
+
_getNativeAnimationArguments(animation, useCABasicAnimation = false) {
|
|
218
225
|
const view = animation.target;
|
|
219
226
|
const style = view.style;
|
|
220
227
|
const nativeView = view.nativeViewProtected;
|
|
221
228
|
const parent = view.parent;
|
|
222
|
-
let propertyNameToAnimate = animation.
|
|
229
|
+
let propertyNameToAnimate = animation.propertyName;
|
|
223
230
|
let subPropertyNameToAnimate;
|
|
224
231
|
let toValue = animation.value;
|
|
225
232
|
let fromValue;
|
|
226
|
-
const
|
|
227
|
-
switch (animation.
|
|
228
|
-
case Properties.backgroundColor:
|
|
229
|
-
animation._originalValue = view.backgroundColor;
|
|
230
|
-
animation._propertyResetCallback = (value, valueSource) => {
|
|
231
|
-
style[setLocal ? backgroundColorProperty.name : backgroundColorProperty.keyframe] = value;
|
|
232
|
-
};
|
|
233
|
-
fromValue = nativeView.layer.backgroundColor;
|
|
234
|
-
if (nativeView instanceof UILabel) {
|
|
235
|
-
nativeView.setValueForKey(UIColor.clearColor, 'backgroundColor');
|
|
236
|
-
}
|
|
237
|
-
toValue = toValue.CGColor;
|
|
238
|
-
break;
|
|
239
|
-
case Properties.opacity:
|
|
240
|
-
animation._originalValue = view.opacity;
|
|
241
|
-
animation._propertyResetCallback = (value, valueSource) => {
|
|
242
|
-
style[setLocal ? opacityProperty.name : opacityProperty.keyframe] = value;
|
|
243
|
-
};
|
|
244
|
-
fromValue = nativeView.layer.opacity;
|
|
245
|
-
break;
|
|
233
|
+
const setKeyFrame = this._valueSource === 'keyframe';
|
|
234
|
+
switch (animation.propertyName) {
|
|
246
235
|
case Properties.rotate:
|
|
247
236
|
animation._originalValue = {
|
|
248
237
|
x: view.rotateX,
|
|
249
238
|
y: view.rotateY,
|
|
250
239
|
z: view.rotate,
|
|
251
240
|
};
|
|
252
|
-
animation._propertyResetCallback = (value
|
|
253
|
-
style
|
|
254
|
-
style
|
|
255
|
-
style
|
|
241
|
+
animation._propertyResetCallback = (value) => {
|
|
242
|
+
applyAnimationProperty(style, rotateXProperty, value.x, setKeyFrame);
|
|
243
|
+
applyAnimationProperty(style, rotateYProperty, value.y, setKeyFrame);
|
|
244
|
+
applyAnimationProperty(style, rotateProperty, value.z, setKeyFrame);
|
|
256
245
|
};
|
|
257
246
|
propertyNameToAnimate = 'transform.rotation';
|
|
258
247
|
subPropertyNameToAnimate = ['x', 'y', 'z'];
|
|
@@ -283,24 +272,20 @@ export class Animation extends AnimationBase {
|
|
|
283
272
|
y: view.translateY,
|
|
284
273
|
};
|
|
285
274
|
animation._propertyResetCallback = (value, valueSource) => {
|
|
286
|
-
style
|
|
287
|
-
style
|
|
275
|
+
applyAnimationProperty(style, translateXProperty, value.x, setKeyFrame);
|
|
276
|
+
applyAnimationProperty(style, translateYProperty, value.y, setKeyFrame);
|
|
288
277
|
};
|
|
289
278
|
propertyNameToAnimate = 'transform';
|
|
290
279
|
fromValue = NSValue.valueWithCATransform3D(nativeView.layer.transform);
|
|
291
280
|
toValue = NSValue.valueWithCATransform3D(CATransform3DTranslate(nativeView.layer.transform, toValue.x, toValue.y, 0));
|
|
292
281
|
break;
|
|
293
282
|
case Properties.scale:
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
}
|
|
297
|
-
if (toValue.y === 0) {
|
|
298
|
-
toValue.y = 0.001;
|
|
299
|
-
}
|
|
283
|
+
toValue.x = toValue.x || 1e-6;
|
|
284
|
+
toValue.y = toValue.y || 1e-6;
|
|
300
285
|
animation._originalValue = { x: view.scaleX, y: view.scaleY };
|
|
301
286
|
animation._propertyResetCallback = (value, valueSource) => {
|
|
302
|
-
style
|
|
303
|
-
style
|
|
287
|
+
applyAnimationProperty(style, scaleXProperty, value.x, setKeyFrame);
|
|
288
|
+
applyAnimationProperty(style, scaleYProperty, value.y, setKeyFrame);
|
|
304
289
|
};
|
|
305
290
|
propertyNameToAnimate = 'transform';
|
|
306
291
|
fromValue = NSValue.valueWithCATransform3D(nativeView.layer.transform);
|
|
@@ -318,41 +303,64 @@ export class Animation extends AnimationBase {
|
|
|
318
303
|
rz: view.rotate,
|
|
319
304
|
};
|
|
320
305
|
animation._propertyResetCallback = (value, valueSource) => {
|
|
321
|
-
style
|
|
322
|
-
style
|
|
323
|
-
style
|
|
324
|
-
style
|
|
325
|
-
style
|
|
326
|
-
style
|
|
327
|
-
style
|
|
306
|
+
applyAnimationProperty(style, translateXProperty, value.xt, setKeyFrame);
|
|
307
|
+
applyAnimationProperty(style, translateYProperty, value.yt, setKeyFrame);
|
|
308
|
+
applyAnimationProperty(style, scaleXProperty, value.xs, setKeyFrame);
|
|
309
|
+
applyAnimationProperty(style, scaleYProperty, value.ys, setKeyFrame);
|
|
310
|
+
applyAnimationProperty(style, rotateXProperty, value.rx, setKeyFrame);
|
|
311
|
+
applyAnimationProperty(style, rotateYProperty, value.ry, setKeyFrame);
|
|
312
|
+
applyAnimationProperty(style, rotateProperty, value.rz, setKeyFrame);
|
|
328
313
|
};
|
|
329
314
|
propertyNameToAnimate = 'transform';
|
|
330
315
|
toValue = NSValue.valueWithCATransform3D(Animation._createNativeAffineTransform(animation));
|
|
331
316
|
break;
|
|
332
317
|
case Properties.width:
|
|
333
318
|
case Properties.height: {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
319
|
+
if (useCABasicAnimation) {
|
|
320
|
+
const direction = animation.propertyName;
|
|
321
|
+
const isHeight = direction === 'height';
|
|
322
|
+
propertyNameToAnimate = 'bounds';
|
|
323
|
+
if (!parent) {
|
|
324
|
+
throw new Error(`cannot animate ${direction} on root view`);
|
|
325
|
+
}
|
|
326
|
+
const parentExtent = isHeight ? parent.getMeasuredHeight() : parent.getMeasuredWidth();
|
|
327
|
+
const asNumber = PercentLength.toDevicePixels(PercentLength.parse(toValue), parentExtent, parentExtent) / Screen.mainScreen.scale;
|
|
328
|
+
const currentBounds = nativeView.layer.bounds;
|
|
329
|
+
const extentX = isHeight ? currentBounds.size.width : asNumber;
|
|
330
|
+
const extentY = isHeight ? asNumber : currentBounds.size.height;
|
|
331
|
+
fromValue = NSValue.valueWithCGRect(currentBounds);
|
|
332
|
+
toValue = NSValue.valueWithCGRect(CGRectMake(currentBounds.origin.x, currentBounds.origin.y, extentX, extentY));
|
|
333
|
+
animation._originalValue = view.height;
|
|
334
|
+
animation._propertyResetCallback = (value) => {
|
|
335
|
+
const prop = isHeight ? heightProperty : widthProperty;
|
|
336
|
+
applyAnimationProperty(style, prop, value, setKeyFrame);
|
|
337
|
+
};
|
|
338
|
+
break;
|
|
339
339
|
}
|
|
340
|
-
const parentExtent = isHeight ? parent.getMeasuredHeight() : parent.getMeasuredWidth();
|
|
341
|
-
const asNumber = PercentLength.toDevicePixels(PercentLength.parse(toValue), parentExtent, parentExtent) / Screen.mainScreen.scale;
|
|
342
|
-
const currentBounds = nativeView.layer.bounds;
|
|
343
|
-
const extentX = isHeight ? currentBounds.size.width : asNumber;
|
|
344
|
-
const extentY = isHeight ? asNumber : currentBounds.size.height;
|
|
345
|
-
fromValue = NSValue.valueWithCGRect(currentBounds);
|
|
346
|
-
toValue = NSValue.valueWithCGRect(CGRectMake(currentBounds.origin.x, currentBounds.origin.y, extentX, extentY));
|
|
347
|
-
animation._originalValue = view.height;
|
|
348
|
-
animation._propertyResetCallback = (value, valueSource) => {
|
|
349
|
-
const prop = isHeight ? heightProperty : widthProperty;
|
|
350
|
-
style[setLocal ? prop.name : prop.keyframe] = value;
|
|
351
|
-
};
|
|
352
|
-
break;
|
|
353
340
|
}
|
|
354
341
|
default:
|
|
355
|
-
|
|
342
|
+
if (animation.property) {
|
|
343
|
+
// animation._originalValue = view.backgroundColor;
|
|
344
|
+
animation._originalValue = animation.target.style[animation.property.name];
|
|
345
|
+
animation._propertyResetCallback = (value) => {
|
|
346
|
+
applyAnimationProperty(style, animation.property, value, setKeyFrame);
|
|
347
|
+
};
|
|
348
|
+
fromValue = animation._originalValue;
|
|
349
|
+
if (animation._originalValue instanceof Color) {
|
|
350
|
+
animation._originalValue = animation._originalValue;
|
|
351
|
+
fromValue = animation._originalValue.ios.CGColor;
|
|
352
|
+
}
|
|
353
|
+
if (toValue instanceof Color) {
|
|
354
|
+
if (nativeView instanceof UILabel) {
|
|
355
|
+
nativeView.setValueForKey(UIColor.clearColor, 'backgroundColor');
|
|
356
|
+
}
|
|
357
|
+
toValue = toValue.ios.CGColor;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
throw new Error(`Animating property '${propertyNameToAnimate}' is unsupported`);
|
|
362
|
+
}
|
|
363
|
+
break;
|
|
356
364
|
}
|
|
357
365
|
let duration = 0.3;
|
|
358
366
|
if (animation.duration !== undefined) {
|
|
@@ -365,7 +373,7 @@ export class Animation extends AnimationBase {
|
|
|
365
373
|
let repeatCount = undefined;
|
|
366
374
|
if (animation.iterations !== undefined) {
|
|
367
375
|
if (animation.iterations === Number.POSITIVE_INFINITY) {
|
|
368
|
-
repeatCount =
|
|
376
|
+
repeatCount = Number.MAX_VALUE;
|
|
369
377
|
}
|
|
370
378
|
else {
|
|
371
379
|
repeatCount = animation.iterations;
|
|
@@ -381,21 +389,23 @@ export class Animation extends AnimationBase {
|
|
|
381
389
|
delay: delay,
|
|
382
390
|
};
|
|
383
391
|
}
|
|
384
|
-
|
|
385
|
-
const
|
|
392
|
+
_createNativeAnimation(propertyAnimations, index, playSequentially) {
|
|
393
|
+
const animationInfo = propertyAnimations[index];
|
|
394
|
+
const args = this._getNativeAnimationArguments(animationInfo, true);
|
|
395
|
+
const nativeView = animationInfo.target.nativeViewProtected;
|
|
386
396
|
let nativeAnimation;
|
|
387
397
|
if (args.subPropertiesToAnimate) {
|
|
388
|
-
nativeAnimation = this._createGroupAnimation(args,
|
|
398
|
+
nativeAnimation = this._createGroupAnimation(args, animationInfo);
|
|
389
399
|
}
|
|
390
400
|
else {
|
|
391
|
-
nativeAnimation = this._createBasicAnimation(args,
|
|
401
|
+
nativeAnimation = this._createBasicAnimation(args, animationInfo);
|
|
392
402
|
}
|
|
393
|
-
const animationDelegate = AnimationDelegateImpl.initWithFinishedCallback(
|
|
403
|
+
const animationDelegate = AnimationDelegateImpl.initWithFinishedCallback(new WeakRef(this), animationInfo);
|
|
394
404
|
nativeAnimation.setValueForKey(animationDelegate, 'delegate');
|
|
395
405
|
nativeView.layer.addAnimationForKey(nativeAnimation, args.propertyNameToAnimate);
|
|
396
406
|
let callback = undefined;
|
|
397
407
|
if (index + 1 < propertyAnimations.length) {
|
|
398
|
-
callback =
|
|
408
|
+
callback = this._createiOSAnimationFunction(propertyAnimations, index + 1, playSequentially);
|
|
399
409
|
if (!playSequentially) {
|
|
400
410
|
callback();
|
|
401
411
|
}
|
|
@@ -404,7 +414,7 @@ export class Animation extends AnimationBase {
|
|
|
404
414
|
}
|
|
405
415
|
}
|
|
406
416
|
}
|
|
407
|
-
|
|
417
|
+
_createGroupAnimation(args, animation) {
|
|
408
418
|
const groupAnimation = CAAnimationGroup.new();
|
|
409
419
|
groupAnimation.duration = args.duration;
|
|
410
420
|
if (args.repeatCount !== undefined) {
|
|
@@ -428,8 +438,9 @@ export class Animation extends AnimationBase {
|
|
|
428
438
|
groupAnimation.animations = animations;
|
|
429
439
|
return groupAnimation;
|
|
430
440
|
}
|
|
431
|
-
|
|
432
|
-
const basicAnimation = CABasicAnimation.animationWithKeyPath(args.propertyNameToAnimate);
|
|
441
|
+
_createBasicAnimation(args, animation) {
|
|
442
|
+
const basicAnimation = (animation.curve === 'spring' ? CASpringAnimation : CABasicAnimation).animationWithKeyPath(args.propertyNameToAnimate);
|
|
443
|
+
basicAnimation['damping'] = 0.2;
|
|
433
444
|
basicAnimation.fromValue = args.fromValue;
|
|
434
445
|
basicAnimation.toValue = args.toValue;
|
|
435
446
|
basicAnimation.duration = args.duration;
|
|
@@ -444,12 +455,13 @@ export class Animation extends AnimationBase {
|
|
|
444
455
|
}
|
|
445
456
|
return basicAnimation;
|
|
446
457
|
}
|
|
447
|
-
|
|
448
|
-
const
|
|
458
|
+
_createNativeUIViewAnimation(propertyAnimations, index, playSequentially, animationInfo) {
|
|
459
|
+
const args = this._getNativeAnimationArguments(animationInfo);
|
|
460
|
+
const nativeView = animationInfo.target.nativeViewProtected;
|
|
449
461
|
let callback = undefined;
|
|
450
462
|
let nextAnimation;
|
|
451
463
|
if (index + 1 < propertyAnimations.length) {
|
|
452
|
-
callback =
|
|
464
|
+
callback = this._createiOSAnimationFunction(propertyAnimations, index + 1, playSequentially);
|
|
453
465
|
if (!playSequentially) {
|
|
454
466
|
callback();
|
|
455
467
|
}
|
|
@@ -461,64 +473,94 @@ export class Animation extends AnimationBase {
|
|
|
461
473
|
if (args.delay) {
|
|
462
474
|
delay = args.delay;
|
|
463
475
|
}
|
|
464
|
-
|
|
476
|
+
const isSpring = animationInfo.curve === 'spring';
|
|
477
|
+
let animationOptions = 2 /* AllowUserInteraction */;
|
|
478
|
+
const animate = () => {
|
|
465
479
|
if (args.repeatCount !== undefined) {
|
|
466
480
|
UIView.setAnimationRepeatCount(args.repeatCount);
|
|
467
481
|
}
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
animation.target.backgroundColor = args.toValue;
|
|
471
|
-
break;
|
|
472
|
-
case Properties.opacity:
|
|
473
|
-
animation.target.opacity = args.toValue;
|
|
474
|
-
break;
|
|
475
|
-
case Properties.height:
|
|
476
|
-
case Properties.width:
|
|
477
|
-
animation._originalValue = animation.target[animation.property];
|
|
478
|
-
nativeView.layer.setValueForKey(args.toValue, args.propertyNameToAnimate);
|
|
479
|
-
animation._propertyResetCallback = function (value) {
|
|
480
|
-
animation.target[animation.property] = value;
|
|
481
|
-
};
|
|
482
|
-
break;
|
|
482
|
+
const setKeyFrame = this._valueSource === 'keyframe';
|
|
483
|
+
switch (animationInfo.propertyName) {
|
|
483
484
|
case _transform:
|
|
484
|
-
|
|
485
|
+
animationInfo._originalValue = nativeView.layer.transform;
|
|
485
486
|
nativeView.layer.setValueForKey(args.toValue, args.propertyNameToAnimate);
|
|
486
|
-
|
|
487
|
+
animationInfo._propertyResetCallback = function (value) {
|
|
487
488
|
nativeView.layer.transform = value;
|
|
488
489
|
};
|
|
489
490
|
break;
|
|
491
|
+
default:
|
|
492
|
+
applyAnimationProperty(animationInfo.target, animationInfo.property, animationInfo.value, setKeyFrame);
|
|
493
|
+
if (animationInfo.property.affectsLayout) {
|
|
494
|
+
(animationInfo.target.page || animationInfo.target).nativeViewProtected.layoutIfNeeded();
|
|
495
|
+
}
|
|
496
|
+
break;
|
|
490
497
|
}
|
|
491
|
-
}
|
|
498
|
+
};
|
|
499
|
+
const finish = (animationDidFinish) => {
|
|
492
500
|
if (animationDidFinish) {
|
|
493
|
-
if (
|
|
494
|
-
if (
|
|
495
|
-
|
|
496
|
-
|
|
501
|
+
if (animationInfo.propertyName === _transform) {
|
|
502
|
+
if (animationInfo.value[Properties.translate] !== undefined) {
|
|
503
|
+
animationInfo.target.translateX = animationInfo.value[Properties.translate].x;
|
|
504
|
+
animationInfo.target.translateY = animationInfo.value[Properties.translate].y;
|
|
497
505
|
}
|
|
498
|
-
if (
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
506
|
+
if (animationInfo.value[Properties.rotate] !== undefined) {
|
|
507
|
+
animationInfo.target.rotateX = animationInfo.value[Properties.rotate].x;
|
|
508
|
+
animationInfo.target.rotateY = animationInfo.value[Properties.rotate].y;
|
|
509
|
+
animationInfo.target.rotate = animationInfo.value[Properties.rotate].z;
|
|
502
510
|
}
|
|
503
|
-
if (
|
|
504
|
-
|
|
505
|
-
|
|
511
|
+
if (animationInfo.value[Properties.scale] !== undefined) {
|
|
512
|
+
animationInfo.target.scaleX = animationInfo.value[Properties.scale].x;
|
|
513
|
+
animationInfo.target.scaleY = animationInfo.value[Properties.scale].y;
|
|
506
514
|
}
|
|
507
515
|
}
|
|
508
516
|
}
|
|
509
517
|
else {
|
|
510
|
-
if (
|
|
511
|
-
|
|
518
|
+
if (animationInfo._propertyResetCallback) {
|
|
519
|
+
animationInfo._propertyResetCallback(animationInfo._originalValue);
|
|
512
520
|
}
|
|
513
521
|
}
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
}
|
|
518
|
-
if (animationDidFinish && nextAnimation) {
|
|
522
|
+
const cancelled = !animationDidFinish;
|
|
523
|
+
this.animationFinishedCallback(cancelled);
|
|
524
|
+
if (animationDidFinish && nextAnimation && !this._wasCancelled) {
|
|
519
525
|
nextAnimation();
|
|
520
526
|
}
|
|
521
|
-
}
|
|
527
|
+
};
|
|
528
|
+
if (this.usePropertyAnimator) {
|
|
529
|
+
const finishCallback = (position) => finish(position === 0 /* End */);
|
|
530
|
+
if (isSpring) {
|
|
531
|
+
const animator = UIViewPropertyAnimator.alloc().initWithDurationDampingRatioAnimations(args.duration, 0.2, null);
|
|
532
|
+
animator.manualHitTestingEnabled = true;
|
|
533
|
+
animator.addAnimations(animate);
|
|
534
|
+
animator.addCompletion(finishCallback);
|
|
535
|
+
// for seems to be the only way to use a timeout. It is not too bad but would be better to be handled natively
|
|
536
|
+
// for this example this breaks slow animations in debugger
|
|
537
|
+
if (args.delay) {
|
|
538
|
+
setTimeout(() => {
|
|
539
|
+
animator.startAnimation();
|
|
540
|
+
}, args.delay * 1000);
|
|
541
|
+
}
|
|
542
|
+
else {
|
|
543
|
+
animator.startAnimation();
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
else {
|
|
547
|
+
CATransaction.begin();
|
|
548
|
+
CATransaction.setAnimationTimingFunction(animationInfo.curve);
|
|
549
|
+
UIViewPropertyAnimator.runningPropertyAnimatorWithDurationDelayOptionsAnimationsCompletion(args.duration, args.delay, animationOptions, animate, finishCallback);
|
|
550
|
+
CATransaction.commit();
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
else {
|
|
554
|
+
if (isSpring) {
|
|
555
|
+
UIView.animateWithDurationDelayUsingSpringWithDampingInitialSpringVelocityOptionsAnimationsCompletion(args.duration, delay, 0.2, 0, 196608 /* CurveLinear */ | animationOptions, animate, finish);
|
|
556
|
+
}
|
|
557
|
+
else {
|
|
558
|
+
CATransaction.begin();
|
|
559
|
+
CATransaction.setAnimationTimingFunction(animationInfo.curve);
|
|
560
|
+
UIView.animateWithDurationDelayOptionsAnimationsCompletion(args.duration, delay, animationOptions, animate, finish);
|
|
561
|
+
CATransaction.commit();
|
|
562
|
+
}
|
|
563
|
+
}
|
|
522
564
|
}
|
|
523
565
|
static _createNativeAffineTransform(animation) {
|
|
524
566
|
const value = animation.value;
|
|
@@ -529,17 +571,28 @@ export class Animation extends AnimationBase {
|
|
|
529
571
|
result = CATransform3DTranslate(result, x, y, 0);
|
|
530
572
|
}
|
|
531
573
|
if (value[Properties.scale] !== undefined) {
|
|
532
|
-
const x = value[Properties.scale].x;
|
|
533
|
-
const y = value[Properties.scale].y;
|
|
534
|
-
result = CATransform3DScale(result, x
|
|
574
|
+
const x = value[Properties.scale].x || 1e-6;
|
|
575
|
+
const y = value[Properties.scale].y || 1e-6;
|
|
576
|
+
result = CATransform3DScale(result, x, y, 1);
|
|
577
|
+
}
|
|
578
|
+
if (value[Properties.rotate] !== undefined) {
|
|
579
|
+
const x = value[Properties.rotate].x;
|
|
580
|
+
const y = value[Properties.rotate].y;
|
|
581
|
+
const z = value[Properties.rotate].z;
|
|
582
|
+
const perspective = animation.target.perspective || 300;
|
|
583
|
+
// Only set perspective if there is 3D rotation
|
|
584
|
+
if (x || y) {
|
|
585
|
+
result.m34 = -1 / perspective;
|
|
586
|
+
}
|
|
587
|
+
result = iOSNativeHelper.applyRotateTransform(result, x, y, z);
|
|
535
588
|
}
|
|
536
589
|
return result;
|
|
537
590
|
}
|
|
538
591
|
static _isAffineTransform(property) {
|
|
539
|
-
return property === _transform || property === Properties.translate || property === Properties.scale;
|
|
592
|
+
return property === _transform || property === Properties.translate || property === Properties.rotate || property === Properties.scale;
|
|
540
593
|
}
|
|
541
594
|
static _canBeMerged(animation1, animation2) {
|
|
542
|
-
const result = Animation._isAffineTransform(animation1.
|
|
595
|
+
const result = Animation._isAffineTransform(animation1.propertyName) && Animation._isAffineTransform(animation2.propertyName) && animation1.target === animation2.target && animation1.duration === animation2.duration && animation1.delay === animation2.delay && animation1.iterations === animation2.iterations && animation1.curve === animation2.curve;
|
|
543
596
|
return result;
|
|
544
597
|
}
|
|
545
598
|
static _mergeAffineTransformAnimations(propertyAnimations) {
|
|
@@ -551,7 +604,7 @@ export class Animation extends AnimationBase {
|
|
|
551
604
|
if (propertyAnimations[i][_skip]) {
|
|
552
605
|
continue;
|
|
553
606
|
}
|
|
554
|
-
if (!Animation._isAffineTransform(propertyAnimations[i].
|
|
607
|
+
if (!Animation._isAffineTransform(propertyAnimations[i].propertyName)) {
|
|
555
608
|
// This is not an affine transform animation, so there is nothing to merge.
|
|
556
609
|
result.push(propertyAnimations[i]);
|
|
557
610
|
}
|
|
@@ -565,7 +618,8 @@ export class Animation extends AnimationBase {
|
|
|
565
618
|
// }
|
|
566
619
|
const newTransformAnimation = {
|
|
567
620
|
target: propertyAnimations[i].target,
|
|
568
|
-
|
|
621
|
+
propertyName: _transform,
|
|
622
|
+
property: null,
|
|
569
623
|
value: {},
|
|
570
624
|
duration: propertyAnimations[i].duration,
|
|
571
625
|
delay: propertyAnimations[i].delay,
|
|
@@ -575,7 +629,7 @@ export class Animation extends AnimationBase {
|
|
|
575
629
|
if (Trace.isEnabled()) {
|
|
576
630
|
Trace.write('Curve: ' + propertyAnimations[i].curve, Trace.categories.Animation);
|
|
577
631
|
}
|
|
578
|
-
newTransformAnimation.value[propertyAnimations[i].
|
|
632
|
+
newTransformAnimation.value[propertyAnimations[i].propertyName] = propertyAnimations[i].value;
|
|
579
633
|
if (Trace.isEnabled()) {
|
|
580
634
|
Trace.write('Created new transform animation: ' + Animation._getAnimationInfo(newTransformAnimation), Trace.categories.Animation);
|
|
581
635
|
}
|
|
@@ -587,7 +641,7 @@ export class Animation extends AnimationBase {
|
|
|
587
641
|
if (Trace.isEnabled()) {
|
|
588
642
|
Trace.write('Merging animations: ' + Animation._getAnimationInfo(newTransformAnimation) + ' + ' + Animation._getAnimationInfo(propertyAnimations[j]) + ';', Trace.categories.Animation);
|
|
589
643
|
}
|
|
590
|
-
newTransformAnimation.value[propertyAnimations[j].
|
|
644
|
+
newTransformAnimation.value[propertyAnimations[j].propertyName] = propertyAnimations[j].value;
|
|
591
645
|
// Mark that it has been merged so we can skip it on our outer loop.
|
|
592
646
|
propertyAnimations[j][_skip] = true;
|
|
593
647
|
}
|