Skip to content

Commit ea41f12

Browse files
committed
see 12/19 log
1 parent e6ad00b commit ea41f12

File tree

10 files changed

+85
-27
lines changed

10 files changed

+85
-27
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
* `18/12/19` [fix] ToastUtils multi show crash when run API 25. Publish v1.22.4.
1+
* `18/12/19` [fix] AdaptScreenUtils not work in MIUI on Android 5.1.1. Publish v1.22.5.
2+
* `18/12/18` [fix] ToastUtils multi show crash when run API 25. Publish v1.22.4.
23
* `18/12/18` [fix] ImageUtils recycle ret equals src. Publish v1.22.3.
34
* `18/12/17` [fix] Utils$FileProvider4UtilCode not found. Publish v1.22.3.
45
* `18/12/17` [fix] ToastUtils leak. Publish v1.22.2.

README-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

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

44-
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.22.4-brightgreen.svg
44+
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.22.5-brightgreen.svg
4545
[auc]: https://github.com/Blankj/AndroidUtilCode
4646

4747
[apiSvg]: https://img.shields.io/badge/API-14+-brightgreen.svg

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ If this project helps you a lot and you want to support the project's developmen
4141

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

44-
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.22.4-brightgreen.svg
44+
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.22.5-brightgreen.svg
4545
[auc]: https://github.com/Blankj/AndroidUtilCode
4646

4747
[apiSvg]: https://img.shields.io/badge/API-14+-brightgreen.svg

config.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ ext {
55
compileSdkVersion = 27
66
minSdkVersion = 14
77
targetSdkVersion = 27
8-
versionCode = 1_022_004
9-
versionName = '1.22.4'// E.g. 1.9.72 => 1,009,072
8+
versionCode = 1_022_005
9+
versionName = '1.22.5'// E.g. 1.9.72 => 1,009,072
1010

1111
bus = [
1212
isDebug: false,

lib/base/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ dependencies {
1515
api dep.free_proguard
1616
api 'com.r0adkll:slidableactivity:2.0.5'
1717
compileOnly dep.leakcanary.android_no_op
18-
// api 'com.blankj:utilcode:1.22.4'
18+
// api 'com.blankj:utilcode:1.22.5'
1919
}

utilcode/README-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Gradle:
44
```groovy
5-
implementation 'com.blankj:utilcode:1.22.4'
5+
implementation 'com.blankj:utilcode:1.22.5'
66
```
77

88

utilcode/README-STATIC-BUS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ apply plugin: "com.blankj.bus"
2727
给 base 模块添加 [AndroidUtilCode](https://github.com/Blankj/AndroidUtilCode) 依赖:
2828

2929
```groovy
30-
api "com.blankj:utilcode:1.22.4"
30+
api "com.blankj:utilcode:1.22.5"
3131
```
3232

3333
比如 module0 中存在的 `Module0Activity.java`,我们通常都是在它内部写一个 `start` 函数来启动它,现在我们给它添加 `@BusUtils.Subscribe` 注解,并给注解的 `name` 赋唯一值,要注意,函数务必要 `public static` 哦:

utilcode/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Gradle:
44
```groovy
5-
implementation 'com.blankj:utilcode:1.22.4'
5+
implementation 'com.blankj:utilcode:1.22.5'
66
```
77

88

utilcode/lib/src/main/java/com/blankj/utilcode/util/AdaptScreenUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
public final class AdaptScreenUtils {
1111

12-
private static boolean firstFlag = true;
12+
private static boolean isInitMiui = false;
1313
private static Field mTmpMetrics;
1414

1515
private static DisplayMetrics appDm;
@@ -81,7 +81,7 @@ private static DisplayMetrics getDisplayMetrics(Resources resources) {
8181
}
8282

8383
private static DisplayMetrics getMiuiTmpMetrics(Resources resources) {
84-
if (firstFlag) {
84+
if (!isInitMiui) {
8585
DisplayMetrics ret = null;
8686
String simpleName = resources.getClass().getSimpleName();
8787
if ("MiuiResources".equals(simpleName) || "XResources".equals(simpleName)) {
@@ -93,7 +93,7 @@ private static DisplayMetrics getMiuiTmpMetrics(Resources resources) {
9393
Log.e("AdaptScreenUtils", "no field of mTmpMetrics in resources.");
9494
}
9595
}
96-
firstFlag = false;
96+
isInitMiui = true;
9797
return ret;
9898
}
9999
if (mTmpMetrics == null) return null;

utilcode/lib/src/main/java/com/blankj/utilcode/util/BusUtils.java

Lines changed: 72 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
import java.lang.annotation.Retention;
88
import java.lang.annotation.RetentionPolicy;
99
import java.lang.annotation.Target;
10-
import java.util.Map;
11-
import java.util.concurrent.ConcurrentHashMap;
1210

1311
/**
1412
* <pre>
@@ -22,8 +20,7 @@
2220
*/
2321
public final class BusUtils {
2422

25-
private static final Object NULL = new Object();
26-
private static final Map<Object, String> BUSES = new ConcurrentHashMap<>();
23+
private static final Object NULL = new Object();
2724

2825
public static <T> T post(final String name, final Object... objects) {
2926
if (name == null || name.length() == 0) return null;
@@ -35,17 +32,6 @@ public static <T> T post(final String name, final Object... objects) {
3532
return (T) o;
3633
}
3734

38-
39-
public static void register(final Object bus) {
40-
41-
}
42-
43-
public static void unregister(final Object bus) {
44-
45-
}
46-
47-
48-
4935
private static Object injectShell(final String name, final Object[] objects) {
5036
return NULL;
5137
}
@@ -54,5 +40,76 @@ private static Object injectShell(final String name, final Object[] objects) {
5440
@Retention(RetentionPolicy.CLASS)
5541
public @interface Subscribe {
5642
String name() default "";
43+
44+
int priority() default 0;
5745
}
46+
47+
// private static final Map<String, TreeSet<Bus>> BUSES = new ConcurrentHashMap<>();
48+
49+
// public static void register(final Object bus) {
50+
// Class c = null;
51+
// if (bus.getClass().equals(c)) {
52+
//
53+
// }
54+
// }
55+
56+
// public static void unregister(final Object bus) {
57+
// if (bus == null) return;
58+
// Class busClass = bus.getClass();
59+
// if (BUSES.containsKey(busClass)) {
60+
//
61+
// }
62+
// }
63+
64+
// private static Object inject(final String name, int priority ){
65+
// if (!BUSES.containsKey(name)) return NULL;
66+
// TreeSet<Bus> buses = BUSES.get(name);
67+
// for (Bus bus : buses) {
68+
// bus.
69+
// }
70+
// return NULL;
71+
// }
72+
73+
// static class Bus implements Comparable<Bus> {
74+
//
75+
// TreeMap<Object, Integer> mTreeMap;
76+
//
77+
// Bus(Object object) {
78+
// this(object, 0);
79+
// }
80+
//
81+
// Bus(Object object, int priority) {
82+
// mTreeMap = new TreeMap<>();
83+
// this.priority = priority;
84+
// }
85+
//
86+
// @Override
87+
// public int compareTo(@NonNull Bus o) {
88+
// return (this.priority < o.priority) ? 1 : ((this.priority == o.priority) ? 0 : -1);
89+
// }
90+
//
91+
// @Override
92+
// public boolean equals(Object obj) {
93+
// return ObjectUtils.equals(this, obj);
94+
// }
95+
//
96+
// @Override
97+
// public String toString() {
98+
// return mObject.toString() + ": " + priority;
99+
// }
100+
// }
101+
//
102+
// public static void main(String[] args) {
103+
// TreeSet<Bus> queue = new TreeSet<>();
104+
// Bus bus0 = new Bus("", 1);
105+
// Bus bus1 = new Bus("", 2);
106+
// Bus bus2 = new Bus("", 3);
107+
// Bus bus3 = new Bus("", 3);
108+
// queue.add(bus1);
109+
// queue.add(bus2);
110+
// queue.add(bus0);
111+
//
112+
// System.out.println(queue);
113+
//
114+
// }
58115
}

0 commit comments

Comments
 (0)