@nativescript-community/ui-image 4.0.29 → 4.0.30

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 CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.0.30](https://github.com/nativescript-community/ui-image/compare/v4.0.29...v4.0.30) (2021-10-07)
7
+
8
+ **Note:** Version bump only for package @nativescript-community/ui-image
9
+
10
+
11
+
12
+
13
+
6
14
  ## [4.0.29](https://github.com/nativescript-community/ui-image/compare/v4.0.28...v4.0.29) (2021-09-28)
7
15
 
8
16
  **Note:** Version bump only for package @nativescript-community/ui-image
package/image.android.js CHANGED
@@ -339,7 +339,7 @@ export class Img extends ImageBase {
339
339
  if (src) {
340
340
  let drawable;
341
341
  if (src instanceof ImageSource) {
342
- drawable = new android.graphics.drawable.BitmapDrawable(src.android);
342
+ drawable = new android.graphics.drawable.BitmapDrawable(ad.getApplicationContext().getResources(), src.android);
343
343
  this.updateViewSize(src.android);
344
344
  }
345
345
  else if (isFontIconURI(src)) {
@@ -347,7 +347,7 @@ export class Img extends ImageBase {
347
347
  if (fontIconCode !== undefined) {
348
348
  const font = this.style.fontInternal;
349
349
  const color = this.style.color;
350
- drawable = new android.graphics.drawable.BitmapDrawable(ImageSource.fromFontIconCodeSync(fontIconCode, font, color).android);
350
+ drawable = new android.graphics.drawable.BitmapDrawable(ad.getApplicationContext().getResources(), ImageSource.fromFontIconCodeSync(fontIconCode, font, color).android);
351
351
  }
352
352
  }
353
353
  if (drawable) {
@@ -591,7 +591,7 @@ export class Img extends ImageBase {
591
591
  if (typeof path === 'string') {
592
592
  if (isFileOrResourcePath(path)) {
593
593
  if (path.indexOf(RESOURCE_PREFIX) === 0) {
594
- drawable = this.getDrawableFromResource(path);
594
+ return this.getDrawableFromResource(path);
595
595
  }
596
596
  else {
597
597
  drawable = this.getDrawableFromLocalFile(path);
@@ -599,7 +599,7 @@ export class Img extends ImageBase {
599
599
  }
600
600
  }
601
601
  else {
602
- drawable = new android.graphics.drawable.BitmapDrawable(path.android);
602
+ drawable = new android.graphics.drawable.BitmapDrawable(ad.getApplicationContext().getResources(), path.android);
603
603
  }
604
604
  return drawable;
605
605
  }
@@ -612,12 +612,8 @@ export class Img extends ImageBase {
612
612
  return drawable;
613
613
  }
614
614
  getDrawableFromResource(resourceName) {
615
- const img = ImageSource.fromResourceSync(resourceName.substr(RESOURCE_PREFIX.length));
616
- let drawable = null;
617
- if (img) {
618
- drawable = new android.graphics.drawable.BitmapDrawable(ad.getApplicationContext().getResources(), img.android);
619
- }
620
- return drawable;
615
+ const identifier = ad.getApplication().getResources().getIdentifier(resourceName.substr(RESOURCE_PREFIX.length), 'drawable', ad.getApplication().getPackageName());
616
+ return identifier;
621
617
  }
622
618
  startAnimating() {
623
619
  if (this.nativeViewProtected) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript-community/ui-image",
3
- "version": "4.0.29",
3
+ "version": "4.0.30",
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
5
  "main": "./image",
6
6
  "sideEffects": false,
@@ -36,5 +36,5 @@
36
36
  },
37
37
  "license": "Apache-2.0",
38
38
  "readmeFilename": "README.md",
39
- "gitHead": "b35c1b83082c2ec6783adcf0aeb4803c6605534c"
39
+ "gitHead": "ea3233132cb196baa46253fe3ff8126bdf2f5fec"
40
40
  }
@@ -0,0 +1,5 @@
1
+ {
2
+ "uses": [
3
+ "com.facebook.drawee.drawable:ScalingUtils*","com.facebook.drawee.drawable.ScalingUtils:ScaleType*","com.facebook.drawee.generic:RoundingParams*","com.facebook.drawee.drawable:ProgressBarDrawable*","com.facebook.drawee.view:DraweeView*","com.facebook.drawee.interfaces:DraweeHierarchy*","com.facebook.drawee.interfaces:SettableDraweeHierarchy*","com.facebook.drawee.interfaces:SimpleDraweeControllerBuilder*","com.facebook.drawee.interfaces:DraweeController*","com.facebook.drawee.generic:GenericDraweeHierarchyBuilder*","com.facebook.drawee.generic:GenericDraweeHierarchy*","com.facebook.imagepipeline.request:ImageRequestBuilder*","com.facebook.imagepipeline.request:ImageRequest*","com.facebook.imagepipeline.core:ImagePipelineConfig*","com.facebook.imagepipeline.common:RotationOptions*","com.facebook.imagepipeline.common:ResizeOptions*","com.facebook.drawee.backends.pipeline:Fresco*","com.facebook.drawee.backends.pipeline:PipelineDraweeControllerBuilder*","com.facebook.drawee.backends.pipeline:PipelineDraweeController*","com.facebook.drawee.controller:AbstractDraweeControllerBuilder*","com.facebook.drawee.controller:AbstractDraweeController*","com.facebook.drawee.backends.pipeline.info:ImagePerfDataListener*","com.facebook.drawee.backends.pipeline.info:ImagePerfData*","com.facebook.drawee.controller:ControllerListener*","com.nativescript.image:DraweeView*","com.nativescript.image:ScalingBlurPostprocessor*","android.graphics.drawable:Animatable"
4
+ ]
5
+ }
Binary file