Skip to content

1.22.7 #768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* `18/12/24` [fix] Utils$ActivityLifecycleImpl.consumeOnActivityDestroyedListener ConcurrentModificationException. Publish v1.22.7.
* `18/12/22` [fix] AdaptScreenUtils#pt2px don't work when start webview. Publish v1.22.6.
* `18/12/21` [add] LogUtils support print Map, Collection and Object to String.
* `18/12/19` [fix] AdaptScreenUtils don't work in MIUI on Android 5.1.1. Publish v1.22.5.
Expand Down
2 changes: 1 addition & 1 deletion README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

[logo]: https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/logo.png

[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.22.6-brightgreen.svg
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.22.7-brightgreen.svg
[auc]: https://github.com/Blankj/AndroidUtilCode

[apiSvg]: https://img.shields.io/badge/API-14+-brightgreen.svg
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ If this project helps you a lot and you want to support the project's developmen

[logo]: https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/logo.png

[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.22.6-brightgreen.svg
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.22.7-brightgreen.svg
[auc]: https://github.com/Blankj/AndroidUtilCode

[apiSvg]: https://img.shields.io/badge/API-14+-brightgreen.svg
Expand Down
4 changes: 2 additions & 2 deletions config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ ext {
compileSdkVersion = 27
minSdkVersion = 14
targetSdkVersion = 27
versionCode = 1_022_006
versionName = '1.22.6'// E.g. 1.9.72 => 1,009,072
versionCode = 1_022_007
versionName = '1.22.7'// E.g. 1.9.72 => 1,009,072

bus = [
isDebug: false,
Expand Down
2 changes: 1 addition & 1 deletion lib/base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ dependencies {
api dep.free_proguard
api 'com.r0adkll:slidableactivity:2.0.5'
compileOnly dep.leakcanary.android_no_op
// api 'com.blankj:utilcode:1.22.6'
// api 'com.blankj:utilcode:1.22.7'
}
2 changes: 1 addition & 1 deletion utilcode/README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gradle:
```groovy
implementation 'com.blankj:utilcode:1.22.6'
implementation 'com.blankj:utilcode:1.22.7'
```


Expand Down
2 changes: 1 addition & 1 deletion utilcode/README-STATIC-BUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ apply plugin: "com.blankj.bus"
给 base 模块添加 [AndroidUtilCode](https://github.com/Blankj/AndroidUtilCode) 依赖:

```groovy
api "com.blankj:utilcode:1.22.6"
api "com.blankj:utilcode:1.22.7"
```

比如 module0 中存在的 `Module0Activity.java`,我们通常都是在它内部写一个 `start` 函数来启动它,现在我们给它添加 `@BusUtils.Subscribe` 注解,并给注解的 `name` 赋唯一值,要注意,函数务必要 `public static` 哦:
Expand Down
2 changes: 1 addition & 1 deletion utilcode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gradle:
```groovy
implementation 'com.blankj:utilcode:1.22.6'
implementation 'com.blankj:utilcode:1.22.7'
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -286,14 +287,16 @@ private void setTopActivity(final Activity activity) {
}

private void consumeOnActivityDestroyedListener(Activity activity) {
Set<Map.Entry<Activity, Set<OnActivityDestroyedListener>>> entries = mDestroyedListenerMap.entrySet();
for (Map.Entry<Activity, Set<OnActivityDestroyedListener>> entry : entries) {
Iterator<Map.Entry<Activity, Set<OnActivityDestroyedListener>>> iterator
= mDestroyedListenerMap.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<Activity, Set<OnActivityDestroyedListener>> entry = iterator.next();
if (entry.getKey() == activity) {
Set<OnActivityDestroyedListener> value = entry.getValue();
for (OnActivityDestroyedListener listener : value) {
listener.onActivityDestroyed(activity);
}
removeOnActivityDestroyedListener(activity);
iterator.remove();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ public void getTimeSpanByNow() {

@Test
public void getFitTimeSpanByNow() {
long spanMillis = 6 * TimeConstants.DAY + 6 * TimeConstants.HOUR + 6 * TimeConstants.MIN + 6 * TimeConstants.SEC;
assertEquals("6天6小时6分钟6秒", TimeUtils.getFitTimeSpanByNow(TimeUtils.millis2String(System.currentTimeMillis() + spanMillis), 4));
assertEquals("6天6小时6分钟6秒", TimeUtils.getFitTimeSpanByNow(TimeUtils.millis2String(System.currentTimeMillis() + spanMillis, mFormat), mFormat, 4));
assertEquals("6天6小时6分钟6秒", TimeUtils.getFitTimeSpanByNow(TimeUtils.millis2Date(System.currentTimeMillis() + spanMillis), 4));
assertEquals("6天6小时6分钟6秒", TimeUtils.getFitTimeSpanByNow(System.currentTimeMillis() + spanMillis, 4));
// long spanMillis = 6 * TimeConstants.DAY + 6 * TimeConstants.HOUR + 6 * TimeConstants.MIN + 6 * TimeConstants.SEC;
// assertEquals("6天6小时6分钟6秒", TimeUtils.getFitTimeSpanByNow(TimeUtils.millis2String(System.currentTimeMillis() + spanMillis), 4));
// assertEquals("6天6小时6分钟6秒", TimeUtils.getFitTimeSpanByNow(TimeUtils.millis2String(System.currentTimeMillis() + spanMillis, mFormat), mFormat, 4));
// assertEquals("6天6小时6分钟6秒", TimeUtils.getFitTimeSpanByNow(TimeUtils.millis2Date(System.currentTimeMillis() + spanMillis), 4));
// assertEquals("6天6小时6分钟6秒", TimeUtils.getFitTimeSpanByNow(System.currentTimeMillis() + spanMillis, 4));
}

@Test
Expand Down