expo-image-loader 2.1.1 → 3.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 +26 -0
- package/README.md +1 -1
- package/android/build.gradle +10 -18
- package/android/src/main/java/expo/modules/imageloader/ImageLoaderModule.kt +20 -15
- package/android/src/main/java/expo/modules/imageloader/ImageLoaderPackage.kt +2 -2
- package/ios/EXImageLoader/EXImageLoader.h +3 -3
- package/ios/EXImageLoader/EXImageLoader.m +4 -3
- package/ios/EXImageLoader.podspec +3 -3
- package/package.json +7 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,32 @@
|
|
|
8
8
|
|
|
9
9
|
### 🐛 Bug fixes
|
|
10
10
|
|
|
11
|
+
### 💡 Others
|
|
12
|
+
|
|
13
|
+
## 3.1.0 — 2021-12-03
|
|
14
|
+
|
|
15
|
+
_This version does not introduce any user-facing changes._
|
|
16
|
+
|
|
17
|
+
## 3.0.0 — 2021-09-28
|
|
18
|
+
|
|
19
|
+
### 🛠 Breaking changes
|
|
20
|
+
|
|
21
|
+
- Dropped support for iOS 11.0 ([#14383](https://github.com/expo/expo/pull/14383) by [@cruzach](https://github.com/cruzach))
|
|
22
|
+
|
|
23
|
+
### 🐛 Bug fixes
|
|
24
|
+
|
|
25
|
+
- Fix building errors from use_frameworks! in Podfile. ([#14523](https://github.com/expo/expo/pull/14523) by [@kudo](https://github.com/kudo))
|
|
26
|
+
|
|
27
|
+
## 2.3.0-alpha.0 — 2021-08-17
|
|
28
|
+
|
|
29
|
+
_This version does not introduce any user-facing changes._
|
|
30
|
+
|
|
31
|
+
## 2.2.0 — 2021-06-16
|
|
32
|
+
|
|
33
|
+
### 🐛 Bug fixes
|
|
34
|
+
|
|
35
|
+
- Enable kotlin in all modules. ([#12716](https://github.com/expo/expo/pull/12716) by [@wschurman](https://github.com/wschurman))
|
|
36
|
+
|
|
11
37
|
## 2.1.1 — 2021-03-23
|
|
12
38
|
|
|
13
39
|
_This version does not introduce any user-facing changes._
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ For [managed](https://docs.expo.io/versions/latest/introduction/managed-vs-bare/
|
|
|
8
8
|
|
|
9
9
|
# Installation in bare React Native projects
|
|
10
10
|
|
|
11
|
-
For bare React Native projects, you must ensure that you have [installed and configured the `
|
|
11
|
+
For bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing.
|
|
12
12
|
|
|
13
13
|
### Add the package to your npm dependencies
|
|
14
14
|
|
package/android/build.gradle
CHANGED
|
@@ -13,12 +13,12 @@ buildscript {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
dependencies {
|
|
16
|
-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet(
|
|
16
|
+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.4.21')}")
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
group = 'host.exp.exponent'
|
|
21
|
-
version = '
|
|
21
|
+
version = '3.1.0'
|
|
22
22
|
|
|
23
23
|
// Upload android library to maven with javadoc and android sources
|
|
24
24
|
configurations {
|
|
@@ -48,38 +48,30 @@ uploadArchives {
|
|
|
48
48
|
android {
|
|
49
49
|
compileSdkVersion safeExtGet("compileSdkVersion", 30)
|
|
50
50
|
|
|
51
|
+
compileOptions {
|
|
52
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
53
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
54
|
+
}
|
|
55
|
+
|
|
51
56
|
defaultConfig {
|
|
52
57
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
53
58
|
targetSdkVersion safeExtGet("targetSdkVersion", 30)
|
|
54
59
|
versionCode 8
|
|
55
|
-
versionName "
|
|
60
|
+
versionName "3.1.0"
|
|
56
61
|
}
|
|
57
62
|
lintOptions {
|
|
58
63
|
abortOnError false
|
|
59
64
|
}
|
|
60
|
-
compileOptions {
|
|
61
|
-
sourceCompatibility = '1.8'
|
|
62
|
-
targetCompatibility = '1.8'
|
|
63
|
-
}
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
repositories {
|
|
67
68
|
mavenCentral()
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
if (new File(rootProject.projectDir.parentFile, 'package.json').exists()) {
|
|
71
|
-
apply from: project(":unimodules-core").file("../unimodules-core.gradle")
|
|
72
|
-
} else {
|
|
73
|
-
throw new GradleException(
|
|
74
|
-
'\'unimodules-core.gradle\' was not found in the usual React Native dependency location. ' +
|
|
75
|
-
'This package can only be used in such projects. Are you sure you\'ve installed the dependencies properly?')
|
|
76
|
-
}
|
|
77
|
-
|
|
78
71
|
dependencies {
|
|
79
|
-
|
|
80
|
-
unimodule 'unimodules-image-loader-interface'
|
|
72
|
+
implementation project(':expo-modules-core')
|
|
81
73
|
|
|
82
|
-
|
|
74
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.4.21')}"
|
|
83
75
|
api 'com.github.bumptech.glide:glide:4.9.0'
|
|
84
76
|
api 'com.facebook.fresco:fresco:2.0.0'
|
|
85
77
|
}
|
|
@@ -16,29 +16,31 @@ import com.facebook.drawee.backends.pipeline.Fresco
|
|
|
16
16
|
import com.facebook.imagepipeline.datasource.BaseBitmapDataSubscriber
|
|
17
17
|
import com.facebook.imagepipeline.image.CloseableImage
|
|
18
18
|
import com.facebook.imagepipeline.request.ImageRequest
|
|
19
|
-
import
|
|
20
|
-
import
|
|
19
|
+
import expo.modules.interfaces.imageloader.ImageLoaderInterface
|
|
20
|
+
import expo.modules.core.interfaces.InternalModule
|
|
21
21
|
import java.util.concurrent.ExecutionException
|
|
22
22
|
import java.util.concurrent.Future
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
class ImageLoaderModule(val context: Context) : InternalModule, ImageLoader {
|
|
24
|
+
class ImageLoaderModule(val context: Context) : InternalModule, ImageLoaderInterface {
|
|
26
25
|
|
|
27
26
|
override fun getExportedInterfaces(): List<Class<*>>? {
|
|
28
|
-
return listOf(
|
|
27
|
+
return listOf(ImageLoaderInterface::class.java)
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
override fun loadImageForDisplayFromURL(url: String): Future<Bitmap> {
|
|
32
31
|
val future = SimpleSettableFuture<Bitmap>()
|
|
33
|
-
loadImageForDisplayFromURL(
|
|
34
|
-
|
|
32
|
+
loadImageForDisplayFromURL(
|
|
33
|
+
url,
|
|
34
|
+
object : ImageLoaderInterface.ResultListener {
|
|
35
|
+
override fun onSuccess(bitmap: Bitmap) = future.set(bitmap)
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
override fun onFailure(@Nullable cause: Throwable?) = future.setException(ExecutionException(cause))
|
|
38
|
+
}
|
|
39
|
+
)
|
|
38
40
|
return future
|
|
39
41
|
}
|
|
40
42
|
|
|
41
|
-
override fun loadImageForDisplayFromURL(url: String, resultListener:
|
|
43
|
+
override fun loadImageForDisplayFromURL(url: String, resultListener: ImageLoaderInterface.ResultListener) {
|
|
42
44
|
val imageRequest = ImageRequest.fromUri(url)
|
|
43
45
|
val imagePipeline = Fresco.getImagePipeline()
|
|
44
46
|
val dataSource = imagePipeline.fetchDecodedImage(imageRequest, context)
|
|
@@ -64,15 +66,18 @@ class ImageLoaderModule(val context: Context) : InternalModule, ImageLoader {
|
|
|
64
66
|
|
|
65
67
|
override fun loadImageForManipulationFromURL(@NonNull url: String): Future<Bitmap> {
|
|
66
68
|
val future = SimpleSettableFuture<Bitmap>()
|
|
67
|
-
loadImageForManipulationFromURL(
|
|
68
|
-
|
|
69
|
+
loadImageForManipulationFromURL(
|
|
70
|
+
url,
|
|
71
|
+
object : ImageLoaderInterface.ResultListener {
|
|
72
|
+
override fun onSuccess(bitmap: Bitmap) = future.set(bitmap)
|
|
69
73
|
|
|
70
|
-
|
|
71
|
-
|
|
74
|
+
override fun onFailure(@NonNull cause: Throwable?) = future.setException(ExecutionException(cause))
|
|
75
|
+
}
|
|
76
|
+
)
|
|
72
77
|
return future
|
|
73
78
|
}
|
|
74
79
|
|
|
75
|
-
override fun loadImageForManipulationFromURL(url: String, resultListener:
|
|
80
|
+
override fun loadImageForManipulationFromURL(url: String, resultListener: ImageLoaderInterface.ResultListener) {
|
|
76
81
|
val normalizedUrl = normalizeAssetsUrl(url)
|
|
77
82
|
|
|
78
83
|
Glide.with(context)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
package expo.modules.imageloader
|
|
2
2
|
|
|
3
3
|
import android.content.Context
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import expo.modules.core.BasePackage
|
|
5
|
+
import expo.modules.core.interfaces.InternalModule
|
|
6
6
|
|
|
7
7
|
class ImageLoaderPackage : BasePackage() {
|
|
8
8
|
override fun createInternalModules(context: Context): List<InternalModule> = listOf(ImageLoaderModule(context))
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Copyright 2019-present 650 Industries. All rights reserved.
|
|
2
2
|
|
|
3
|
-
#import <
|
|
4
|
-
#import <
|
|
3
|
+
#import <ExpoModulesCore/EXInternalModule.h>
|
|
4
|
+
#import <ExpoModulesCore/EXImageLoaderInterface.h>
|
|
5
5
|
#import <React/RCTBridgeModule.h>
|
|
6
6
|
#import <UIKit/UIKit.h>
|
|
7
7
|
|
|
8
|
-
@interface EXImageLoader : NSObject <RCTBridgeModule,
|
|
8
|
+
@interface EXImageLoader : NSObject <RCTBridgeModule, EXInternalModule, EXImageLoaderInterface>
|
|
9
9
|
|
|
10
10
|
@end
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
#import <EXImageLoader/EXImageLoader.h>
|
|
4
4
|
#import <React/RCTImageLoaderProtocol.h>
|
|
5
|
+
#import <ExpoModulesCore/EXUtilities.h>
|
|
5
6
|
|
|
6
7
|
@interface EXImageLoader ()
|
|
7
8
|
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
|
|
12
13
|
@implementation EXImageLoader
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
EX_REGISTER_MODULE();
|
|
15
16
|
|
|
16
17
|
+ (NSString *)moduleName
|
|
17
18
|
{
|
|
@@ -20,7 +21,7 @@ UM_REGISTER_MODULE();
|
|
|
20
21
|
|
|
21
22
|
+ (const NSArray<Protocol *> *)exportedInterfaces
|
|
22
23
|
{
|
|
23
|
-
return @[@protocol(
|
|
24
|
+
return @[@protocol(EXImageLoaderInterface)];
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
- (void)setBridge:(RCTBridge *)bridge
|
|
@@ -29,7 +30,7 @@ UM_REGISTER_MODULE();
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
- (void)loadImageForURL:(NSURL *)imageURL
|
|
32
|
-
completionHandler:(
|
|
33
|
+
completionHandler:(EXImageLoaderCompletionBlock)completionHandler
|
|
33
34
|
{
|
|
34
35
|
[[_bridge moduleForName:@"ImageLoader" lazilyLoadIfNecessary:YES] loadImageWithURLRequest:[NSURLRequest requestWithURL:imageURL]
|
|
35
36
|
callback:^(NSError *error, UIImage *loadedImage) {
|
|
@@ -10,12 +10,12 @@ Pod::Spec.new do |s|
|
|
|
10
10
|
s.license = package['license']
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.homepage = package['homepage']
|
|
13
|
-
s.platform = :ios, '
|
|
13
|
+
s.platform = :ios, '12.0'
|
|
14
14
|
s.source = { git: 'https://github.com/expo/expo.git' }
|
|
15
|
+
s.static_framework = true
|
|
15
16
|
|
|
16
17
|
s.dependency 'React-Core'
|
|
17
|
-
s.dependency '
|
|
18
|
-
s.dependency 'UMImageLoaderInterface'
|
|
18
|
+
s.dependency 'ExpoModulesCore'
|
|
19
19
|
|
|
20
20
|
if !$ExpoUseSources&.include?(package['name']) && ENV['EXPO_USE_SOURCE'].to_i == 0 && File.exist?("#{s.name}.xcframework") && Gem::Version.new(Pod::VERSION) >= Gem::Version.new('1.10.0')
|
|
21
21
|
s.source_files = "#{s.name}/**/*.h"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-image-loader",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Image loader",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -19,5 +19,10 @@
|
|
|
19
19
|
"author": "650 Industries, Inc.",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"homepage": "https://github.com/expo/expo/tree/master/packages/expo-image-loader",
|
|
22
|
-
"
|
|
22
|
+
"dependencies": {},
|
|
23
|
+
"devDependencies": {},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"expo": "*"
|
|
26
|
+
},
|
|
27
|
+
"gitHead": "2e5c6983b86d5ecfca028ba64002897d8adc2cc4"
|
|
23
28
|
}
|