@nativescript/core 8.3.5-next-09-20-2022-3087616907 → 8.3.5
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/fps-meter/fps-native.android.d.ts +0 -1
- package/fps-meter/fps-native.android.js +4 -5
- package/fps-meter/fps-native.android.js.map +1 -1
- package/package.json +1 -1
- package/platforms/ios/src/UIView+NativeScript.h +1 -1
- package/platforms/ios/src/UIView+NativeScript.m +4 -2
- package/ui/animation/animation-common.js +17 -8
- package/ui/animation/animation-common.js.map +1 -1
- package/ui/animation/index.ios.js +149 -145
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/builder/binding-builder.js +12 -1
- package/ui/builder/binding-builder.js.map +1 -1
- package/ui/core/view/index.ios.js +1 -1
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/page/index.ios.js +6 -10
- package/ui/page/index.ios.js.map +1 -1
- package/ui/styling/css-selector/index.d.ts +1 -1
- package/ui/styling/style-scope.js +30 -40
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/text-base/index.ios.js +4 -4
- package/ui/text-base/index.ios.js.map +1 -1
|
@@ -4,7 +4,6 @@ export declare class FPSCallback implements definition.FPSCallback {
|
|
|
4
4
|
private onFrame;
|
|
5
5
|
running: boolean;
|
|
6
6
|
sdkVersion: number;
|
|
7
|
-
nativeFramesSupported: boolean;
|
|
8
7
|
constructor(onFrame: (currentTimeMillis: number) => void);
|
|
9
8
|
private _isNativeFramesSupported;
|
|
10
9
|
start(): void;
|
|
@@ -4,8 +4,7 @@ export class FPSCallback {
|
|
|
4
4
|
this.running = false;
|
|
5
5
|
this.onFrame = onFrame;
|
|
6
6
|
this.sdkVersion = parseInt(Device.sdkVersion);
|
|
7
|
-
|
|
8
|
-
if (this.nativeFramesSupported) {
|
|
7
|
+
if (this.sdkVersion >= 24 && this._isNativeFramesSupported()) {
|
|
9
8
|
this.impl = (nanos) => {
|
|
10
9
|
this.handleFrame(nanos);
|
|
11
10
|
};
|
|
@@ -25,7 +24,7 @@ export class FPSCallback {
|
|
|
25
24
|
if (this.running) {
|
|
26
25
|
return;
|
|
27
26
|
}
|
|
28
|
-
if (this.
|
|
27
|
+
if (this.sdkVersion >= 24 && this._isNativeFramesSupported()) {
|
|
29
28
|
global.__postFrameCallback(this.impl);
|
|
30
29
|
}
|
|
31
30
|
else {
|
|
@@ -37,7 +36,7 @@ export class FPSCallback {
|
|
|
37
36
|
if (!this.running) {
|
|
38
37
|
return;
|
|
39
38
|
}
|
|
40
|
-
if (this.
|
|
39
|
+
if (this.sdkVersion >= 24 && this._isNativeFramesSupported()) {
|
|
41
40
|
global.__removeFrameCallback(this.impl);
|
|
42
41
|
}
|
|
43
42
|
else {
|
|
@@ -52,7 +51,7 @@ export class FPSCallback {
|
|
|
52
51
|
// divide by 1 000 000 since the parameter is in nanoseconds
|
|
53
52
|
this.onFrame(nanos / 1000000);
|
|
54
53
|
// add the FrameCallback instance again since it is automatically removed from the Choreographer
|
|
55
|
-
if (this.
|
|
54
|
+
if (this.sdkVersion >= 24 && this._isNativeFramesSupported()) {
|
|
56
55
|
global.__postFrameCallback(this.impl);
|
|
57
56
|
}
|
|
58
57
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fps-native.android.js","sourceRoot":"","sources":["../../../../packages/core/fps-meter/fps-native.android.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,OAAO,WAAW;
|
|
1
|
+
{"version":3,"file":"fps-native.android.js","sourceRoot":"","sources":["../../../../packages/core/fps-meter/fps-native.android.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,OAAO,WAAW;IAMvB,YAAY,OAA4C;QACvD,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,CAAC,UAAU,GAAG,QA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AC,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAW,CAAC,CAAC;SAC/E;QAED,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACtB,CAAC;IAEO,WAAW,CAAC,KAAa;QAChC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YAClB,OAAO;SACP;QAED,4DAA4D;QAC5D,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,CAAC;QAC9B,gGAAgG;QAEhG,IAAI,IAAI,CAAC,UAAU,IAAI,EAAE,IAAI,IAAI,CAAC,wBAAwB,EAAE,EAAE;YAC5D,MAAc,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC/C;aAAM;YACN,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAW,CAAC,CAAC;SAC7E;IACF,CAAC;CACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nativescript/core",
|
|
3
|
-
"version": "8.3.5
|
|
3
|
+
"version": "8.3.5",
|
|
4
4
|
"description": "A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
- (void)nativeScriptSetTextDecorationAndTransform:(NSString*)text textDecoration:(NSString*)textDecoration letterSpacing:(CGFloat)letterSpacing lineHeight:(CGFloat)lineHeight;
|
|
10
10
|
|
|
11
|
-
-(void)nativeScriptSetFormattedTextDecorationAndTransform:(NSDictionary*)details
|
|
11
|
+
-(void)nativeScriptSetFormattedTextDecorationAndTransform:(NSDictionary*)details;
|
|
12
12
|
|
|
13
13
|
@end
|
|
@@ -75,7 +75,9 @@
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
-(void)nativeScriptSetFormattedTextDecorationAndTransform:(NSDictionary*)details
|
|
78
|
+
-(void)nativeScriptSetFormattedTextDecorationAndTransform:(NSDictionary*)details {
|
|
79
|
+
CGFloat letterSpacing = [[details valueForKey:@"letterSpacing"] doubleValue];
|
|
80
|
+
CGFloat lineHeight = [[details valueForKey:@"lineHeight"] doubleValue];
|
|
79
81
|
NSMutableAttributedString *attrText = [NativeScriptUtils createMutableStringWithDetails:details];
|
|
80
82
|
if (letterSpacing != 0) {
|
|
81
83
|
NSNumber *kern = [NSNumber numberWithDouble:letterSpacing * ((UITextView*)self).font.pointSize];
|
|
@@ -87,7 +89,7 @@
|
|
|
87
89
|
|
|
88
90
|
if (lineHeight > 0) {
|
|
89
91
|
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
|
|
90
|
-
paragraphStyle.
|
|
92
|
+
paragraphStyle.minimumLineHeight = lineHeight;
|
|
91
93
|
// make sure a possible previously set text alignment setting is not lost when line height is specified
|
|
92
94
|
if ([self isKindOfClass:[UIButton class]]) {
|
|
93
95
|
paragraphStyle.alignment = ((UIButton*)self).titleLabel.textAlignment;
|
|
@@ -24,7 +24,8 @@ export class CubicBezierAnimationCurve {
|
|
|
24
24
|
export class AnimationBase {
|
|
25
25
|
constructor(animationDefinitions, playSequentially) {
|
|
26
26
|
if (!animationDefinitions || animationDefinitions.length === 0) {
|
|
27
|
-
|
|
27
|
+
console.error('No animation definitions specified');
|
|
28
|
+
return;
|
|
28
29
|
}
|
|
29
30
|
if (Trace.isEnabled()) {
|
|
30
31
|
Trace.write('Analyzing ' + animationDefinitions.length + ' animation definitions...', Trace.categories.Animation);
|
|
@@ -37,7 +38,10 @@ export class AnimationBase {
|
|
|
37
38
|
this._propertyAnimations = this._propertyAnimations.concat(AnimationBase._createPropertyAnimations(animationDefinitions[i]));
|
|
38
39
|
}
|
|
39
40
|
if (this._propertyAnimations.length === 0) {
|
|
40
|
-
|
|
41
|
+
if (Trace.isEnabled()) {
|
|
42
|
+
Trace.write('Nothing to animate.', Trace.categories.Animation);
|
|
43
|
+
}
|
|
44
|
+
return;
|
|
41
45
|
}
|
|
42
46
|
if (Trace.isEnabled()) {
|
|
43
47
|
Trace.write('Created ' + this._propertyAnimations.length + ' individual property animations.', Trace.categories.Animation);
|
|
@@ -99,7 +103,8 @@ export class AnimationBase {
|
|
|
99
103
|
}
|
|
100
104
|
static _createPropertyAnimations(animationDefinition) {
|
|
101
105
|
if (!animationDefinition.target) {
|
|
102
|
-
|
|
106
|
+
console.error('No animation target specified.');
|
|
107
|
+
return;
|
|
103
108
|
}
|
|
104
109
|
for (const item in animationDefinition) {
|
|
105
110
|
const value = animationDefinition[item];
|
|
@@ -107,13 +112,16 @@ export class AnimationBase {
|
|
|
107
112
|
continue;
|
|
108
113
|
}
|
|
109
114
|
if ((item === Properties.opacity || item === 'duration' || item === 'delay' || item === 'iterations') && typeof value !== 'number') {
|
|
110
|
-
|
|
115
|
+
console.error(`Property ${item} must be valid number. Value: ${value}`);
|
|
116
|
+
return;
|
|
111
117
|
}
|
|
112
118
|
else if ((item === Properties.scale || item === Properties.translate) && (typeof value.x !== 'number' || typeof value.y !== 'number')) {
|
|
113
|
-
|
|
119
|
+
console.error(`Property ${item} must be valid Pair. Value: ${value}`);
|
|
120
|
+
return;
|
|
114
121
|
}
|
|
115
122
|
else if (item === Properties.backgroundColor && !Color.isValid(animationDefinition.backgroundColor)) {
|
|
116
|
-
|
|
123
|
+
console.error(`Property ${item} must be valid color. Value: ${value}`);
|
|
124
|
+
return;
|
|
117
125
|
}
|
|
118
126
|
else if (item === Properties.width || item === Properties.height) {
|
|
119
127
|
// Coerce input into a PercentLength object in case it's a string.
|
|
@@ -122,7 +130,8 @@ export class AnimationBase {
|
|
|
122
130
|
else if (item === Properties.rotate) {
|
|
123
131
|
const rotate = value;
|
|
124
132
|
if (typeof rotate !== 'number' && !(typeof rotate.x === 'number' && typeof rotate.y === 'number' && typeof rotate.z === 'number')) {
|
|
125
|
-
|
|
133
|
+
console.error(`Property ${rotate} must be valid number or Point3D. Value: ${value}`);
|
|
134
|
+
return;
|
|
126
135
|
}
|
|
127
136
|
}
|
|
128
137
|
}
|
|
@@ -220,7 +229,7 @@ export class AnimationBase {
|
|
|
220
229
|
});
|
|
221
230
|
}
|
|
222
231
|
if (propertyAnimations.length === 0) {
|
|
223
|
-
|
|
232
|
+
console.error('No known animation properties specified');
|
|
224
233
|
}
|
|
225
234
|
return propertyAnimations;
|
|
226
235
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animation-common.js","sourceRoot":"","sources":["../../../../../packages/core/ui/animation/animation-common.ts"],"names":[],"mappings":"AAIA,YAAY;AACZ,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,cAAc,wBAAwB,CAAC;AAEvC,MAAM,KAAW,UAAU,CAQ1B;AARD,WAAiB,UAAU;IACb,kBAAO,GAAG,SAAS,CAAC;IACpB,0BAAe,GAAG,iBAAiB,CAAC;IACpC,oBAAS,GAAG,WAAW,CAAC;IACxB,iBAAM,GAAG,QAAQ,CAAC;IAClB,gBAAK,GAAG,OAAO,CAAC;IAChB,iBAAM,GAAG,QAAQ,CAAC;IAClB,gBAAK,GAAG,OAAO,CAAC;AAC9B,CAAC,EARgB,UAAU,KAAV,UAAU,QAQ1B;AAED,MAAM,OAAO,yBAAyB;IAMrC,YAAY,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU;QACzD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACd,CAAC;CACD;AAED,MAAM,OAAgB,aAAa;IAOlC,YAAY,oBAAgD,EAAE,gBAA0B;QACvF,IAAI,CAAC,oBAAoB,IAAI,oBAAoB,CAAC,MAAM,KAAK,CAAC,EAAE;YAC/D,
|
|
1
|
+
{"version":3,"file":"animation-common.js","sourceRoot":"","sources":["../../../../../packages/core/ui/animation/animation-common.ts"],"names":[],"mappings":"AAIA,YAAY;AACZ,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,cAAc,wBAAwB,CAAC;AAEvC,MAAM,KAAW,UAAU,CAQ1B;AARD,WAAiB,UAAU;IACb,kBAAO,GAAG,SAAS,CAAC;IACpB,0BAAe,GAAG,iBAAiB,CAAC;IACpC,oBAAS,GAAG,WAAW,CAAC;IACxB,iBAAM,GAAG,QAAQ,CAAC;IAClB,gBAAK,GAAG,OAAO,CAAC;IAChB,iBAAM,GAAG,QAAQ,CAAC;IAClB,gBAAK,GAAG,OAAO,CAAC;AAC9B,CAAC,EARgB,UAAU,KAAV,UAAU,QAQ1B;AAED,MAAM,OAAO,yBAAyB;IAMrC,YAAY,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU;QACzD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACd,CAAC;CACD;AAED,MAAM,OAAgB,aAAa;IAOlC,YAAY,oBAAgD,EAAE,gBAA0B;QACvF,IAAI,CAAC,oBAAoB,IAAI,oBAAoB,CAAC,MAAM,KAAK,CAAC,EAAE;YAC/D,OAAO,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;YACpD,OAAO;SACP;QAED,IAAI,KAAK,CAAC,SAAS,EAAE,EAAE;YACtB,KAAK,CAAC,KAAK,CA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,CAAC;gBACvB,MAAM,EAAE,mBAAmB,CAAC,MAAM;gBAClC,QAAQ,EAAE,UAAU,CAAC,KAAK;gBAC1B,KAAK,EAAE,mBAAmB,CAAC,KAAK;gBAChC,QAAQ,EAAE,mBAAmB,CAAC,QAAQ;gBACtC,KAAK,EAAE,mBAAmB,CAAC,KAAK;gBAChC,UAAU,EAAE,mBAAmB,CAAC,UAAU;gBAC1C,KAAK,EAAE,mBAAmB,CAAC,KAAK;aAChC,CAAC,CAAC;SACH;QAED,IAAI,kBAAkB,CAAC,MAAM,KAAK,CAAC,EAAE;YACpC,OAAO,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;SACzD;QAED,OAAO,kBAAkB,CAAC;IAC3B,CAAC;IAEM,MAAM,CAAC,iBAAiB,CAAC,SAA4B;QAC3D,OAAO,IAAI,CAAC,SAAS,CAAC;YACrB,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE;YAC3B,QAAQ,EAAE,SAAS,CAAC,QAAQ;YAC5B,KAAK,EAAE,SAAS,CAAC,KAAK;YACtB,QAAQ,EAAE,SAAS,CAAC,QAAQ;YAC5B,KAAK,EAAE,SAAS,CAAC,KAAK;YACtB,UAAU,EAAE,SAAS,CAAC,UAAU;YAChC,KAAK,EAAE,SAAS,CAAC,KAAK;SACtB,CAAC,CAAC;IACJ,CAAC;CACD"}
|
|
@@ -109,7 +109,7 @@ export function _resolveAnimationCurve(curve) {
|
|
|
109
109
|
return CAMediaTimingFunction.functionWithControlPoints(animationCurve.x1, animationCurve.y1, animationCurve.x2, animationCurve.y2);
|
|
110
110
|
}
|
|
111
111
|
else {
|
|
112
|
-
|
|
112
|
+
console.error(`Invalid animation curve: ${curve}`);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -223,136 +223,138 @@ export class Animation extends AnimationBase {
|
|
|
223
223
|
let subPropertyNameToAnimate;
|
|
224
224
|
let toValue = animation.value;
|
|
225
225
|
let fromValue;
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
nativeView
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
toValue.x
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
toValue.y
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
226
|
+
if (nativeView === null || nativeView === void 0 ? void 0 : nativeView.layer) {
|
|
227
|
+
const setLocal = valueSource === 'animation';
|
|
228
|
+
switch (animation.property) {
|
|
229
|
+
case Properties.backgroundColor:
|
|
230
|
+
animation._originalValue = view.backgroundColor;
|
|
231
|
+
animation._propertyResetCallback = (value, valueSource) => {
|
|
232
|
+
style[setLocal ? backgroundColorProperty.name : backgroundColorProperty.keyframe] = value;
|
|
233
|
+
};
|
|
234
|
+
fromValue = nativeView.layer.backgroundColor;
|
|
235
|
+
if (nativeView instanceof UILabel) {
|
|
236
|
+
nativeView.setValueForKey(UIColor.clearColor, 'backgroundColor');
|
|
237
|
+
}
|
|
238
|
+
toValue = toValue.CGColor;
|
|
239
|
+
break;
|
|
240
|
+
case Properties.opacity:
|
|
241
|
+
animation._originalValue = view.opacity;
|
|
242
|
+
animation._propertyResetCallback = (value, valueSource) => {
|
|
243
|
+
style[setLocal ? opacityProperty.name : opacityProperty.keyframe] = value;
|
|
244
|
+
};
|
|
245
|
+
fromValue = nativeView.layer.opacity;
|
|
246
|
+
break;
|
|
247
|
+
case Properties.rotate:
|
|
248
|
+
animation._originalValue = {
|
|
249
|
+
x: view.rotateX,
|
|
250
|
+
y: view.rotateY,
|
|
251
|
+
z: view.rotate,
|
|
252
|
+
};
|
|
253
|
+
animation._propertyResetCallback = (value, valueSource) => {
|
|
254
|
+
style[setLocal ? rotateProperty.name : rotateProperty.keyframe] = value.z;
|
|
255
|
+
style[setLocal ? rotateXProperty.name : rotateXProperty.keyframe] = value.x;
|
|
256
|
+
style[setLocal ? rotateYProperty.name : rotateYProperty.keyframe] = value.y;
|
|
257
|
+
};
|
|
258
|
+
propertyNameToAnimate = 'transform.rotation';
|
|
259
|
+
subPropertyNameToAnimate = ['x', 'y', 'z'];
|
|
260
|
+
fromValue = {
|
|
261
|
+
x: nativeView.layer.valueForKeyPath('transform.rotation.x'),
|
|
262
|
+
y: nativeView.layer.valueForKeyPath('transform.rotation.y'),
|
|
263
|
+
z: nativeView.layer.valueForKeyPath('transform.rotation.z'),
|
|
264
|
+
};
|
|
265
|
+
if (animation.target.rotateX !== undefined && animation.target.rotateX !== 0 && Math.floor(toValue / 360) - toValue / 360 === 0) {
|
|
266
|
+
fromValue.x = (animation.target.rotateX * Math.PI) / 180;
|
|
267
|
+
}
|
|
268
|
+
if (animation.target.rotateY !== undefined && animation.target.rotateY !== 0 && Math.floor(toValue / 360) - toValue / 360 === 0) {
|
|
269
|
+
fromValue.y = (animation.target.rotateY * Math.PI) / 180;
|
|
270
|
+
}
|
|
271
|
+
if (animation.target.rotate !== undefined && animation.target.rotate !== 0 && Math.floor(toValue / 360) - toValue / 360 === 0) {
|
|
272
|
+
fromValue.z = (animation.target.rotate * Math.PI) / 180;
|
|
273
|
+
}
|
|
274
|
+
// Respect only value.z for back-compat until 3D rotations are implemented
|
|
275
|
+
toValue = {
|
|
276
|
+
x: (toValue.x * Math.PI) / 180,
|
|
277
|
+
y: (toValue.y * Math.PI) / 180,
|
|
278
|
+
z: (toValue.z * Math.PI) / 180,
|
|
279
|
+
};
|
|
280
|
+
break;
|
|
281
|
+
case Properties.translate:
|
|
282
|
+
animation._originalValue = {
|
|
283
|
+
x: view.translateX,
|
|
284
|
+
y: view.translateY,
|
|
285
|
+
};
|
|
286
|
+
animation._propertyResetCallback = (value, valueSource) => {
|
|
287
|
+
style[setLocal ? translateXProperty.name : translateXProperty.keyframe] = value.x;
|
|
288
|
+
style[setLocal ? translateYProperty.name : translateYProperty.keyframe] = value.y;
|
|
289
|
+
};
|
|
290
|
+
propertyNameToAnimate = 'transform';
|
|
291
|
+
fromValue = NSValue.valueWithCATransform3D(nativeView.layer.transform);
|
|
292
|
+
toValue = NSValue.valueWithCATransform3D(CATransform3DTranslate(nativeView.layer.transform, toValue.x, toValue.y, 0));
|
|
293
|
+
break;
|
|
294
|
+
case Properties.scale:
|
|
295
|
+
if (toValue.x === 0) {
|
|
296
|
+
toValue.x = 0.001;
|
|
297
|
+
}
|
|
298
|
+
if (toValue.y === 0) {
|
|
299
|
+
toValue.y = 0.001;
|
|
300
|
+
}
|
|
301
|
+
animation._originalValue = { x: view.scaleX, y: view.scaleY };
|
|
302
|
+
animation._propertyResetCallback = (value, valueSource) => {
|
|
303
|
+
style[setLocal ? scaleXProperty.name : scaleXProperty.keyframe] = value.x;
|
|
304
|
+
style[setLocal ? scaleYProperty.name : scaleYProperty.keyframe] = value.y;
|
|
305
|
+
};
|
|
306
|
+
propertyNameToAnimate = 'transform';
|
|
307
|
+
fromValue = NSValue.valueWithCATransform3D(nativeView.layer.transform);
|
|
308
|
+
toValue = NSValue.valueWithCATransform3D(CATransform3DScale(nativeView.layer.transform, toValue.x, toValue.y, 1));
|
|
309
|
+
break;
|
|
310
|
+
case _transform:
|
|
311
|
+
fromValue = NSValue.valueWithCATransform3D(nativeView.layer.transform);
|
|
312
|
+
animation._originalValue = {
|
|
313
|
+
xs: view.scaleX,
|
|
314
|
+
ys: view.scaleY,
|
|
315
|
+
xt: view.translateX,
|
|
316
|
+
yt: view.translateY,
|
|
317
|
+
rx: view.rotateX,
|
|
318
|
+
ry: view.rotateY,
|
|
319
|
+
rz: view.rotate,
|
|
320
|
+
};
|
|
321
|
+
animation._propertyResetCallback = (value, valueSource) => {
|
|
322
|
+
style[setLocal ? translateXProperty.name : translateXProperty.keyframe] = value.xt;
|
|
323
|
+
style[setLocal ? translateYProperty.name : translateYProperty.keyframe] = value.yt;
|
|
324
|
+
style[setLocal ? scaleXProperty.name : scaleXProperty.keyframe] = value.xs;
|
|
325
|
+
style[setLocal ? scaleYProperty.name : scaleYProperty.keyframe] = value.ys;
|
|
326
|
+
style[setLocal ? rotateXProperty.name : rotateXProperty.keyframe] = value.rx;
|
|
327
|
+
style[setLocal ? rotateYProperty.name : rotateYProperty.keyframe] = value.ry;
|
|
328
|
+
style[setLocal ? rotateProperty.name : rotateProperty.keyframe] = value.rz;
|
|
329
|
+
};
|
|
330
|
+
propertyNameToAnimate = 'transform';
|
|
331
|
+
toValue = NSValue.valueWithCATransform3D(Animation._createNativeAffineTransform(animation));
|
|
332
|
+
break;
|
|
333
|
+
case Properties.width:
|
|
334
|
+
case Properties.height: {
|
|
335
|
+
const direction = animation.property;
|
|
336
|
+
const isHeight = direction === 'height';
|
|
337
|
+
propertyNameToAnimate = 'bounds';
|
|
338
|
+
if (!parent) {
|
|
339
|
+
console.error(`cannot animate ${direction} on root view`);
|
|
340
|
+
}
|
|
341
|
+
const parentExtent = isHeight ? parent.getMeasuredHeight() : parent.getMeasuredWidth();
|
|
342
|
+
const asNumber = PercentLength.toDevicePixels(PercentLength.parse(toValue), parentExtent, parentExtent) / Screen.mainScreen.scale;
|
|
343
|
+
const currentBounds = nativeView.layer.bounds;
|
|
344
|
+
const extentX = isHeight ? currentBounds.size.width : asNumber;
|
|
345
|
+
const extentY = isHeight ? asNumber : currentBounds.size.height;
|
|
346
|
+
fromValue = NSValue.valueWithCGRect(currentBounds);
|
|
347
|
+
toValue = NSValue.valueWithCGRect(CGRectMake(currentBounds.origin.x, currentBounds.origin.y, extentX, extentY));
|
|
348
|
+
animation._originalValue = view.height;
|
|
349
|
+
animation._propertyResetCallback = (value, valueSource) => {
|
|
350
|
+
const prop = isHeight ? heightProperty : widthProperty;
|
|
351
|
+
style[setLocal ? prop.name : prop.keyframe] = value;
|
|
352
|
+
};
|
|
353
|
+
break;
|
|
339
354
|
}
|
|
340
|
-
|
|
341
|
-
|
|
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;
|
|
355
|
+
default:
|
|
356
|
+
console.error(`Animating property '${animation.property}' is unsupported`);
|
|
353
357
|
}
|
|
354
|
-
default:
|
|
355
|
-
throw new Error(`Animating property '${animation.property}' is unsupported`);
|
|
356
358
|
}
|
|
357
359
|
let duration = 0.3;
|
|
358
360
|
if (animation.duration !== undefined) {
|
|
@@ -383,24 +385,26 @@ export class Animation extends AnimationBase {
|
|
|
383
385
|
}
|
|
384
386
|
static _createNativeAnimation(propertyAnimations, index, playSequentially, args, animation, valueSource, finishedCallback) {
|
|
385
387
|
const nativeView = animation.target.nativeViewProtected;
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
else {
|
|
391
|
-
nativeAnimation = this._createBasicAnimation(args, animation);
|
|
392
|
-
}
|
|
393
|
-
const animationDelegate = AnimationDelegateImpl.initWithFinishedCallback(finishedCallback, animation, valueSource);
|
|
394
|
-
nativeAnimation.setValueForKey(animationDelegate, 'delegate');
|
|
395
|
-
nativeView.layer.addAnimationForKey(nativeAnimation, args.propertyNameToAnimate);
|
|
396
|
-
let callback = undefined;
|
|
397
|
-
if (index + 1 < propertyAnimations.length) {
|
|
398
|
-
callback = Animation._createiOSAnimationFunction(propertyAnimations, index + 1, playSequentially, valueSource, finishedCallback);
|
|
399
|
-
if (!playSequentially) {
|
|
400
|
-
callback();
|
|
388
|
+
if (nativeView === null || nativeView === void 0 ? void 0 : nativeView.layer) {
|
|
389
|
+
let nativeAnimation;
|
|
390
|
+
if (args.subPropertiesToAnimate) {
|
|
391
|
+
nativeAnimation = this._createGroupAnimation(args, animation);
|
|
401
392
|
}
|
|
402
393
|
else {
|
|
403
|
-
|
|
394
|
+
nativeAnimation = this._createBasicAnimation(args, animation);
|
|
395
|
+
}
|
|
396
|
+
const animationDelegate = AnimationDelegateImpl.initWithFinishedCallback(finishedCallback, animation, valueSource);
|
|
397
|
+
nativeAnimation.setValueForKey(animationDelegate, 'delegate');
|
|
398
|
+
nativeView.layer.addAnimationForKey(nativeAnimation, args.propertyNameToAnimate);
|
|
399
|
+
let callback = undefined;
|
|
400
|
+
if (index + 1 < propertyAnimations.length) {
|
|
401
|
+
callback = Animation._createiOSAnimationFunction(propertyAnimations, index + 1, playSequentially, valueSource, finishedCallback);
|
|
402
|
+
if (!playSequentially) {
|
|
403
|
+
callback();
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
animationDelegate.nextAnimation = callback;
|
|
407
|
+
}
|
|
404
408
|
}
|
|
405
409
|
}
|
|
406
410
|
}
|