@nativescript-community/ui-image 4.0.32 → 4.1.1
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 +38 -0
- package/image-common.d.ts +1 -0
- package/image.android.js +4 -0
- package/image.ios.d.ts +1 -1
- package/image.ios.js +20 -15
- package/package.json +2 -2
- package/platforms/android/.gradle/6.4/fileChanges/last-build.bin +0 -0
- package/platforms/android/.gradle/6.4/fileHashes/fileHashes.lock +0 -0
- package/platforms/android/.gradle/6.4/gc.properties +0 -0
- package/platforms/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/platforms/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/platforms/android/.gradle/checksums/checksums.lock +0 -0
- package/platforms/android/.gradle/vcs-1/gc.properties +0 -0
- package/platforms/android/include.gradle +7 -3
- package/platforms/android/java/com/nativescript/image/DraweeView.java +0 -4
- package/platforms/android/native-api-usage.json +28 -1
- package/flipper/index.d.ts +0 -4
- package/flipper/index.js +0 -9
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,44 @@
|
|
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.1.1](https://github.com/nativescript-community/ui-image/compare/v4.1.0...v4.1.1) (2021-12-23)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* android remove dep on annotationx ([c9fdfbe](https://github.com/nativescript-community/ui-image/commit/c9fdfbe8f7c7f876abb53b1d8b9b7c68d65ae21f))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
# [4.1.0](https://github.com/nativescript-community/ui-image/compare/v4.0.34...v4.1.0) (2021-10-21)
|
18
|
+
|
19
|
+
|
20
|
+
### Features
|
21
|
+
|
22
|
+
* **android:** native-api-usage ([0ec235c](https://github.com/nativescript-community/ui-image/commit/0ec235c2df1d5c4f6f30615766ea17ba74576dc7))
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
## [4.0.34](https://github.com/nativescript-community/ui-image/compare/v4.0.33...v4.0.34) (2021-10-15)
|
29
|
+
|
30
|
+
**Note:** Version bump only for package @nativescript-community/ui-image
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
## [4.0.33](https://github.com/nativescript-community/ui-image/compare/v4.0.32...v4.0.33) (2021-10-08)
|
37
|
+
|
38
|
+
**Note:** Version bump only for package @nativescript-community/ui-image
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
6
44
|
## [4.0.32](https://github.com/nativescript-community/ui-image/compare/v4.0.31...v4.0.32) (2021-10-08)
|
7
45
|
|
8
46
|
**Note:** Version bump only for package @nativescript-community/ui-image
|
package/image-common.d.ts
CHANGED
package/image.android.js
CHANGED
@@ -18,9 +18,13 @@ export function initialize(config) {
|
|
18
18
|
if (config && config.isDownsampleEnabled) {
|
19
19
|
builder.setDownsampleEnabled(true);
|
20
20
|
}
|
21
|
+
if (config && config.leakTracker) {
|
22
|
+
builder.setCloseableReferenceLeakTracker(config.leakTracker);
|
23
|
+
}
|
21
24
|
const imagePipelineConfig = builder.build();
|
22
25
|
com.facebook.drawee.backends.pipeline.Fresco.initialize(context, imagePipelineConfig);
|
23
26
|
initialized = true;
|
27
|
+
initializeConfig = null;
|
24
28
|
}
|
25
29
|
}
|
26
30
|
export function getImagePipeline() {
|
package/image.ios.d.ts
CHANGED
@@ -38,7 +38,7 @@ export declare class Img extends ImageBase {
|
|
38
38
|
_setNativeClipToBounds(): void;
|
39
39
|
onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void;
|
40
40
|
updateImageUri(): void;
|
41
|
-
_setNativeImage(nativeImage: UIImage): void;
|
41
|
+
_setNativeImage(nativeImage: UIImage, animated?: boolean): void;
|
42
42
|
private handleImageLoaded;
|
43
43
|
private onLoadProgress;
|
44
44
|
private getUIImage;
|
package/image.ios.js
CHANGED
@@ -201,17 +201,9 @@ export class Img extends ImageBase {
|
|
201
201
|
this._imageSourceAffectsLayout = true;
|
202
202
|
this.handleImageLoaded = (image, error, cacheType) => {
|
203
203
|
this.isLoading = false;
|
204
|
+
const animate = (this.alwaysFade || cacheType !== 2) && this.fadeDuration > 0;
|
204
205
|
if (image) {
|
205
|
-
|
206
|
-
this.nativeViewProtected.alpha = 0.0;
|
207
|
-
this._setNativeImage(image);
|
208
|
-
UIView.animateWithDurationAnimations(this.fadeDuration / 1000, () => {
|
209
|
-
this.nativeViewProtected.alpha = this.opacity;
|
210
|
-
});
|
211
|
-
}
|
212
|
-
else {
|
213
|
-
this._setNativeImage(image);
|
214
|
-
}
|
206
|
+
this._setNativeImage(image, animate);
|
215
207
|
}
|
216
208
|
if (!this.autoPlayAnimations) {
|
217
209
|
this.nativeViewProtected.stopAnimating();
|
@@ -225,7 +217,7 @@ export class Img extends ImageBase {
|
|
225
217
|
this.notify(args);
|
226
218
|
if (this.failureImageUri) {
|
227
219
|
image = this.getUIImage(this.failureImageUri);
|
228
|
-
this._setNativeImage(image);
|
220
|
+
this._setNativeImage(image, animate);
|
229
221
|
}
|
230
222
|
}
|
231
223
|
else if (image) {
|
@@ -296,8 +288,17 @@ export class Img extends ImageBase {
|
|
296
288
|
this.src = null;
|
297
289
|
this.src = src;
|
298
290
|
}
|
299
|
-
_setNativeImage(nativeImage) {
|
300
|
-
|
291
|
+
_setNativeImage(nativeImage, animated = true) {
|
292
|
+
if (animated) {
|
293
|
+
this.nativeViewProtected.alpha = 0.0;
|
294
|
+
this.nativeViewProtected.image = nativeImage;
|
295
|
+
UIView.animateWithDurationAnimations(this.fadeDuration / 1000, () => {
|
296
|
+
this.nativeViewProtected.alpha = this.opacity;
|
297
|
+
});
|
298
|
+
}
|
299
|
+
else {
|
300
|
+
this.nativeViewProtected.image = nativeImage;
|
301
|
+
}
|
301
302
|
if (this._imageSourceAffectsLayout) {
|
302
303
|
this._imageSourceAffectsLayout = false;
|
303
304
|
this.requestLayout();
|
@@ -333,8 +334,9 @@ export class Img extends ImageBase {
|
|
333
334
|
if (this.nativeViewProtected) {
|
334
335
|
const src = this.src;
|
335
336
|
if (src) {
|
337
|
+
const animate = this.fadeDuration > 0;
|
336
338
|
if (src instanceof ImageSource) {
|
337
|
-
this._setNativeImage(src.ios);
|
339
|
+
this._setNativeImage(src.ios, animate);
|
338
340
|
return;
|
339
341
|
}
|
340
342
|
else if (typeof src === 'string') {
|
@@ -343,7 +345,7 @@ export class Img extends ImageBase {
|
|
343
345
|
if (fontIconCode !== undefined) {
|
344
346
|
const font = this.style.fontInternal;
|
345
347
|
const color = this.style.color;
|
346
|
-
this._setNativeImage(ImageSource.fromFontIconCodeSync(fontIconCode, font, color).ios);
|
348
|
+
this._setNativeImage(ImageSource.fromFontIconCodeSync(fontIconCode, font, color).ios, animate);
|
347
349
|
}
|
348
350
|
return;
|
349
351
|
}
|
@@ -387,6 +389,9 @@ export class Img extends ImageBase {
|
|
387
389
|
}
|
388
390
|
this.nativeViewProtected.sd_setImageWithURLPlaceholderImageOptionsContextProgressCompleted(uri, this.placeholderImage, options, context, this.onLoadProgress, this.handleImageLoaded);
|
389
391
|
}
|
392
|
+
else if (this.placeholderImage) {
|
393
|
+
this._setNativeImage(this.placeholderImage);
|
394
|
+
}
|
390
395
|
else {
|
391
396
|
this._setNativeImage(null);
|
392
397
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nativescript-community/ui-image",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.1.1",
|
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": "
|
39
|
+
"gitHead": "c7d280737dc5545b82039bf08cbd7631ef4cd7a5"
|
40
40
|
}
|
Binary file
|
Binary file
|
File without changes
|
Binary file
|
File without changes
|
@@ -10,12 +10,16 @@ dependencies {
|
|
10
10
|
implementation("com.facebook.fresco:fresco:$frescoVersion") {
|
11
11
|
exclude group: 'com.facebook.soloader', module: 'soloader'
|
12
12
|
exclude group: 'com.facebook.fresco', module: 'soloader'
|
13
|
+
exclude group: 'com.facebook.fresco', module: 'nativeimagefilters'
|
14
|
+
exclude group: 'com.facebook.fresco', module: 'nativeimagetranscoder'
|
15
|
+
exclude group: 'com.facebook.fresco', module: 'memory-type-native'
|
16
|
+
exclude group: 'com.facebook.fresco', module: 'imagepipeline-native'
|
13
17
|
}
|
14
18
|
implementation("com.facebook.fresco:imagepipeline-okhttp3:$frescoVersion") {
|
15
19
|
exclude group: 'com.facebook.soloader', module: 'soloader'
|
16
20
|
}
|
17
|
-
implementation ("com.facebook.fresco:animated-gif:$frescoVersion") {
|
18
|
-
|
19
|
-
}
|
21
|
+
// implementation ("com.facebook.fresco:animated-gif:$frescoVersion") {
|
22
|
+
// exclude group: 'com.facebook.soloader', module: 'soloader'
|
23
|
+
// }
|
20
24
|
implementation(name:'widgets-release', ext:'aar')
|
21
25
|
}
|
@@ -24,8 +24,6 @@ import org.nativescript.widgets.BorderDrawable;
|
|
24
24
|
|
25
25
|
import java.util.Arrays;
|
26
26
|
|
27
|
-
import androidx.annotation.RequiresApi;
|
28
|
-
|
29
27
|
public class DraweeView extends SimpleDraweeView {
|
30
28
|
public int imageWidth = 0;
|
31
29
|
public int imageHeight = 0;
|
@@ -108,7 +106,6 @@ public class DraweeView extends SimpleDraweeView {
|
|
108
106
|
Path innerBorderPath;
|
109
107
|
Path innerBorderTempPath;
|
110
108
|
|
111
|
-
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
|
112
109
|
private Path generateInnerBorderPath(BorderDrawable borderDrawable) {
|
113
110
|
|
114
111
|
float borderTopLeftRadius = borderDrawable.getBorderTopLeftRadius();
|
@@ -154,7 +151,6 @@ public class DraweeView extends SimpleDraweeView {
|
|
154
151
|
return innerBorderPath;
|
155
152
|
}
|
156
153
|
|
157
|
-
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
|
158
154
|
@Override
|
159
155
|
protected void onDraw(Canvas canvas) {
|
160
156
|
Drawable drawable = getBackground();
|
@@ -1,5 +1,32 @@
|
|
1
1
|
{
|
2
2
|
"uses": [
|
3
|
-
"com.facebook.drawee.drawable:ScalingUtils*",
|
3
|
+
"com.facebook.drawee.drawable:ScalingUtils*",
|
4
|
+
"com.facebook.drawee.drawable.ScalingUtils:ScaleType*",
|
5
|
+
"com.facebook.drawee.generic:RoundingParams*",
|
6
|
+
"com.facebook.drawee.drawable:ProgressBarDrawable*",
|
7
|
+
"com.facebook.drawee.view:DraweeView*",
|
8
|
+
"com.facebook.drawee.interfaces:DraweeHierarchy*",
|
9
|
+
"com.facebook.drawee.interfaces:SettableDraweeHierarchy*",
|
10
|
+
"com.facebook.drawee.interfaces:SimpleDraweeControllerBuilder*",
|
11
|
+
"com.facebook.drawee.interfaces:DraweeController*",
|
12
|
+
"com.facebook.drawee.generic:GenericDraweeHierarchyBuilder*",
|
13
|
+
"com.facebook.drawee.generic:GenericDraweeHierarchy*",
|
14
|
+
"com.facebook.imagepipeline.request:ImageRequestBuilder*",
|
15
|
+
"com.facebook.imagepipeline.request:ImageRequest*",
|
16
|
+
"com.facebook.imagepipeline.core:ImagePipelineConfig*",
|
17
|
+
"com.facebook.imagepipeline.common:RotationOptions*",
|
18
|
+
"com.facebook.imagepipeline.common:ResizeOptions*",
|
19
|
+
"com.facebook.drawee.backends.pipeline:Fresco*",
|
20
|
+
"com.facebook.drawee.backends.pipeline:PipelineDraweeControllerBuilder*",
|
21
|
+
"com.facebook.drawee.backends.pipeline:PipelineDraweeController*",
|
22
|
+
"com.facebook.drawee.controller:AbstractDraweeControllerBuilder*",
|
23
|
+
"com.facebook.drawee.controller:AbstractDraweeController*",
|
24
|
+
"com.facebook.drawee.backends.pipeline.info:ImagePerfDataListener*",
|
25
|
+
"com.facebook.drawee.backends.pipeline.info:ImagePerfData*",
|
26
|
+
"com.facebook.drawee.controller:ControllerListener*",
|
27
|
+
"com.nativescript.image:DraweeView*",
|
28
|
+
"com.nativescript.image:ScalingBlurPostprocessor*",
|
29
|
+
"android.graphics.drawable:Animatable",
|
30
|
+
"com.facebook.imagepipeline.image:ImageInfo*"
|
4
31
|
]
|
5
32
|
}
|
package/flipper/index.d.ts
DELETED
package/flipper/index.js
DELETED