@nativescript-community/ui-image 4.1.8 → 4.3.0
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/CHANGELOG.md +30 -0
- package/README.md +354 -286
- package/angular/directives.d.ts +2 -2
- package/angular/esm2020/directives.mjs +15 -0
- package/angular/esm2020/index.mjs +2 -0
- package/angular/esm2020/module.mjs +22 -0
- package/angular/esm2020/nativescript-community-ui-image-angular.mjs +2 -0
- package/angular/fesm2015/nativescript-community-ui-image-angular.mjs +39 -0
- package/angular/fesm2020/nativescript-community-ui-image-angular.mjs +35 -0
- package/angular/module.d.ts +3 -3
- package/angular/package.json +22 -8
- package/blueprint.md +561 -0
- package/{image-common.d.ts → index-common.d.ts} +3 -0
- package/{image-common.js → index-common.js} +30 -7
- package/{image.android.d.ts → index.android.d.ts} +3 -2
- package/{image.android.js → index.android.js} +50 -40
- package/{image.d.ts → index.d.ts} +3 -3
- package/{image.ios.d.ts → index.ios.d.ts} +3 -2
- package/{image.ios.js → index.ios.js} +18 -18
- package/package.json +12 -4
- package/platforms/android/include.gradle +5 -6
- package/platforms/android/java/com/nativescript/image/ScalingBlurPostprocessor.java +0 -2
- package/platforms/android/java/com/nativescript/image/ScalingUtils.java +487 -0
- package/platforms/android/ui_image.aar +0 -0
- package/platforms/ios/Podfile +1 -1
- package/vue/index.js +1 -1
- package/angular/bundles/nativescript-community-ui-image-angular.umd.js +0 -49
- package/angular/bundles/nativescript-community-ui-image-angular.umd.min.js +0 -2
- package/angular/esm2015/directives.js +0 -15
- package/angular/esm2015/index.js +0 -2
- package/angular/esm2015/module.js +0 -21
- package/angular/esm2015/nativescript-community-ui-image-angular.js +0 -2
- package/angular/fesm2015/nativescript-community-ui-image-angular.js +0 -33
- package/image-common.metadata.json +0 -1
- package/image.android.metadata.json +0 -1
- package/image.ios.metadata.json +0 -1
@@ -1,15 +1,15 @@
|
|
1
1
|
var _a, _b, _c, _d;
|
2
|
-
export * from './
|
3
|
-
import { ImageAsset, ImageSource, Trace, knownFolders, path } from '@nativescript/core';
|
2
|
+
export * from './index-common';
|
3
|
+
import { Color, Image, ImageAsset, ImageSource, Trace, Utils, knownFolders, path } from '@nativescript/core';
|
4
4
|
import { android as androidApp } from '@nativescript/core/application';
|
5
5
|
import { isString } from '@nativescript/core/utils/types';
|
6
6
|
import { RESOURCE_PREFIX, ad, isFileOrResourcePath, isFontIconURI } from '@nativescript/core/utils/utils';
|
7
|
-
import { CLog, CLogTypes, EventData, ImageBase, ScaleType } from './
|
7
|
+
import { CLog, CLogTypes, EventData, ImageBase, ScaleType } from './index-common';
|
8
8
|
let initialized = false;
|
9
9
|
let initializeConfig;
|
10
10
|
export function initialize(config) {
|
11
11
|
if (!initialized) {
|
12
|
-
const context =
|
12
|
+
const context = ad.getApplicationContext();
|
13
13
|
if (!context) {
|
14
14
|
initializeConfig = config;
|
15
15
|
return;
|
@@ -128,7 +128,7 @@ export class ImagePipeline {
|
|
128
128
|
}
|
129
129
|
datasource.subscribe(new com.nativescript.image.BaseDataSubscriber(new com.nativescript.image.BaseDataSubscriberListener({
|
130
130
|
onFailure: reject,
|
131
|
-
onNewResult: resolve
|
131
|
+
onNewResult: resolve
|
132
132
|
})), com.facebook.common.executors.CallerThreadExecutor.getInstance());
|
133
133
|
}
|
134
134
|
catch (error) {
|
@@ -251,7 +251,7 @@ export class Img extends ImageBase {
|
|
251
251
|
return view;
|
252
252
|
}
|
253
253
|
updateViewSize(imageInfo) {
|
254
|
-
const draweeView = this.
|
254
|
+
const draweeView = this.nativeImageViewProtected;
|
255
255
|
if (!draweeView) {
|
256
256
|
return;
|
257
257
|
}
|
@@ -310,6 +310,12 @@ export class Img extends ImageBase {
|
|
310
310
|
[ImageBase.roundTopLeftRadiusProperty.setNative]() {
|
311
311
|
this.updateHierarchy();
|
312
312
|
}
|
313
|
+
[ImageBase.imageRotationProperty.setNative](value) {
|
314
|
+
var _e;
|
315
|
+
const scaleType = this.nativeImageViewProtected.getHierarchy().getActualImageScaleType();
|
316
|
+
(_e = scaleType['setImageRotation']) === null || _e === void 0 ? void 0 : _e.call(scaleType, value);
|
317
|
+
this.nativeImageViewProtected.invalidate();
|
318
|
+
}
|
313
319
|
[ImageBase.roundTopRightRadiusProperty.setNative]() {
|
314
320
|
this.updateHierarchy();
|
315
321
|
}
|
@@ -338,7 +344,7 @@ export class Img extends ImageBase {
|
|
338
344
|
this.initImage();
|
339
345
|
}
|
340
346
|
async initImage() {
|
341
|
-
if (this.
|
347
|
+
if (this.nativeImageViewProtected) {
|
342
348
|
const src = this.src;
|
343
349
|
if (src instanceof Promise) {
|
344
350
|
this.src = await src;
|
@@ -359,7 +365,7 @@ export class Img extends ImageBase {
|
|
359
365
|
}
|
360
366
|
}
|
361
367
|
if (drawable) {
|
362
|
-
const hierarchy = this.
|
368
|
+
const hierarchy = this.nativeImageViewProtected.getHierarchy();
|
363
369
|
hierarchy.setImage(drawable, 1, hierarchy.getFadeDuration() === 0);
|
364
370
|
return;
|
365
371
|
}
|
@@ -407,7 +413,7 @@ export class Img extends ImageBase {
|
|
407
413
|
eventName: ImageBase.finalImageSetEvent,
|
408
414
|
object: nativeView,
|
409
415
|
imageInfo: info,
|
410
|
-
animatable: animatable
|
416
|
+
animatable: animatable
|
411
417
|
};
|
412
418
|
nativeView.notify(args);
|
413
419
|
}
|
@@ -426,7 +432,7 @@ export class Img extends ImageBase {
|
|
426
432
|
const args = {
|
427
433
|
eventName: ImageBase.failureEvent,
|
428
434
|
object: nativeView,
|
429
|
-
error: imageError
|
435
|
+
error: imageError
|
430
436
|
};
|
431
437
|
that.get().notify(args);
|
432
438
|
}
|
@@ -444,7 +450,7 @@ export class Img extends ImageBase {
|
|
444
450
|
const args = {
|
445
451
|
eventName: ImageBase.intermediateImageFailedEvent,
|
446
452
|
object: nativeView,
|
447
|
-
error: imageError
|
453
|
+
error: imageError
|
448
454
|
};
|
449
455
|
that.get().notify(args);
|
450
456
|
}
|
@@ -463,7 +469,7 @@ export class Img extends ImageBase {
|
|
463
469
|
const args = {
|
464
470
|
eventName: ImageBase.intermediateImageSetEvent,
|
465
471
|
object: nativeView,
|
466
|
-
imageInfo: info
|
472
|
+
imageInfo: info
|
467
473
|
};
|
468
474
|
that.get().notify(args);
|
469
475
|
}
|
@@ -479,7 +485,7 @@ export class Img extends ImageBase {
|
|
479
485
|
if (nativeView) {
|
480
486
|
const args = {
|
481
487
|
eventName: ImageBase.releaseEvent,
|
482
|
-
object: nativeView
|
488
|
+
object: nativeView
|
483
489
|
};
|
484
490
|
that.get().notify(args);
|
485
491
|
}
|
@@ -495,20 +501,20 @@ export class Img extends ImageBase {
|
|
495
501
|
if (nativeView) {
|
496
502
|
const args = {
|
497
503
|
eventName: ImageBase.submitEvent,
|
498
|
-
object: nativeView
|
504
|
+
object: nativeView
|
499
505
|
};
|
500
506
|
that.get().notify(args);
|
501
507
|
}
|
502
508
|
else {
|
503
509
|
console.log("Warning: WeakRef<Image> was GC and no 'submitEvent' callback will be raised.");
|
504
510
|
}
|
505
|
-
}
|
511
|
+
}
|
506
512
|
});
|
507
513
|
const builder = com.facebook.drawee.backends.pipeline.Fresco.newDraweeControllerBuilder();
|
508
514
|
builder.setImageRequest(request);
|
509
515
|
builder.setCallerContext(src);
|
510
516
|
builder.setControllerListener(listener);
|
511
|
-
builder.setOldController(this.
|
517
|
+
builder.setOldController(this.nativeImageViewProtected.getController());
|
512
518
|
if (Trace.isEnabled()) {
|
513
519
|
builder.setPerfDataListener(new com.facebook.drawee.backends.pipeline.info.ImagePerfDataListener({
|
514
520
|
onImageLoadStatusUpdated(param0, param1) {
|
@@ -516,7 +522,7 @@ export class Img extends ImageBase {
|
|
516
522
|
},
|
517
523
|
onImageVisibilityUpdated(param0, param1) {
|
518
524
|
CLog(CLogTypes.info, 'onImageVisibilityUpdated', param0, param1);
|
519
|
-
}
|
525
|
+
}
|
520
526
|
}));
|
521
527
|
}
|
522
528
|
if (this.lowerResSrc) {
|
@@ -529,11 +535,11 @@ export class Img extends ImageBase {
|
|
529
535
|
builder.setTapToRetryEnabled(this.tapToRetryEnabled);
|
530
536
|
}
|
531
537
|
const controller = builder.build();
|
532
|
-
this.
|
538
|
+
this.nativeImageViewProtected.setController(controller);
|
533
539
|
}
|
534
540
|
else {
|
535
|
-
this.
|
536
|
-
this.
|
541
|
+
this.nativeImageViewProtected.setController(null);
|
542
|
+
this.nativeImageViewProtected.setImageBitmap(null);
|
537
543
|
}
|
538
544
|
}
|
539
545
|
}
|
@@ -542,7 +548,7 @@ export class Img extends ImageBase {
|
|
542
548
|
this._needUpdateHierarchy = true;
|
543
549
|
return;
|
544
550
|
}
|
545
|
-
if (this.
|
551
|
+
if (this.nativeImageViewProtected) {
|
546
552
|
let failureImageDrawable;
|
547
553
|
let placeholderImageDrawable;
|
548
554
|
let backgroundDrawable;
|
@@ -566,7 +572,7 @@ export class Img extends ImageBase {
|
|
566
572
|
builder.setPlaceholderImage(placeholderImageDrawable, this.stretch);
|
567
573
|
}
|
568
574
|
if (this.stretch) {
|
569
|
-
builder.setActualImageScaleType(this.stretch);
|
575
|
+
builder.setActualImageScaleType(this.stretch, this.imageRotation);
|
570
576
|
}
|
571
577
|
if (this.fadeDuration) {
|
572
578
|
builder.setFadeDuration(this.fadeDuration);
|
@@ -591,14 +597,14 @@ export class Img extends ImageBase {
|
|
591
597
|
builder.setCornersRadii(topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius);
|
592
598
|
}
|
593
599
|
const hierarchy = builder.build();
|
594
|
-
this.
|
600
|
+
this.nativeImageViewProtected.setHierarchy(hierarchy);
|
595
601
|
}
|
596
602
|
}
|
597
603
|
getDrawable(path) {
|
598
604
|
let drawable;
|
599
605
|
if (typeof path === 'string') {
|
600
606
|
if (isFontIconURI(path)) {
|
601
|
-
const fontIconCode =
|
607
|
+
const fontIconCode = path.split('//')[1];
|
602
608
|
if (fontIconCode !== undefined) {
|
603
609
|
const font = this.style.fontInternal;
|
604
610
|
const color = this.style.color;
|
@@ -632,8 +638,8 @@ export class Img extends ImageBase {
|
|
632
638
|
return identifier;
|
633
639
|
}
|
634
640
|
startAnimating() {
|
635
|
-
if (this.
|
636
|
-
const controller = this.
|
641
|
+
if (this.nativeImageViewProtected) {
|
642
|
+
const controller = this.nativeImageViewProtected.getController();
|
637
643
|
if (controller) {
|
638
644
|
const animatable = controller.getAnimatable();
|
639
645
|
if (animatable) {
|
@@ -643,8 +649,8 @@ export class Img extends ImageBase {
|
|
643
649
|
}
|
644
650
|
}
|
645
651
|
stopAnimating() {
|
646
|
-
if (this.
|
647
|
-
const controller = this.
|
652
|
+
if (this.nativeImageViewProtected) {
|
653
|
+
const controller = this.nativeImageViewProtected.getController();
|
648
654
|
if (controller) {
|
649
655
|
const animatable = controller.getAnimatable();
|
650
656
|
if (animatable) {
|
@@ -668,7 +674,7 @@ __decorate([
|
|
668
674
|
], Img.prototype, _d, null);
|
669
675
|
class GenericDraweeHierarchyBuilder {
|
670
676
|
constructor() {
|
671
|
-
const res =
|
677
|
+
const res = ad.getApplicationContext().getResources();
|
672
678
|
this.nativeBuilder = new com.facebook.drawee.generic.GenericDraweeHierarchyBuilder(res);
|
673
679
|
}
|
674
680
|
setPlaceholderImage(drawable, scaleType) {
|
@@ -702,11 +708,15 @@ class GenericDraweeHierarchyBuilder {
|
|
702
708
|
}
|
703
709
|
return this;
|
704
710
|
}
|
705
|
-
setActualImageScaleType(scaleType) {
|
711
|
+
setActualImageScaleType(scaleType, imageRotation) {
|
706
712
|
if (!this.nativeBuilder) {
|
707
713
|
return this;
|
708
714
|
}
|
709
|
-
|
715
|
+
const nativeScaleType = getScaleType(scaleType);
|
716
|
+
if (nativeScaleType['setImageRotation']) {
|
717
|
+
nativeScaleType['setImageRotation'](imageRotation);
|
718
|
+
}
|
719
|
+
this.nativeBuilder.setActualImageScaleType(nativeScaleType);
|
710
720
|
return this;
|
711
721
|
}
|
712
722
|
build() {
|
@@ -762,28 +772,28 @@ function getScaleType(scaleType) {
|
|
762
772
|
if (isString(scaleType)) {
|
763
773
|
switch (scaleType) {
|
764
774
|
case ScaleType.Center:
|
765
|
-
return com.
|
775
|
+
return com.nativescript.image.ScalingUtils.ScaleType.CENTER;
|
766
776
|
case ScaleType.AspectFill:
|
767
777
|
case ScaleType.CenterCrop:
|
768
|
-
return com.
|
778
|
+
return com.nativescript.image.ScalingUtils.ScaleType.CENTER_CROP;
|
769
779
|
case ScaleType.CenterInside:
|
770
|
-
return com.
|
780
|
+
return com.nativescript.image.ScalingUtils.ScaleType.CENTER_INSIDE;
|
771
781
|
case ScaleType.FitCenter:
|
772
782
|
case ScaleType.AspectFit:
|
773
|
-
return com.
|
783
|
+
return com.nativescript.image.ScalingUtils.ScaleType.FIT_CENTER;
|
774
784
|
case ScaleType.FitEnd:
|
775
|
-
return com.
|
785
|
+
return com.nativescript.image.ScalingUtils.ScaleType.FIT_END;
|
776
786
|
case ScaleType.FitStart:
|
777
|
-
return com.
|
787
|
+
return com.nativescript.image.ScalingUtils.ScaleType.FIT_START;
|
778
788
|
case ScaleType.Fill:
|
779
789
|
case ScaleType.FitXY:
|
780
|
-
return com.
|
790
|
+
return com.nativescript.image.ScalingUtils.ScaleType.FIT_XY;
|
781
791
|
case ScaleType.FocusCrop:
|
782
|
-
return com.
|
792
|
+
return com.nativescript.image.ScalingUtils.ScaleType.FOCUS_CROP;
|
783
793
|
default:
|
784
794
|
break;
|
785
795
|
}
|
786
796
|
}
|
787
797
|
return null;
|
788
798
|
}
|
789
|
-
//# sourceMappingURL=
|
799
|
+
//# sourceMappingURL=index.android.js.map
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { ImageAsset, ImageSource, View } from '@nativescript/core';
|
2
2
|
|
3
|
-
|
4
3
|
/**
|
5
4
|
* When called, initializes the android Image library. Calling this method is required.
|
6
5
|
* A good place to call it is at the application onLaunch() method.
|
@@ -75,7 +74,7 @@ export class Img extends View {
|
|
75
74
|
/**
|
76
75
|
* String value used for the image URI.
|
77
76
|
*/
|
78
|
-
src: string | ImageSource | ImageAsset | Promise<string | ImageSource | ImageAsset
|
77
|
+
src: string | ImageSource | ImageAsset | Promise<string | ImageSource | ImageAsset>;
|
79
78
|
|
80
79
|
/**
|
81
80
|
* String value used for the lower res image URI.
|
@@ -429,7 +428,7 @@ export enum ScaleType {
|
|
429
428
|
/**
|
430
429
|
* Scales the child so that both dimensions will be greater than or equal to the corresponding dimension of the parent.
|
431
430
|
*/
|
432
|
-
focusCrop
|
431
|
+
focusCrop
|
433
432
|
}
|
434
433
|
|
435
434
|
/**
|
@@ -439,3 +438,4 @@ export enum ScaleType {
|
|
439
438
|
export interface ImagePipelineConfigSetting {
|
440
439
|
isDownsampleEnabled?: boolean;
|
441
440
|
}
|
441
|
+
export const ImageViewTraceCategory;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
export * from './
|
2
|
-
import { EventData, ImageBase, ImageInfo as ImageInfoBase, ImagePipelineConfigSetting } from './
|
1
|
+
export * from './index-common';
|
2
|
+
import { EventData, ImageBase, ImageInfo as ImageInfoBase, ImagePipelineConfigSetting } from './index-common';
|
3
3
|
export declare class ImageInfo implements ImageInfoBase {
|
4
4
|
private width;
|
5
5
|
private height;
|
@@ -32,6 +32,7 @@ export declare class ImagePipeline {
|
|
32
32
|
export declare function getImagePipeline(): ImagePipeline;
|
33
33
|
export declare class Img extends ImageBase {
|
34
34
|
nativeViewProtected: SDAnimatedImageView | UIImageView;
|
35
|
+
nativeImageViewProtected: SDAnimatedImageView | UIImageView;
|
35
36
|
isLoading: boolean;
|
36
37
|
private _imageSourceAffectsLayout;
|
37
38
|
createNativeView(): UIImageView;
|
@@ -1,8 +1,8 @@
|
|
1
|
-
export * from './
|
1
|
+
export * from './index-common';
|
2
2
|
import { ImageAsset, ImageSource, Screen, Trace, knownFolders, path } from '@nativescript/core';
|
3
3
|
import { isString } from '@nativescript/core/utils/types';
|
4
4
|
import { RESOURCE_PREFIX, isFileOrResourcePath, isFontIconURI, layout } from '@nativescript/core/utils/utils';
|
5
|
-
import { CLog, CLogTypes, ImageBase, ScaleType } from './
|
5
|
+
import { CLog, CLogTypes, EventData, ImageBase, ScaleType } from './index-common';
|
6
6
|
export class ImageInfo {
|
7
7
|
constructor(width, height) {
|
8
8
|
this.width = width;
|
@@ -173,13 +173,13 @@ export class Img extends ImageBase {
|
|
173
173
|
this._setNativeImage(image, animate);
|
174
174
|
}
|
175
175
|
if (!this.autoPlayAnimations) {
|
176
|
-
this.
|
176
|
+
this.nativeImageViewProtected.stopAnimating();
|
177
177
|
}
|
178
178
|
if (error) {
|
179
179
|
const args = {
|
180
180
|
eventName: Img.failureEvent,
|
181
181
|
object: this,
|
182
|
-
error
|
182
|
+
error
|
183
183
|
};
|
184
184
|
this.notify(args);
|
185
185
|
if (this.failureImageUri) {
|
@@ -192,7 +192,7 @@ export class Img extends ImageBase {
|
|
192
192
|
eventName: ImageBase.finalImageSetEvent,
|
193
193
|
object: this,
|
194
194
|
imageInfo: new ImageInfo(image.size.width, image.size.height),
|
195
|
-
ios: image
|
195
|
+
ios: image
|
196
196
|
};
|
197
197
|
this.notify(args);
|
198
198
|
}
|
@@ -218,7 +218,7 @@ export class Img extends ImageBase {
|
|
218
218
|
const widthMode = layout.getMeasureSpecMode(widthMeasureSpec);
|
219
219
|
const height = layout.getMeasureSpecSize(heightMeasureSpec);
|
220
220
|
const heightMode = layout.getMeasureSpecMode(heightMeasureSpec);
|
221
|
-
const image = this.
|
221
|
+
const image = this.nativeImageViewProtected.image;
|
222
222
|
const finiteWidth = widthMode === layout.EXACTLY;
|
223
223
|
const finiteHeight = heightMode === layout.EXACTLY;
|
224
224
|
this._imageSourceAffectsLayout = !finiteWidth || !finiteHeight;
|
@@ -257,14 +257,14 @@ export class Img extends ImageBase {
|
|
257
257
|
}
|
258
258
|
_setNativeImage(nativeImage, animated = true) {
|
259
259
|
if (animated) {
|
260
|
-
this.
|
261
|
-
this.
|
260
|
+
this.nativeImageViewProtected.alpha = 0.0;
|
261
|
+
this.nativeImageViewProtected.image = nativeImage;
|
262
262
|
UIView.animateWithDurationAnimations(this.fadeDuration / 1000, () => {
|
263
|
-
this.
|
263
|
+
this.nativeImageViewProtected.alpha = this.opacity;
|
264
264
|
});
|
265
265
|
}
|
266
266
|
else {
|
267
|
-
this.
|
267
|
+
this.nativeImageViewProtected.image = nativeImage;
|
268
268
|
}
|
269
269
|
if (this._imageSourceAffectsLayout) {
|
270
270
|
this._imageSourceAffectsLayout = false;
|
@@ -278,11 +278,11 @@ export class Img extends ImageBase {
|
|
278
278
|
let image;
|
279
279
|
if (typeof imagePath === 'string') {
|
280
280
|
if (isFontIconURI(imagePath)) {
|
281
|
-
const fontIconCode =
|
281
|
+
const fontIconCode = imagePath.split('//')[1];
|
282
282
|
if (fontIconCode !== undefined) {
|
283
283
|
const font = this.style.fontInternal;
|
284
284
|
const color = this.style.color;
|
285
|
-
image =
|
285
|
+
image = ImageSource.fromFontIconCodeSync(fontIconCode, font, color).ios;
|
286
286
|
}
|
287
287
|
}
|
288
288
|
if (!image && isFileOrResourcePath(imagePath)) {
|
@@ -312,7 +312,7 @@ export class Img extends ImageBase {
|
|
312
312
|
}
|
313
313
|
else if (typeof src === 'string') {
|
314
314
|
if (isFontIconURI(src)) {
|
315
|
-
const fontIconCode =
|
315
|
+
const fontIconCode = src.split('//')[1];
|
316
316
|
if (fontIconCode !== undefined) {
|
317
317
|
const font = this.style.fontInternal;
|
318
318
|
const color = this.style.color;
|
@@ -361,7 +361,7 @@ export class Img extends ImageBase {
|
|
361
361
|
}
|
362
362
|
context.setValueForKey(SDImagePipelineTransformer.transformerWithTransformers(transformers), SDWebImageContextImageTransformer);
|
363
363
|
}
|
364
|
-
this.
|
364
|
+
this.nativeImageViewProtected.sd_setImageWithURLPlaceholderImageOptionsContextProgressCompleted(uri, this.placeholderImage, options, context, this.onLoadProgress, this.handleImageLoaded);
|
365
365
|
}
|
366
366
|
else if (this.placeholderImage) {
|
367
367
|
this._setNativeImage(this.placeholderImage);
|
@@ -384,13 +384,13 @@ export class Img extends ImageBase {
|
|
384
384
|
if (!this.nativeView) {
|
385
385
|
return;
|
386
386
|
}
|
387
|
-
this.
|
387
|
+
this.nativeImageViewProtected.contentMode = getUIImageScaleType(value);
|
388
388
|
}
|
389
389
|
startAnimating() {
|
390
|
-
this.
|
390
|
+
this.nativeImageViewProtected.startAnimating();
|
391
391
|
}
|
392
392
|
stopAnimating() {
|
393
|
-
this.
|
393
|
+
this.nativeImageViewProtected.stopAnimating();
|
394
394
|
}
|
395
395
|
}
|
396
|
-
//# sourceMappingURL=
|
396
|
+
//# sourceMappingURL=index.ios.js.map
|
package/package.json
CHANGED
@@ -1,10 +1,18 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nativescript-community/ui-image",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.3.0",
|
4
4
|
"description": "Advanced and efficient image display plugin which uses Fresco (Android) and SDWebImage (iOS) to implement caching, placeholders, image effects, and much more.",
|
5
|
-
"main": "./
|
5
|
+
"main": "./index",
|
6
6
|
"sideEffects": false,
|
7
|
-
"typings": "./
|
7
|
+
"typings": "./index.d.ts",
|
8
|
+
"scripts": {
|
9
|
+
"build": "npm run tsc && npm run readme",
|
10
|
+
"build.all": "npm run build && npm run build.angular",
|
11
|
+
"build.angular": "../../node_modules/.bin/ng-packagr -p ../../src/image/angular/ng-package.json -c ../../src/image/angular/tsconfig.json",
|
12
|
+
"readme": "../../node_modules/.bin/readme generate -c ../../tools/readme/blueprint.json",
|
13
|
+
"tsc": "../../node_modules/.bin/cpy '**/*.d.ts' '../../packages/image' --parents --cwd=../../src/image && ../../node_modules/.bin/tsc -skipLibCheck -d",
|
14
|
+
"clean": "../../node_modules/.bin/rimraf ./*.d.ts ./*.js ./*.js.map"
|
15
|
+
},
|
8
16
|
"nativescript": {
|
9
17
|
"platforms": {
|
10
18
|
"android": "6.0.0",
|
@@ -36,5 +44,5 @@
|
|
36
44
|
},
|
37
45
|
"license": "Apache-2.0",
|
38
46
|
"readmeFilename": "README.md",
|
39
|
-
"gitHead": "
|
47
|
+
"gitHead": "33aa9b9b923101c0c3f37f22a3ebaf245d6aa91e"
|
40
48
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import groovy.json.JsonSlurper
|
2
2
|
dependencies {
|
3
|
-
def frescoVersion = project.hasProperty("frescoVersion") ? project.frescoVersion : "2.
|
3
|
+
def frescoVersion = project.hasProperty("frescoVersion") ? project.frescoVersion : "2.6.0"
|
4
4
|
|
5
5
|
implementation("com.facebook.fresco:fresco:$frescoVersion") {
|
6
6
|
exclude group: 'com.facebook.soloader', module: 'soloader'
|
@@ -17,13 +17,12 @@ dependencies {
|
|
17
17
|
|
18
18
|
repositories {
|
19
19
|
mavenCentral()
|
20
|
-
def
|
21
|
-
def
|
22
|
-
def appPackageJsonFile = file("$appDir/package.json")
|
20
|
+
def widgetsDir = "$USER_PROJECT_ROOT/node_modules/@nativescript/core/platforms/android"
|
21
|
+
def appPackageJsonFile = file("$USER_PROJECT_ROOT/package.json")
|
23
22
|
if (appPackageJsonFile.exists()) {
|
24
23
|
def appPackageJson = new JsonSlurper().parseText(appPackageJsonFile.text)
|
25
|
-
if (appPackageJson.dependencies
|
26
|
-
widgetsDir = "$
|
24
|
+
if (appPackageJson.dependencies['@akylas/nativescript'] != null) {
|
25
|
+
widgetsDir = "$USER_PROJECT_ROOT/node_modules/@akylas/nativescript/platforms/android"
|
27
26
|
}
|
28
27
|
}
|
29
28
|
flatDir {
|
@@ -11,7 +11,6 @@ import android.graphics.Bitmap;
|
|
11
11
|
import android.graphics.Canvas;
|
12
12
|
import android.graphics.Paint;
|
13
13
|
import android.graphics.Rect;
|
14
|
-
import com.facebook.common.internal.Preconditions;
|
15
14
|
import com.facebook.common.references.CloseableReference;
|
16
15
|
import com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory;
|
17
16
|
import com.facebook.imagepipeline.nativecode.NativeBlurFilter;
|
@@ -32,7 +31,6 @@ public class ScalingBlurPostprocessor extends BasePostprocessor {
|
|
32
31
|
private final int mScaleRatio;
|
33
32
|
|
34
33
|
public ScalingBlurPostprocessor(int iterations, int blurRadius, int scaleRatio) {
|
35
|
-
Preconditions.checkArgument(scaleRatio > 0);
|
36
34
|
|
37
35
|
mIterations = iterations;
|
38
36
|
mBlurRadius = blurRadius;
|