Skip to content

Commit bac642c

Browse files
committed
update deps & scripts; publish v1.5.7;
1 parent 1cad880 commit bac642c

12 files changed

+66
-15
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Change log
22

3+
+ v1.5.7
4+
- Add `ImageLoader.cancelAll()` to allow APP cancel all flying requests, avoiding memory leak;
35
+ v1.5.6
46
- Replace deprecated Glide SimpleTarget, #131;
57
- Fix NPE when thumbnail scale type not specified, #130;

README.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,22 @@ allprojects {
3535
}
3636
}
3737
38-
implementation 'com.github.piasy:BigImageViewer:1.5.6'
38+
implementation 'com.github.piasy:BigImageViewer:1.5.7'
3939
4040
// load with fresco
41-
implementation 'com.github.piasy:FrescoImageLoader:1.5.6'
41+
implementation 'com.github.piasy:FrescoImageLoader:1.5.7'
4242
4343
// load with glide
44-
implementation 'com.github.piasy:GlideImageLoader:1.5.6'
44+
implementation 'com.github.piasy:GlideImageLoader:1.5.7'
4545
4646
// progress pie indicator
47-
implementation 'com.github.piasy:ProgressPieIndicator:1.5.6'
47+
implementation 'com.github.piasy:ProgressPieIndicator:1.5.7'
4848
4949
// support thumbnail, gif and webp with Fresco
50-
implementation 'com.github.piasy:FrescoImageViewFactory:1.5.6'
50+
implementation 'com.github.piasy:FrescoImageViewFactory:1.5.7'
5151
5252
// support thumbnail and gif with Glide
53-
implementation 'com.github.piasy:GlideImageViewFactory:1.5.6'
53+
implementation 'com.github.piasy:GlideImageViewFactory:1.5.7'
5454
```
5555

5656
### Initialize
@@ -276,6 +276,9 @@ For an example, see ImageLoaderCallbackActivity.java
276276
BIV will cancel image loading automatically when detach from window, you can also call `cancel`
277277
to cancel it manually.
278278

279+
You can also call `BigImageViewer.imageLoader().cancelAll();` in an appropriate time,
280+
e.g. Activity/Fragment's `onDestroy` callback, to cancel all flying requests, avoiding memory leak.
281+
279282
### Full customization
280283

281284
You can get the SSIV instance through the method below:

app/src/main/java/com/github/piasy/biv/example/CustomSSIVActivity.java

+7
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,11 @@ protected SubsamplingScaleImageView createStillImageView(final Context context)
6666
}
6767
});
6868
}
69+
70+
@Override
71+
protected void onDestroy() {
72+
super.onDestroy();
73+
74+
BigImageViewer.imageLoader().cancelAll();
75+
}
6976
}

app/src/main/java/com/github/piasy/biv/example/FrescoLoaderActivity.java

+7
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,11 @@ public void onClick(View v) {
5555
}
5656
});
5757
}
58+
59+
@Override
60+
protected void onDestroy() {
61+
super.onDestroy();
62+
63+
BigImageViewer.imageLoader().cancelAll();
64+
}
5865
}

app/src/main/java/com/github/piasy/biv/example/GlideLoaderActivity.java

+2
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,7 @@ protected void onDestroy() {
6565
App.fixLeakCanary696(getApplicationContext());
6666
long end = System.nanoTime();
6767
Log.w(App.TAG, "fixLeakCanary696: " + (end - start));
68+
69+
BigImageViewer.imageLoader().cancelAll();
6870
}
6971
}

app/src/main/java/com/github/piasy/biv/example/ImageLoaderCallbackActivity.java

+7
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,11 @@ public void onFail(Exception e) {
126126
}
127127
});
128128
}
129+
130+
@Override
131+
protected void onDestroy() {
132+
super.onDestroy();
133+
134+
BigImageViewer.imageLoader().cancelAll();
135+
}
129136
}

app/src/main/java/com/github/piasy/biv/example/ImageTypesActivity.java

+7
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ public void onClick(final View v) {
144144
});
145145
}
146146

147+
@Override
148+
protected void onDestroy() {
149+
super.onDestroy();
150+
151+
BigImageViewer.imageLoader().cancelAll();
152+
}
153+
147154
private <T> ArrayAdapter getArrayAdapter(final List<T> list) {
148155
ArrayAdapter<T> spinnerAdapter = new ArrayAdapter<>(this,
149156
android.R.layout.simple_spinner_item, list);

app/src/main/java/com/github/piasy/biv/example/LongImageActivity.java

+2
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ protected void onDestroy() {
124124

125125
disposePermissionRequest();
126126
disposeQrCodeDecode();
127+
128+
BigImageViewer.imageLoader().cancelAll();
127129
}
128130

129131
private void decodeQrCode() {

app/src/main/java/com/github/piasy/biv/example/RecyclerViewActivity.java

+7
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
2525
configRecycler();
2626
}
2727

28+
@Override
29+
protected void onDestroy() {
30+
super.onDestroy();
31+
32+
BigImageViewer.imageLoader().cancelAll();
33+
}
34+
2835
private void configRecycler() {
2936
final List<String> imageUrlsList = new ArrayList<>();
3037

app/src/main/java/com/github/piasy/biv/example/ScaleTypeActivity.java

+7
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ public void onClick(View v) {
6868
});
6969
}
7070

71+
@Override
72+
protected void onDestroy() {
73+
super.onDestroy();
74+
75+
BigImageViewer.imageLoader().cancelAll();
76+
}
77+
7178
private void setScaleType() {
7279
String scaleType = (String) mScaleType.getSelectedItem();
7380
if (TextUtils.equals(scaleType, getString(R.string.scale_center_crop))) {

build.gradle

+8-8
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ buildscript {
3333
}
3434
}
3535
dependencies {
36-
classpath 'com.android.tools.build:gradle:3.2.0'
36+
classpath 'com.android.tools.build:gradle:3.4.0'
3737

38-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
39-
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
38+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
39+
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
4040

4141
// ./gradlew dependencyUpdates
4242
classpath 'com.github.ben-manes:gradle-versions-plugin:0.20.0'
@@ -75,16 +75,16 @@ ext {
7575
'usage and full featured image loading choices. Powered by Subsampling Scale ' +
7676
'Image View, Fresco, Glide, and Picasso.'
7777
artifactLabels = ['big', 'image', 'viewer', 'Fresco', 'Glide', 'Picasso']
78-
releaseVersionCode = 33
79-
releaseVersionName = '1.5.6'
78+
releaseVersionCode = 34
79+
releaseVersionName = '1.5.7'
8080

8181
androidCompileSdkVersion = 28
82-
androidBuildToolsVersion = '28.0.2'
82+
androidBuildToolsVersion = '28.0.3'
8383
androidXVersion = '1.0.0'
8484
minSdkVersion = 14
8585
targetSdkVersion = 28
8686

87-
frescoVersion = '1.11.0'
88-
glideVersion = '4.8.0'
87+
frescoVersion = '1.13.0'
88+
glideVersion = '4.9.0'
8989
ssivVersion = '3.10.0'
9090
}

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2-all.zip

0 commit comments

Comments
 (0)