Skip to content

Commit 57c5f12

Browse files
committed
update dependencies versions
1 parent cf78ca4 commit 57c5f12

File tree

4 files changed

+52
-22
lines changed

4 files changed

+52
-22
lines changed

android/build.gradle

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ buildscript {
1212
apply plugin: 'com.android.library'
1313

1414
android {
15-
compileSdkVersion 23
16-
buildToolsVersion "23.0.1"
15+
compileSdkVersion 26
16+
buildToolsVersion "25.0.3"
1717

1818
defaultConfig {
1919
minSdkVersion 16
20-
targetSdkVersion 22
20+
targetSdkVersion 26
2121
versionCode 1
2222
versionName "1.0"
2323
}
@@ -27,24 +27,25 @@ android {
2727
}
2828

2929
repositories {
30-
maven { url "https://jitpack.io" }
3130
mavenCentral()
31+
maven { url "https://jitpack.io" }
32+
maven { url 'https://maven.google.com' }
3233
jcenter()
3334
}
3435

3536
dependencies {
3637
compile 'com.facebook.react:react-native:+'
3738

3839
// glide dependencies
39-
compile 'com.github.bumptech.glide:glide:3.5.2'
40-
compile 'com.android.support:support-v4:22.0.0'
40+
compile 'com.github.bumptech.glide:glide:4.2.0'
41+
annotationProcessor 'com.github.bumptech.glide:compiler:4.2.0'
4142

4243
// FirebaseUI Storage only
43-
compile 'com.firebaseui:firebase-ui-storage:0.6.0'
44+
compile 'com.firebaseui:firebase-ui-storage:3.0.0'
4445

4546
// PhotoView
4647
compile 'com.github.chrisbanes:PhotoView:2.1.3'
4748

4849
// glide-transformations
49-
compile 'jp.wasabeef:glide-transformations:2.0.2'
50+
compile 'jp.wasabeef:glide-transformations:3.0.1'
5051
}

android/src/main/java/io/rumors/reactnativefirebaseui/storage/ExtendedImageView.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
import com.bumptech.glide.load.Transformation;
1717
import com.bumptech.glide.load.resource.bitmap.FitCenter;
1818
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
19-
19+
import com.bumptech.glide.load.MultiTransformation;
20+
import static com.bumptech.glide.request.RequestOptions.bitmapTransform;
2021

2122
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
2223
import jp.wasabeef.glide.transformations.RoundedCornersTransformation.CornerType;
@@ -54,22 +55,24 @@ public void updateView() {
5455
ArrayList<Transformation> transformations = new ArrayList<Transformation>(1 + mBorderRadii.size());
5556

5657
if (mScaleType == ScaleType.CENTER_CROP) {
57-
transformations.add(new CenterCrop(mContext));
58+
transformations.add(new CenterCrop());
5859
} else {
59-
transformations.add(new FitCenter(mContext));
60+
transformations.add(new FitCenter());
6061
}
6162

6263
for (Entry<CornerType, Integer> entry : mBorderRadii.entrySet()) {
6364
CornerType cornerType = entry.getKey();
6465
Integer radius = entry.getValue();
65-
transformations.add(new RoundedCornersTransformation(mContext, radius, 0, cornerType));
66+
transformations.add(new RoundedCornersTransformation(radius, 0, cornerType));
6667
}
6768

6869
Transformation[] transformationsArray = transformations.toArray(new Transformation[transformations.size()]);
6970

70-
Glide.with(mContext).using(imageLoader)
71+
MultiTransformation multi = new MultiTransformation<>(transformationsArray);
72+
73+
GlideApp.with(mContext)
7174
.load(storageReference)
72-
.bitmapTransform(transformationsArray)
75+
.apply(bitmapTransform(multi))
7376
.into(this);
7477
}
7578
}

android/src/main/java/io/rumors/reactnativefirebaseui/storage/ExtendedPhotoView.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
import com.bumptech.glide.load.Transformation;
1717
import com.bumptech.glide.load.resource.bitmap.FitCenter;
1818
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
19-
19+
import com.bumptech.glide.load.MultiTransformation;
20+
import com.bumptech.glide.module.AppGlideModule;
21+
import static com.bumptech.glide.request.RequestOptions.bitmapTransform;
2022

2123
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
2224
import jp.wasabeef.glide.transformations.RoundedCornersTransformation.CornerType;
@@ -49,27 +51,28 @@ public void setBorderRadius(int borderRadius, CornerType cornerType) {
4951

5052
public void updateView() {
5153
StorageReference storageReference = FirebaseStorage.getInstance().getReference(mPath);
52-
FirebaseImageLoader imageLoader = new FirebaseImageLoader();
5354

5455
ArrayList<Transformation> transformations = new ArrayList<Transformation>(1 + mBorderRadii.size());
5556

5657
if (mScaleType == ScaleType.CENTER_CROP) {
57-
transformations.add(new CenterCrop(mContext));
58+
transformations.add(new CenterCrop());
5859
} else {
59-
transformations.add(new FitCenter(mContext));
60+
transformations.add(new FitCenter());
6061
}
6162

6263
for (Entry<CornerType, Integer> entry : mBorderRadii.entrySet()) {
6364
CornerType cornerType = entry.getKey();
6465
Integer radius = entry.getValue();
65-
transformations.add(new RoundedCornersTransformation(mContext, radius, 0, cornerType));
66+
transformations.add(new RoundedCornersTransformation(radius, 0, cornerType));
6667
}
6768

69+
6870
Transformation[] transformationsArray = transformations.toArray(new Transformation[transformations.size()]);
71+
MultiTransformation multi = new MultiTransformation<>(transformationsArray);
6972

70-
Glide.with(mContext).using(imageLoader)
73+
GlideApp.with(mContext)
7174
.load(storageReference)
72-
.bitmapTransform(transformationsArray)
75+
.apply(bitmapTransform(multi))
7376
.into(this);
7477
}
75-
}
78+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package io.rumors.reactnativefirebaseui.storage;
2+
3+
import android.content.Context;
4+
import com.bumptech.glide.Glide;
5+
import com.bumptech.glide.Registry;
6+
import com.bumptech.glide.annotation.GlideModule;
7+
import com.bumptech.glide.module.AppGlideModule;
8+
9+
import com.firebase.ui.storage.images.FirebaseImageLoader;
10+
import com.google.firebase.storage.StorageReference;
11+
12+
import java.io.InputStream;
13+
14+
15+
@GlideModule
16+
public class ImageLoaderGlideModule extends AppGlideModule {
17+
@Override
18+
public void registerComponents(Context context, Glide glide, Registry registry) {
19+
// Register FirebaseImageLoader to handle StorageReference
20+
registry.append(StorageReference.class, InputStream.class,
21+
new FirebaseImageLoader.Factory());
22+
}
23+
}

0 commit comments

Comments
 (0)