@nativescript-community/ui-image 4.3.3 → 4.3.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/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.3.4](https://github.com/nativescript-community/ui-image/compare/v4.3.3...v4.3.4) (2022-09-20)
7
+
8
+ **Note:** Version bump only for package @nativescript-community/ui-image
9
+
10
+
11
+
12
+
13
+
6
14
  ## [4.3.3](https://github.com/nativescript-community/ui-image/compare/v4.3.2...v4.3.3) (2022-09-12)
7
15
 
8
16
  **Note:** Version bump only for package @nativescript-community/ui-image
package/index-common.d.ts CHANGED
@@ -42,6 +42,7 @@ export interface ImageError {
42
42
  export interface ImagePipelineConfigSetting {
43
43
  isDownsampleEnabled?: boolean;
44
44
  leakTracker?: any;
45
+ useOkhttp?: boolean;
45
46
  }
46
47
  export declare class EventData implements IEventData {
47
48
  private _eventName;
package/index.android.js CHANGED
@@ -14,11 +14,23 @@ export function initialize(config) {
14
14
  initializeConfig = config;
15
15
  return;
16
16
  }
17
- const builder = com.facebook.imagepipeline.core.ImagePipelineConfig.newBuilder(context);
18
- if (config && config.isDownsampleEnabled) {
17
+ let builder;
18
+ const useOkhttp = config === null || config === void 0 ? void 0 : config.useOkhttp;
19
+ if (useOkhttp) {
20
+ if (useOkhttp instanceof okhttp3.OkHttpClient) {
21
+ builder = com.facebook.imagepipeline.backends.okhttp3.OkHttpImagePipelineConfigFactory.newBuilder(context, useOkhttp);
22
+ }
23
+ else {
24
+ builder = com.facebook.imagepipeline.backends.okhttp3.OkHttpImagePipelineConfigFactory.newBuilder(context, new okhttp3.OkHttpClient());
25
+ }
26
+ }
27
+ else {
28
+ builder = com.facebook.imagepipeline.core.ImagePipelineConfig.newBuilder(context);
29
+ }
30
+ if (config === null || config === void 0 ? void 0 : config.isDownsampleEnabled) {
19
31
  builder.setDownsampleEnabled(true);
20
32
  }
21
- if (config && config.leakTracker) {
33
+ if (config === null || config === void 0 ? void 0 : config.leakTracker) {
22
34
  builder.setCloseableReferenceLeakTracker(config.leakTracker);
23
35
  }
24
36
  const imagePipelineConfig = builder.build();
@@ -541,7 +553,6 @@ export class Img extends ImageBase {
541
553
  }
542
554
  const controller = builder.build();
543
555
  this.nativeImageViewProtected.setController(controller);
544
- console.log('setController', this, src, uri);
545
556
  }
546
557
  else {
547
558
  this.nativeImageViewProtected.setController(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript-community/ui-image",
3
- "version": "4.3.3",
3
+ "version": "4.3.4",
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": "./index",
6
6
  "sideEffects": false,
@@ -44,5 +44,5 @@
44
44
  },
45
45
  "license": "Apache-2.0",
46
46
  "readmeFilename": "README.md",
47
- "gitHead": "a216a880fc8c0d1c166e0a52a1c97443913d583e"
47
+ "gitHead": "9bd6af7233a62486e754dcdbeb8a95a53e73c041"
48
48
  }