@nativescript-community/ui-image 5.0.17 → 5.1.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 +17 -0
- package/README.md +21 -0
- package/index-common.d.ts +87 -5
- package/index-common.js +69 -5
- package/index-common.js.map +1 -1
- package/index.android.d.ts +2 -6
- package/index.android.js +22 -8
- package/index.android.js.map +1 -1
- package/index.d.ts +15 -87
- package/index.ios.d.ts +13 -3
- package/index.ios.js +88 -45
- package/index.ios.js.map +1 -1
- package/package.json +3 -3
- package/platforms/android/include.gradle +13 -4
- package/platforms/android/java/com/nativescript/image/CustomDataFetcher.java +11 -7
- package/platforms/android/java/com/nativescript/image/CustomGlideModule.java +5 -8
- package/platforms/android/java/com/nativescript/image/CustomUrlLoader.java +2 -14
- package/platforms/android/java/com/nativescript/image/GlideConfiguration.java +18 -1
- package/platforms/android/java/com/nativescript/image/MatrixImageView.java +59 -2
- package/platforms/android/java/com/nativescript/image/OkHttpSupport.java +29 -0
- package/platforms/android/java/com/nativescript/image/UrlConnectionLoader.java +159 -0
- package/platforms/android/native-api-usage.json +3 -1
- package/shared-transition.android.d.ts +12 -0
- package/shared-transition.android.js +46 -0
- package/shared-transition.android.js.map +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/typings/ui_image.android.d.ts +11 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
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
|
+
## [5.1.0](https://github.com/nativescript-community/ui-image/compare/v5.0.18...v5.1.0) (2026-11-10)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **android:** make OkHttp optional ([1c0b9b9](https://github.com/nativescript-community/ui-image/commit/1c0b9b9763848fe4a760ee85394d1fe7ae2ae7cd))
|
|
11
|
+
* **android:** shared element transition handler for MatrixImageView ([8a1afb5](https://github.com/nativescript-community/ui-image/commit/8a1afb53da8a94946c6c8d9e0b3250f1c56202b4))
|
|
12
|
+
* **image:** support headers and src as functions, add onInitialize and custom OkHttp client ([e5bf826](https://github.com/nativescript-community/ui-image/commit/e5bf82687f9aa23b240346c2575702622b705f14))
|
|
13
|
+
* **zoomimage:** add transformChanged event and limit iOS panning to the image ([99c40d1](https://github.com/nativescript-community/ui-image/commit/99c40d19670c8654482ad7162609fa694109d234))
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **android:** clip image drawing to the view bounds ([fefb78e](https://github.com/nativescript-community/ui-image/commit/fefb78e37a9055a3d44d2cf444ac6458a0dd0847))
|
|
18
|
+
|
|
19
|
+
## [5.0.18](https://github.com/nativescript-community/ui-image/compare/v5.0.17...v5.0.18) (2026-10-21)
|
|
20
|
+
|
|
21
|
+
**Note:** Version bump only for package @nativescript-community/ui-image
|
|
22
|
+
|
|
6
23
|
## [5.0.17](https://github.com/nativescript-community/ui-image/compare/v5.0.16...v5.0.17) (2026-05-05)
|
|
7
24
|
|
|
8
25
|
**Note:** Version bump only for package @nativescript-community/ui-image
|
package/README.md
CHANGED
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
* [Installation](#installation)
|
|
45
45
|
* [setup](#setup)
|
|
46
|
+
* [Android: OkHttp is optional](#android-okhttp-is-optional)
|
|
46
47
|
* [API](#api)
|
|
47
48
|
* [Events](#events)
|
|
48
49
|
* [Event arguments](#event-arguments)
|
|
@@ -87,6 +88,24 @@ import imageModule = require("@nativescript-community/ui-image");
|
|
|
87
88
|
imageModule.initialize();
|
|
88
89
|
```
|
|
89
90
|
|
|
91
|
+
`initialize` accepts an optional config:
|
|
92
|
+
|
|
93
|
+
- `useOkhttp` (Android): a custom `okhttp3.OkHttpClient` used to download images.
|
|
94
|
+
- `onInitialize` (Android and iOS): called before the native library is initialized, for very custom native handling.
|
|
95
|
+
Android gets `(glideConfiguration, config)`, iOS gets `(loadersManager, loaders, config)`.
|
|
96
|
+
|
|
97
|
+
### Android: OkHttp is optional
|
|
98
|
+
|
|
99
|
+
Images are downloaded with OkHttp by default. To not ship it, set this in the app `gradle.properties`
|
|
100
|
+
(or `ext.glideUseOkHttp = "false"` in `before-plugins.gradle`):
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
glideUseOkHttp=false
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Images are then downloaded with `HttpURLConnection`: headers, `progress` and `loadSource` events still work,
|
|
107
|
+
but `useOkhttp` is ignored and you lose OkHttp's HTTP/2 and connection pooling.
|
|
108
|
+
|
|
90
109
|
|
|
91
110
|
[](#api)
|
|
92
111
|
|
|
@@ -320,6 +339,7 @@ export function onSubmit(args: EventData) {
|
|
|
320
339
|
- **src**
|
|
321
340
|
|
|
322
341
|
String value used for the image URI. You can use this property to set the image to be loaded from remote location (http, https), from the resources and local files of your {N} application.
|
|
342
|
+
It can also be an `ImageSource`/`ImageAsset`, a `Promise`, or a function called with the view as argument and returning one of those (or a `Promise` of those).
|
|
323
343
|
|
|
324
344
|
```xml
|
|
325
345
|
<@nativescript-community/ui-image:Img src="https://docs.nativescript.org/angular/img/cli-getting-started/angular/chapter0/NativeScript_logo.png"/>
|
|
@@ -442,6 +462,7 @@ Number value used as the downsampled width of the imageModule drawable.
|
|
|
442
462
|
- **headers**
|
|
443
463
|
|
|
444
464
|
Object that defines custom request headers to be sent with the image download request.
|
|
465
|
+
It can also be a function returning the headers, called each time the image is requested (for example to always send a fresh token).
|
|
445
466
|
|
|
446
467
|
```xml
|
|
447
468
|
<@nativescript-community/ui-image:Img headers="{Authorization: 'bearer abcdefghijk'}"/>
|
package/index-common.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Color, CoreTypes, Property, View } from '@nativescript/core';
|
|
1
|
+
import { AnimationDefinition, AnimationPromise, Color, CoreTypes, Property, View } from '@nativescript/core';
|
|
2
2
|
import { EventData as IEventData } from '@nativescript/core/data/observable';
|
|
3
3
|
import { ImageAsset } from '@nativescript/core/image-asset';
|
|
4
4
|
import { ImageSource } from '@nativescript/core/image-source';
|
|
@@ -53,18 +53,54 @@ export declare enum CLogTypes {
|
|
|
53
53
|
export declare const ImageViewTraceCategory = "NativescriptImage";
|
|
54
54
|
export declare const CLog: (type: CLogTypes, ...args: any[]) => void;
|
|
55
55
|
export type Transition = 'fade' | 'curlUp';
|
|
56
|
+
/**
|
|
57
|
+
* Options for scaling the child bounds to the parent bounds
|
|
58
|
+
*/
|
|
56
59
|
export declare enum ScaleType {
|
|
57
60
|
None = "none",
|
|
61
|
+
/**
|
|
62
|
+
* Scales width and height independently, so that the child matches the parent exactly.
|
|
63
|
+
*/
|
|
58
64
|
Fill = "fill",
|
|
65
|
+
/**
|
|
66
|
+
* Scales the child so that both dimensions will be greater than or equal to the corresponding dimension of the parent.
|
|
67
|
+
*/
|
|
59
68
|
AspectFill = "aspectFill",
|
|
69
|
+
/**
|
|
70
|
+
* Scales the child so that it fits entirely inside the parent.
|
|
71
|
+
*/
|
|
60
72
|
AspectFit = "aspectFit",
|
|
73
|
+
/**
|
|
74
|
+
* Performs no scaling.
|
|
75
|
+
*/
|
|
61
76
|
Center = "center",
|
|
77
|
+
/**
|
|
78
|
+
* Scales the child so that both dimensions will be greater than or equal to the corresponding dimension of the parent.
|
|
79
|
+
*/
|
|
62
80
|
CenterCrop = "centerCrop",
|
|
81
|
+
/**
|
|
82
|
+
* Scales the child so that it fits entirely inside the parent.
|
|
83
|
+
*/
|
|
63
84
|
CenterInside = "centerInside",
|
|
85
|
+
/**
|
|
86
|
+
* Scales the child so that it fits entirely inside the parent.
|
|
87
|
+
*/
|
|
64
88
|
FitCenter = "fitCenter",
|
|
89
|
+
/**
|
|
90
|
+
* Scales the child so that it fits entirely inside the parent.
|
|
91
|
+
*/
|
|
65
92
|
FitEnd = "fitEnd",
|
|
93
|
+
/**
|
|
94
|
+
* Scales the child so that it fits entirely inside the parent.
|
|
95
|
+
*/
|
|
66
96
|
FitStart = "fitStart",
|
|
97
|
+
/**
|
|
98
|
+
* Scales width and height independently, so that the child matches the parent exactly.
|
|
99
|
+
*/
|
|
67
100
|
FitXY = "fitXY",
|
|
101
|
+
/**
|
|
102
|
+
* Scales the child so that both dimensions will be greater than or equal to the corresponding dimension of the parent.
|
|
103
|
+
*/
|
|
68
104
|
FocusCrop = "focusCrop"
|
|
69
105
|
}
|
|
70
106
|
export interface AnimatedImage {
|
|
@@ -72,9 +108,24 @@ export interface AnimatedImage {
|
|
|
72
108
|
stop(): void;
|
|
73
109
|
isRunning(): boolean;
|
|
74
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Encapsulates the common abstraction behind a platform specific object (typically a Bitmap) quality.
|
|
113
|
+
*/
|
|
114
|
+
export interface QualityInfo {
|
|
115
|
+
getQuality(): number;
|
|
116
|
+
isOfFullQuality(): boolean;
|
|
117
|
+
isOfGoodEnoughQuality(): boolean;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Encapsulates the common abstraction behind a platform specific object (typically a Bitmap's quality) details.
|
|
121
|
+
*/
|
|
75
122
|
export interface ImageInfo {
|
|
76
123
|
getHeight(): number;
|
|
77
124
|
getWidth(): number;
|
|
125
|
+
/**
|
|
126
|
+
* @platform android
|
|
127
|
+
*/
|
|
128
|
+
getQualityInfo(): QualityInfo;
|
|
78
129
|
}
|
|
79
130
|
export interface ImageError {
|
|
80
131
|
getMessage(): string;
|
|
@@ -87,13 +138,36 @@ export interface ImagePipelineConfigSetting {
|
|
|
87
138
|
globalSignatureKey?: string;
|
|
88
139
|
memoryCacheSize?: number;
|
|
89
140
|
memoryCacheScreens?: number;
|
|
141
|
+
/**
|
|
142
|
+
* Android: a custom `okhttp3.OkHttpClient` used by Glide to download images.
|
|
143
|
+
* `false` or `undefined`: a default client is used.
|
|
144
|
+
* Ignored when OkHttp is not part of the app (`glideUseOkHttp=false`, see the blueprint).
|
|
145
|
+
* @platform android
|
|
146
|
+
*/
|
|
147
|
+
useOkhttp?: boolean | any;
|
|
148
|
+
/**
|
|
149
|
+
* Called before the native library is initialized, to allow very custom native handling.
|
|
150
|
+
* - Android: `(glideConfiguration: com.nativescript.image.GlideConfiguration, config: ImagePipelineConfigSetting)`
|
|
151
|
+
* - iOS: `(loadersManager: SDImageLoadersManager, loaders: any[], config: ImagePipelineConfigSetting)`. `loaders` is the array that will be set, you can modify it.
|
|
152
|
+
*/
|
|
153
|
+
onInitialize?: Function;
|
|
154
|
+
/**
|
|
155
|
+
* @deprecated Fresco only (4.x). Ignored: the Glide based plugin always downsamples.
|
|
156
|
+
* @platform android
|
|
157
|
+
*/
|
|
158
|
+
isDownsampleEnabled?: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* @deprecated Fresco only (4.x). Ignored.
|
|
161
|
+
* @platform android
|
|
162
|
+
*/
|
|
163
|
+
leakTracker?: any;
|
|
90
164
|
}
|
|
91
165
|
/**
|
|
92
166
|
* Options for prefetching images with transformations and request options
|
|
93
167
|
*/
|
|
94
168
|
export interface PrefetchOptions {
|
|
95
169
|
/** Custom headers for the request */
|
|
96
|
-
headers?: Record<string, string
|
|
170
|
+
headers?: Record<string, string> | (() => Record<string, string>);
|
|
97
171
|
/** Decode width for downsampling */
|
|
98
172
|
decodeWidth?: number;
|
|
99
173
|
/** Decode height for downsampling */
|
|
@@ -119,7 +193,7 @@ export interface PrefetchOptions {
|
|
|
119
193
|
}
|
|
120
194
|
export type Stretch = 'none' | 'fill' | 'aspectFill' | 'aspectFit';
|
|
121
195
|
export declare const srcProperty: Property<ImageBase, string | ImageSource | ImageAsset>;
|
|
122
|
-
export declare const headersProperty: Property<ImageBase, Record<string, string
|
|
196
|
+
export declare const headersProperty: Property<ImageBase, Record<string, string> | (() => Record<string, string>)>;
|
|
123
197
|
export declare const lowerResSrcProperty: Property<ImageBase, string>;
|
|
124
198
|
export declare const placeholderImageUriProperty: Property<ImageBase, string>;
|
|
125
199
|
export declare const failureImageUriProperty: Property<ImageBase, string>;
|
|
@@ -150,7 +224,7 @@ export declare const clipToBoundsProperty: Property<ImageBase, boolean>;
|
|
|
150
224
|
export declare const animatedImageViewProperty: Property<ImageBase, boolean>;
|
|
151
225
|
export declare const needRequestImage: (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => void;
|
|
152
226
|
export type BasicSrcType = string | ImageSource | ImageAsset;
|
|
153
|
-
export type SrcType = BasicSrcType | (() => BasicSrcType | PromiseLike<BasicSrcType>) | PromiseLike<BasicSrcType>;
|
|
227
|
+
export type SrcType = BasicSrcType | ((ImageView: ImageBase) => BasicSrcType | PromiseLike<BasicSrcType>) | PromiseLike<BasicSrcType>;
|
|
154
228
|
export declare abstract class ImageBase extends View {
|
|
155
229
|
static finalImageSetEvent: string;
|
|
156
230
|
static failureEvent: string;
|
|
@@ -188,12 +262,20 @@ export declare abstract class ImageBase extends View {
|
|
|
188
262
|
noCache: boolean;
|
|
189
263
|
noRatioEnforce: boolean;
|
|
190
264
|
tintColor: Color;
|
|
191
|
-
headers: Record<string, string
|
|
265
|
+
headers: Record<string, string> | (() => Record<string, string>);
|
|
192
266
|
readonly isLoading: boolean;
|
|
193
267
|
get nativeImageViewProtected(): any;
|
|
194
268
|
mCanRequestImage: boolean;
|
|
195
269
|
mNeedRequestImage: boolean;
|
|
196
270
|
protected abstract initImage(): Promise<void>;
|
|
271
|
+
protected abstract animateImageRotation(imageRotation: number, duration: number): void;
|
|
272
|
+
/**
|
|
273
|
+
* Same as `View.animate` but `imageRotation` can be animated, without the need of a patched @nativescript/core.
|
|
274
|
+
* Android rotates the image, iOS cross fades between the previous and the rotated image.
|
|
275
|
+
*/
|
|
276
|
+
animate(animation: AnimationDefinition & {
|
|
277
|
+
imageRotation?: number;
|
|
278
|
+
}): AnimationPromise;
|
|
197
279
|
onResumeNativeUpdates(): void;
|
|
198
280
|
protected handleImageProgress(value: number, totalSize?: number): void;
|
|
199
281
|
private static needsSizeAdjustment;
|
package/index-common.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
var ImageBase_1;
|
|
2
|
+
import { CSSType, Color, Length, Property, Trace, View, booleanConverter } from '@nativescript/core';
|
|
2
3
|
import { isAndroid } from '@nativescript/core/platform';
|
|
3
4
|
export function colorConverter(v) {
|
|
4
5
|
if (!v || v instanceof Color) {
|
|
@@ -17,19 +18,55 @@ export const ImageViewTraceCategory = 'NativescriptImage';
|
|
|
17
18
|
export const CLog = (type, ...args) => {
|
|
18
19
|
Trace.write(args.map((a) => (a && typeof a === 'object' ? JSON.stringify(a) : a)).join(' '), ImageViewTraceCategory, type);
|
|
19
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* Options for scaling the child bounds to the parent bounds
|
|
23
|
+
*/
|
|
20
24
|
export var ScaleType;
|
|
21
25
|
(function (ScaleType) {
|
|
22
26
|
ScaleType["None"] = "none";
|
|
27
|
+
/**
|
|
28
|
+
* Scales width and height independently, so that the child matches the parent exactly.
|
|
29
|
+
*/
|
|
23
30
|
ScaleType["Fill"] = "fill";
|
|
31
|
+
/**
|
|
32
|
+
* Scales the child so that both dimensions will be greater than or equal to the corresponding dimension of the parent.
|
|
33
|
+
*/
|
|
24
34
|
ScaleType["AspectFill"] = "aspectFill";
|
|
35
|
+
/**
|
|
36
|
+
* Scales the child so that it fits entirely inside the parent.
|
|
37
|
+
*/
|
|
25
38
|
ScaleType["AspectFit"] = "aspectFit";
|
|
39
|
+
/**
|
|
40
|
+
* Performs no scaling.
|
|
41
|
+
*/
|
|
26
42
|
ScaleType["Center"] = "center";
|
|
43
|
+
/**
|
|
44
|
+
* Scales the child so that both dimensions will be greater than or equal to the corresponding dimension of the parent.
|
|
45
|
+
*/
|
|
27
46
|
ScaleType["CenterCrop"] = "centerCrop";
|
|
47
|
+
/**
|
|
48
|
+
* Scales the child so that it fits entirely inside the parent.
|
|
49
|
+
*/
|
|
28
50
|
ScaleType["CenterInside"] = "centerInside";
|
|
51
|
+
/**
|
|
52
|
+
* Scales the child so that it fits entirely inside the parent.
|
|
53
|
+
*/
|
|
29
54
|
ScaleType["FitCenter"] = "fitCenter";
|
|
55
|
+
/**
|
|
56
|
+
* Scales the child so that it fits entirely inside the parent.
|
|
57
|
+
*/
|
|
30
58
|
ScaleType["FitEnd"] = "fitEnd";
|
|
59
|
+
/**
|
|
60
|
+
* Scales the child so that it fits entirely inside the parent.
|
|
61
|
+
*/
|
|
31
62
|
ScaleType["FitStart"] = "fitStart";
|
|
63
|
+
/**
|
|
64
|
+
* Scales width and height independently, so that the child matches the parent exactly.
|
|
65
|
+
*/
|
|
32
66
|
ScaleType["FitXY"] = "fitXY";
|
|
67
|
+
/**
|
|
68
|
+
* Scales the child so that both dimensions will be greater than or equal to the corresponding dimension of the parent.
|
|
69
|
+
*/
|
|
33
70
|
ScaleType["FocusCrop"] = "focusCrop";
|
|
34
71
|
})(ScaleType || (ScaleType = {}));
|
|
35
72
|
export function wrapNativeException(ex, errorType = typeof ex) {
|
|
@@ -73,7 +110,7 @@ export const tapToRetryEnabledProperty = new Property({ name: 'tapToRetryEnabled
|
|
|
73
110
|
export const aspectRatioProperty = new Property({ name: 'aspectRatio', affectsLayout: true, valueConverter: (v) => parseFloat(v) });
|
|
74
111
|
export const decodeWidthProperty = new Property({ name: 'decodeWidth', valueConverter: (v) => parseFloat(v) });
|
|
75
112
|
export const decodeHeightProperty = new Property({ name: 'decodeHeight', valueConverter: (v) => parseFloat(v) });
|
|
76
|
-
export const tintColorProperty = new Property({ name: 'tintColor' });
|
|
113
|
+
export const tintColorProperty = new Property({ name: 'tintColor', valueConverter: colorConverter });
|
|
77
114
|
export const alwaysFadeProperty = new Property({ name: 'alwaysFade', valueConverter: booleanConverter, defaultValue: false });
|
|
78
115
|
export const fadeDurationProperty = new Property({ name: 'fadeDuration', valueConverter: (v) => parseFloat(v) });
|
|
79
116
|
export const noCacheProperty = new Property({ name: 'noCache', defaultValue: false, valueConverter: booleanConverter });
|
|
@@ -150,7 +187,7 @@ export const needRequestImage = function (target, propertyKey, descriptor) {
|
|
|
150
187
|
return originalMethod.apply(this, args);
|
|
151
188
|
};
|
|
152
189
|
};
|
|
153
|
-
|
|
190
|
+
let ImageBase = ImageBase_1 = class ImageBase extends View {
|
|
154
191
|
constructor() {
|
|
155
192
|
super(...arguments);
|
|
156
193
|
this.mCanRequestImage = true;
|
|
@@ -160,6 +197,29 @@ export class ImageBase extends View {
|
|
|
160
197
|
get nativeImageViewProtected() {
|
|
161
198
|
return this.nativeViewProtected;
|
|
162
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Same as `View.animate` but `imageRotation` can be animated, without the need of a patched @nativescript/core.
|
|
202
|
+
* Android rotates the image, iOS cross fades between the previous and the rotated image.
|
|
203
|
+
*/
|
|
204
|
+
animate(animation) {
|
|
205
|
+
const { imageRotation, ...viewAnimation } = animation;
|
|
206
|
+
if (imageRotation === undefined) {
|
|
207
|
+
return super.animate(animation);
|
|
208
|
+
}
|
|
209
|
+
const duration = animation.duration ?? 300;
|
|
210
|
+
this.animateImageRotation(imageRotation, duration);
|
|
211
|
+
const rotationDone = new Promise((resolve) => {
|
|
212
|
+
setTimeout(() => {
|
|
213
|
+
this.imageRotation = imageRotation;
|
|
214
|
+
resolve();
|
|
215
|
+
}, duration);
|
|
216
|
+
});
|
|
217
|
+
const otherProperties = Object.keys(viewAnimation).filter((key) => !['curve', 'delay', 'duration', 'iterations', 'target'].includes(key));
|
|
218
|
+
const viewDone = otherProperties.length ? super.animate(viewAnimation) : null;
|
|
219
|
+
// the result is only awaited or cancelled: a plain promise with a no-op cancel is enough
|
|
220
|
+
const result = Promise.all([rotationDone, viewDone]).then(() => undefined);
|
|
221
|
+
return Object.assign(result, { cancel: () => viewDone?.cancel() });
|
|
222
|
+
}
|
|
163
223
|
onResumeNativeUpdates() {
|
|
164
224
|
// {N} suspends properties update on `_suspendNativeUpdates`. So we only need to do this in onResumeNativeUpdates
|
|
165
225
|
this.mCanRequestImage = false;
|
|
@@ -191,7 +251,7 @@ export class ImageBase extends View {
|
|
|
191
251
|
computeScaleFactor(measureWidth, measureHeight, widthIsFinite, heightIsFinite, nativeWidth, nativeHeight, aspectRatio) {
|
|
192
252
|
let scaleW = 1;
|
|
193
253
|
let scaleH = 1;
|
|
194
|
-
if (
|
|
254
|
+
if (ImageBase_1.needsSizeAdjustment(this.stretch) || widthIsFinite || heightIsFinite) {
|
|
195
255
|
const nativeScale = nativeWidth > 0 && nativeHeight > 0 ? nativeWidth / nativeHeight : 1;
|
|
196
256
|
const measureScale = measureWidth > 0 && measureHeight > 0 ? measureWidth / measureHeight : 1;
|
|
197
257
|
scaleW = nativeWidth > 0 ? measureWidth / nativeWidth : 1;
|
|
@@ -240,7 +300,7 @@ export class ImageBase extends View {
|
|
|
240
300
|
}
|
|
241
301
|
return { width: scaleW, height: scaleH };
|
|
242
302
|
}
|
|
243
|
-
}
|
|
303
|
+
};
|
|
244
304
|
ImageBase.finalImageSetEvent = 'finalImageSet';
|
|
245
305
|
ImageBase.failureEvent = 'failure';
|
|
246
306
|
ImageBase.intermediateImageFailedEvent = 'intermediateImageFailed';
|
|
@@ -249,6 +309,10 @@ ImageBase.releaseEvent = 'release';
|
|
|
249
309
|
ImageBase.submitEvent = 'submit';
|
|
250
310
|
ImageBase.progressEvent = 'progress';
|
|
251
311
|
ImageBase.loadSourceEvent = 'loadSource';
|
|
312
|
+
ImageBase = ImageBase_1 = __decorate([
|
|
313
|
+
CSSType('Img')
|
|
314
|
+
], ImageBase);
|
|
315
|
+
export { ImageBase };
|
|
252
316
|
srcProperty.register(ImageBase);
|
|
253
317
|
headersProperty.register(ImageBase);
|
|
254
318
|
lowerResSrcProperty.register(ImageBase);
|
package/index-common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-common.js","sourceRoot":"","sources":["../../src/image/index-common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAa,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,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,CAAC,SAAS,CAAC,CAAC;AAC3C,iBAAiB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACtC,kDAAkD;AAElD,sDAAsD"}
|
package/index.android.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './index-common';
|
|
2
|
-
import { ImageBase, ImageError as ImageErrorBase, ImageInfo as ImageInfoBase, ImagePipelineConfigSetting, PrefetchOptions, SrcType } from './index-common';
|
|
2
|
+
import { ImageBase, ImageError as ImageErrorBase, ImageInfo as ImageInfoBase, ImagePipelineConfigSetting, PrefetchOptions, QualityInfo, SrcType } from './index-common';
|
|
3
3
|
export declare function initialize(config?: ImagePipelineConfigSetting): void;
|
|
4
4
|
export declare class ImagePipeline {
|
|
5
5
|
toUri(value: string | android.net.Uri): string;
|
|
@@ -28,11 +28,6 @@ export declare class ImageError implements ImageErrorBase {
|
|
|
28
28
|
getErrorType(): string;
|
|
29
29
|
toString(): string;
|
|
30
30
|
}
|
|
31
|
-
export interface QualityInfo {
|
|
32
|
-
getQuality(): any;
|
|
33
|
-
isOfFullQuality(): any;
|
|
34
|
-
isOfGoodEnoughQuality(): any;
|
|
35
|
-
}
|
|
36
31
|
export declare class ImageInfo implements ImageInfoBase {
|
|
37
32
|
private _width;
|
|
38
33
|
private _height;
|
|
@@ -62,6 +57,7 @@ export declare class Img extends ImageBase {
|
|
|
62
57
|
* This ensures Glide loads the fresh content instead of serving cached data.
|
|
63
58
|
*/
|
|
64
59
|
forceReloadImage(): Promise<void>;
|
|
60
|
+
protected animateImageRotation(imageRotation: number, duration: number): void;
|
|
65
61
|
private cancelCurrentRequest;
|
|
66
62
|
private loadImageWithGlide;
|
|
67
63
|
private notifyLoadSource;
|
package/index.android.js
CHANGED
|
@@ -3,12 +3,13 @@ export * from './index-common';
|
|
|
3
3
|
import { Color, ImageAsset, ImageSource, Trace, Utils, backgroundInternalProperty, knownFolders, path } from '@nativescript/core';
|
|
4
4
|
import { isString } from '@nativescript/core/utils/types';
|
|
5
5
|
import { CLog, CLogTypes, ImageBase, ScaleType, aspectRatioProperty, backgroundUriProperty, blurDownSamplingProperty, blurRadiusProperty, decodeHeightProperty, decodeWidthProperty, fadeDurationProperty, failureImageUriProperty, headersProperty, imageRotationProperty, lowerResSrcProperty, needRequestImage, noRatioEnforceProperty, placeholderImageUriProperty, roundAsCircleProperty, roundBottomLeftRadiusProperty, roundBottomRightRadiusProperty, roundTopLeftRadiusProperty, roundTopRightRadiusProperty, srcProperty, stretchProperty, tintColorProperty, wrapNativeException } from './index-common';
|
|
6
|
+
import { registerSharedTransitionHandler } from './shared-transition.android';
|
|
6
7
|
let initialized = false;
|
|
7
8
|
let glideInstance;
|
|
8
9
|
// global signature to invalidate all cache if needed by plugin
|
|
9
10
|
let signature;
|
|
10
11
|
const globalSignatureKey = 'v1';
|
|
11
|
-
export function initialize(config) {
|
|
12
|
+
export function initialize(config = {}) {
|
|
12
13
|
if (!initialized) {
|
|
13
14
|
const context = Utils.android.getApplicationContext();
|
|
14
15
|
const glideConfig = com.nativescript.image.GlideConfiguration.getInstance();
|
|
@@ -18,9 +19,16 @@ export function initialize(config) {
|
|
|
18
19
|
if (config?.memoryCacheScreens > 0) {
|
|
19
20
|
glideConfig.setMemoryCacheScreens(config.memoryCacheScreens);
|
|
20
21
|
}
|
|
22
|
+
// @ts-ignore okhttp3 only exists in the app
|
|
23
|
+
if (config?.useOkhttp && config.useOkhttp instanceof okhttp3.OkHttpClient) {
|
|
24
|
+
glideConfig.setOkHttpClient(config.useOkhttp);
|
|
25
|
+
}
|
|
21
26
|
if (config?.usePersistentCacheKeyStore) {
|
|
22
27
|
com.nativescript.image.EvictionManager.get().setPersistentStore(new com.nativescript.image.SharedPrefCacheKeyStore(Utils.android.getApplicationContext()));
|
|
23
28
|
}
|
|
29
|
+
if (config.onInitialize) {
|
|
30
|
+
config.onInitialize(glideConfig, config);
|
|
31
|
+
}
|
|
24
32
|
signature = new com.bumptech.glide.signature.ObjectKey(config?.globalSignatureKey || globalSignatureKey);
|
|
25
33
|
// Now initialize Glide (which will read from GlideConfiguration)
|
|
26
34
|
glideInstance = com.bumptech.glide.Glide.get(context);
|
|
@@ -195,10 +203,11 @@ export class ImagePipeline {
|
|
|
195
203
|
// For local files (file://), use plain URI string to avoid OkHttp requirement
|
|
196
204
|
if (isNetworkRequest) {
|
|
197
205
|
let headersMap = null;
|
|
198
|
-
|
|
206
|
+
const headers = typeof options?.headers === 'function' ? options.headers() : options?.headers;
|
|
207
|
+
if (headers) {
|
|
199
208
|
headersMap = new java.util.HashMap();
|
|
200
|
-
for (const key in
|
|
201
|
-
headersMap.put(key,
|
|
209
|
+
for (const key in headers) {
|
|
210
|
+
headersMap.put(key, headers[key]);
|
|
202
211
|
}
|
|
203
212
|
}
|
|
204
213
|
loadModel = new com.nativescript.image.CustomGlideUrl(url, headersMap, null, // progressCallback
|
|
@@ -432,6 +441,9 @@ export class Img extends ImageBase {
|
|
|
432
441
|
this.handleImageSrc(null);
|
|
433
442
|
this.initImage();
|
|
434
443
|
}
|
|
444
|
+
animateImageRotation(imageRotation, duration) {
|
|
445
|
+
this.nativeViewProtected?.animateImageRotation(imageRotation, duration);
|
|
446
|
+
}
|
|
435
447
|
[_a = placeholderImageUriProperty.setNative]() { }
|
|
436
448
|
[_b = failureImageUriProperty.setNative]() { }
|
|
437
449
|
[stretchProperty.setNative]() {
|
|
@@ -551,10 +563,11 @@ export class Img extends ImageBase {
|
|
|
551
563
|
// For local file:// URIs, use the string directly to avoid CustomDataFetcher's OkHttp requirement
|
|
552
564
|
if (this.isNetworkRequest && (this.headers || this.progressCallback || this.loadSourceCallback)) {
|
|
553
565
|
let headersMap = null;
|
|
554
|
-
|
|
566
|
+
const headers = typeof this.headers === 'function' ? this.headers() : this.headers;
|
|
567
|
+
if (headers) {
|
|
555
568
|
headersMap = new java.util.HashMap();
|
|
556
|
-
for (const key in
|
|
557
|
-
headersMap.put(key,
|
|
569
|
+
for (const key in headers) {
|
|
570
|
+
headersMap.put(key, headers[key]);
|
|
558
571
|
}
|
|
559
572
|
}
|
|
560
573
|
loadModel = new com.nativescript.image.CustomGlideUrl(uri, headersMap, this.progressCallback, // Can be null
|
|
@@ -818,7 +831,7 @@ export class Img extends ImageBase {
|
|
|
818
831
|
return;
|
|
819
832
|
}
|
|
820
833
|
else if (typeof src === 'function') {
|
|
821
|
-
const newSrc = src();
|
|
834
|
+
const newSrc = src(this);
|
|
822
835
|
if (newSrc instanceof Promise) {
|
|
823
836
|
await newSrc;
|
|
824
837
|
}
|
|
@@ -992,4 +1005,5 @@ function getScaleType(scaleType) {
|
|
|
992
1005
|
}
|
|
993
1006
|
return android.widget.ImageView.ScaleType.FIT_CENTER;
|
|
994
1007
|
}
|
|
1008
|
+
registerSharedTransitionHandler(Img);
|
|
995
1009
|
//# sourceMappingURL=index.android.js.map
|