react-native-fast-image 8.6.12 → 8.6.14

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/README.md CHANGED
@@ -9,7 +9,6 @@ Performant React Native image component.
9
9
  [![Version][version-badge]][package]
10
10
  [![Downloads][downloads-badge]][npmtrends]
11
11
  [![Build Status][build-badge]][build]
12
- [![Code Coverage][coverage-badge]][coverage]
13
12
 
14
13
  [![Watch on GitHub][github-watch-badge]][github-watch]
15
14
  [![Star on GitHub][github-star-badge]][github-star]
@@ -129,6 +128,8 @@ Headers to load the image with. e.g. `{ Authorization: 'someAuthToken' }`.
129
128
 
130
129
  ### `source.priority?: enum`
131
130
 
131
+ Indicates the load order priority of an image. Images with `FastImage.priority.high` will load before images in a similar context with low or normal priority.
132
+
132
133
  - `FastImage.priority.low` - Low Priority.
133
134
  - `FastImage.priority.normal` **(Default)** - Normal Priority.
134
135
  - `FastImage.priority.high` - High Priority.
@@ -266,12 +267,10 @@ Thanks to [@mobinni](https://github.com/mobinni) for helping with the conceptual
266
267
 
267
268
  - FastImage - MIT © [DylanVann](https://github.com/DylanVann)
268
269
  - SDWebImage - `MIT`
269
- - Glide - BSD, part MIT and Apache 2.0. See the [LICENSE](https://github.com/bumptech/glide/blob/master/license) file for details.
270
+ - Glide - BSD, part MIT and Apache 2.0. See the [LICENSE](https://github.com/bumptech/glide/blob/master/LICENSE) file for details.
270
271
 
271
- [build-badge]: https://github.com/dylanvann/react-native-fast-image/workflows/CI/badge.svg
272
- [build]: https://github.com/DylanVann/react-native-fast-image/actions?query=workflow%3ACI
273
- [coverage-badge]: https://img.shields.io/codecov/c/github/dylanvann/react-native-fast-image.svg
274
- [coverage]: https://codecov.io/github/dylanvann/react-native-fast-image
272
+ [build-badge]: https://github.com/DylanVann/react-native-fast-image/actions/workflows/ci.yml/badge.svg
273
+ [build]: https://github.com/DylanVann/react-native-fast-image/actions/workflows/ci.yml
275
274
  [downloads-badge]: https://img.shields.io/npm/dm/react-native-fast-image.svg
276
275
  [npmtrends]: http://www.npmtrends.com/react-native-fast-image
277
276
  [package]: https://www.npmjs.com/package/react-native-fast-image
@@ -19,7 +19,15 @@ buildscript {
19
19
 
20
20
  apply plugin: 'com.android.library'
21
21
 
22
+ // Newer versions of the Android Gradle plugin (7.3+) take the namespace from
23
+ // build.gradle and warn about the package attribute in AndroidManifest.xml;
24
+ // older versions need that attribute.
25
+ def supportsNamespace = project.android.hasProperty("namespace")
26
+
22
27
  android {
28
+ if (supportsNamespace) {
29
+ namespace "com.dylanvann.fastimage"
30
+ }
23
31
  compileSdkVersion safeExtGet('compileSdkVersion', 28)
24
32
  buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
25
33
  defaultConfig {
@@ -30,6 +38,9 @@ android {
30
38
  }
31
39
  sourceSets {
32
40
  main {
41
+ if (supportsNamespace) {
42
+ manifest.srcFile "src/main/AndroidManifestNew.xml"
43
+ }
33
44
  java {
34
45
  if (safeExtGet('excludeAppGlideModule', false)) {
35
46
  srcDir "src"
@@ -0,0 +1,3 @@
1
+ <!-- Used instead of AndroidManifest.xml when the namespace is set in build.gradle. -->
2
+ <manifest>
3
+ </manifest>
@@ -11,6 +11,9 @@
11
11
  @property(nonatomic, assign) BOOL needsReload;
12
12
 
13
13
  @property(nonatomic, strong) NSDictionary* onLoadEvent;
14
+ // The image before tinting, kept while a tint is applied so the tint can be
15
+ // changed or removed. nil when there's no tint (super.image is untinted).
16
+ @property(nonatomic, strong) UIImage* untintedImage;
14
17
 
15
18
  @end
16
19
 
@@ -63,11 +66,11 @@
63
66
  }
64
67
 
65
68
  - (void) setImageColor: (UIColor*)imageColor {
66
- if (imageColor != nil) {
67
- _imageColor = imageColor;
68
- if (super.image) {
69
- super.image = [self makeImage: super.image withTint: self.imageColor];
70
- }
69
+ _imageColor = imageColor;
70
+ // Re-apply to the untinted image, so the tint can change or be removed.
71
+ UIImage* image = self.untintedImage ?: super.image;
72
+ if (image) {
73
+ [self setImage: image];
71
74
  }
72
75
  }
73
76
 
@@ -110,8 +113,10 @@
110
113
 
111
114
  - (void) setImage: (UIImage*)image {
112
115
  if (self.imageColor != nil) {
116
+ self.untintedImage = image;
113
117
  super.image = [self makeImage: image withTint: self.imageColor];
114
118
  } else {
119
+ self.untintedImage = nil;
115
120
  super.image = image;
116
121
  }
117
122
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-fast-image",
3
- "version": "8.6.12",
3
+ "version": "8.6.14",
4
4
  "description": "🚩 FastImage, performant React Native image component.",
5
5
  "keywords": [
6
6
  "cache",