Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mmm-rain
AndroidUtilCode
提交
e5144fa4
A
AndroidUtilCode
项目概览
mmm-rain
/
AndroidUtilCode
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
AndroidUtilCode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e5144fa4
编写于
7月 23, 2019
作者:
B
Blankj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
see 07/23 log
上级
7f247e7e
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
41 addition
and
19 deletion
+41
-19
CHANGELOG.md
CHANGELOG.md
+2
-1
README-CN.md
README-CN.md
+1
-1
README.md
README.md
+1
-1
buildSrc/src/main/groovy/Config.groovy
buildSrc/src/main/groovy/Config.groovy
+2
-2
lib/utilcode/README-CN.md
lib/utilcode/README-CN.md
+2
-2
lib/utilcode/README.md
lib/utilcode/README.md
+2
-2
lib/utilcode/src/main/java/com/blankj/utilcode/util/ThreadUtils.java
...e/src/main/java/com/blankj/utilcode/util/ThreadUtils.java
+7
-7
lib/utilcode/src/test/java/com/blankj/utilcode/util/BaseTest.java
...code/src/test/java/com/blankj/utilcode/util/BaseTest.java
+22
-1
plugin/api-gradle-plugin/README.md
plugin/api-gradle-plugin/README.md
+1
-1
plugin/bus-gradle-plugin/README.md
plugin/bus-gradle-plugin/README.md
+1
-1
未找到文件。
CHANGELOG.md
浏览文件 @
e5144fa4
*
`19/07/23`
[fix] ThreadUtils of cache pool. Publish v1.25.1.
*
`19/07/18`
[add] README of ApiUtils and BusUtils.
*
`19/07/15`
[add] Publish v1.25.0.
*
`19/07/14`
[upd] Bus plugin for use BusUtils. Publish bus plugin v2.0.
...
...
@@ -5,7 +6,7 @@
*
`19/07/09`
[upd] The frame of project.
*
`19/07/06`
[upd] BusUtils which behave same as EventBus.
*
`19/07/03`
[add] ApiUtils which decoupling modules.
*
`19/06/30`
[add] LanguageUtils support activity's class name.
Publish v1.25.0.
*
`19/06/30`
[add] LanguageUtils support activity's class name.
*
`19/06/29`
[add] ClickUtils#OnMultiClickListener, and remove dangerous function. Publish v1.24.6.
*
`19/06/28`
[add] LanguageUtils. Publish v1.24.5.
*
`19/06/20`
[fix] BusUtils' permission. Publish v1.24.4.
...
...
README-CN.md
浏览文件 @
e5144fa4
...
...
@@ -45,7 +45,7 @@
[
frame
]:
https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/auc_frame.png
[
aucSvg
]:
https://img.shields.io/badge/AndroidUtilCode-v1.25.
0
-brightgreen.svg
[
aucSvg
]:
https://img.shields.io/badge/AndroidUtilCode-v1.25.
1
-brightgreen.svg
[
auc
]:
https://github.com/Blankj/AndroidUtilCode
[
apiSvg
]:
https://img.shields.io/badge/API-14+-brightgreen.svg
...
...
README.md
浏览文件 @
e5144fa4
...
...
@@ -45,7 +45,7 @@ If this project helps you a lot and you want to support the project's developmen
[
frame
]:
https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/auc_frame.png
[
aucSvg
]:
https://img.shields.io/badge/AndroidUtilCode-v1.25.
0
-brightgreen.svg
[
aucSvg
]:
https://img.shields.io/badge/AndroidUtilCode-v1.25.
1
-brightgreen.svg
[
auc
]:
https://github.com/Blankj/AndroidUtilCode
[
apiSvg
]:
https://img.shields.io/badge/API-14+-brightgreen.svg
...
...
buildSrc/src/main/groovy/Config.groovy
浏览文件 @
e5144fa4
...
...
@@ -14,8 +14,8 @@ class Config {
static
compileSdkVersion
=
27
static
minSdkVersion
=
14
static
targetSdkVersion
=
27
static
versionCode
=
1
_025_00
0
static
versionName
=
'1.25.
0
'
// E.g. 1.9.72 => 1,009,072
static
versionCode
=
1
_025_00
1
static
versionName
=
'1.25.
1
'
// E.g. 1.9.72 => 1,009,072
// lib version
static
kotlin_version
=
'1.3.10'
...
...
lib/utilcode/README-CN.md
浏览文件 @
e5144fa4
...
...
@@ -2,10 +2,10 @@
Gradle:
```
groovy
implementation
'com.blankj:utilcode:1.25.
0
'
implementation
'com.blankj:utilcode:1.25.
1
'
// if u use AndroidX, use the following
implementation
'com.blankj:utilcodex:1.25.
0
'
implementation
'com.blankj:utilcodex:1.25.
1
'
```
...
...
lib/utilcode/README.md
浏览文件 @
e5144fa4
...
...
@@ -2,10 +2,10 @@
Gradle:
```
groovy
implementation
'com.blankj:utilcode:1.25.
0
'
implementation
'com.blankj:utilcode:1.25.
1
'
// if u use AndroidX, use the following
implementation
'com.blankj:utilcodex:1.25.
0
'
implementation
'com.blankj:utilcodex:1.25.
1
'
```
...
...
lib/utilcode/src/main/java/com/blankj/utilcode/util/ThreadUtils.java
浏览文件 @
e5144fa4
...
...
@@ -976,17 +976,17 @@ public final class ThreadUtils {
case
TYPE_CACHED:
return
new
ThreadPoolExecutor4Util
(
0
,
128
,
60L
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue4Util
(),
new
LinkedBlockingQueue4Util
(
true
),
new
UtilsThreadFactory
(
"cached"
,
priority
)
);
case
TYPE_IO:
return
new
ThreadPoolExecutor4Util
(
0
,
2
*
CPU_COUNT
+
1
,
return
new
ThreadPoolExecutor4Util
(
2
*
CPU_COUNT
+
1
,
2
*
CPU_COUNT
+
1
,
30
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue4Util
(),
new
UtilsThreadFactory
(
"io"
,
priority
)
);
case
TYPE_CPU:
return
new
ThreadPoolExecutor4Util
(
CPU_COUNT
+
1
,
2
*
CPU_COUNT
+
1
,
return
new
ThreadPoolExecutor4Util
(
CPU_COUNT
+
1
,
CPU_COUNT
+
1
,
30
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue4Util
(),
new
UtilsThreadFactory
(
"cpu"
,
priority
)
...
...
@@ -1046,20 +1046,20 @@ public final class ThreadUtils {
private
volatile
ThreadPoolExecutor4Util
mPool
;
private
int
mCapacity
=
Integer
.
MAX_VALUE
;
private
boolean
mIsAddSubThreadFirstThenAddQueue
=
false
;
LinkedBlockingQueue4Util
()
{
super
();
}
LinkedBlockingQueue4Util
(
int
capacity
)
{
LinkedBlockingQueue4Util
(
boolean
isAddSubThreadFirstThenAddQueue
)
{
super
();
m
Capacity
=
capacity
;
m
IsAddSubThreadFirstThenAddQueue
=
isAddSubThreadFirstThenAddQueue
;
}
@Override
public
boolean
offer
(
@NonNull
Runnable
runnable
)
{
if
(
m
Capacity
<=
size
()
&&
if
(
m
IsAddSubThreadFirstThenAddQueue
&&
mPool
!=
null
&&
mPool
.
getPoolSize
()
<
mPool
.
getMaximumPoolSize
())
{
// create a non-core thread
return
false
;
...
...
lib/utilcode/src/test/java/com/blankj/utilcode/util/BaseTest.java
浏览文件 @
e5144fa4
...
...
@@ -10,7 +10,9 @@ import org.robolectric.RuntimeEnvironment;
import
org.robolectric.annotation.Config
;
import
org.robolectric.shadows.ShadowLog
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.TimeUnit
;
/**
* <pre>
...
...
@@ -37,6 +39,25 @@ public class BaseTest {
@Test
public
void
test
()
throws
Exception
{
CountDownLatch
latch
=
new
CountDownLatch
(
1
);
for
(
int
i
=
0
;
i
<
100
;
i
++)
{
final
int
finalI
=
i
;
ThreadUtils
.
executeByCpu
(
new
ThreadUtils
.
SimpleTask
<
Void
>()
{
@Override
public
Void
doInBackground
()
throws
Throwable
{
System
.
out
.
println
(
""
+
Thread
.
currentThread
()
+
finalI
);
Thread
.
sleep
(
100
);
return
null
;
}
@Override
public
void
onSuccess
(
Void
result
)
{
}
});
}
latch
.
await
(
1
,
TimeUnit
.
SECONDS
);
}
}
plugin/api-gradle-plugin/README.md
浏览文件 @
e5144fa4
...
...
@@ -42,7 +42,7 @@ apply plugin: "com.blankj.api"
给你的项目添加
**[AndroidUtilCode](https://github.com/Blankj/AndroidUtilCode)**
依赖:
```
groovy
api
"com.blankj:utilcode:
1.25.0
"
api
"com.blankj:utilcode:
latest_version
"
```
如果你单纯只想引入
`ApiUtils`
也是可以的,需要你自己拷贝一份这个类放到你工程里,然后在 app 下的
`build.gradle`
中 配置 api 的 SDL 域如下所示:
...
...
plugin/bus-gradle-plugin/README.md
浏览文件 @
e5144fa4
...
...
@@ -33,7 +33,7 @@ apply plugin: "com.blankj.bus"
给你的项目添加
[
AndroidUtilCode
](
https://github.com/Blankj/AndroidUtilCode
)
依赖:
```
groovy
api
"com.blankj:utilcode:
1.25.0"
api
"
com
.
blankj
:
utilcode:
latest_version
```
如果你单纯只想引入
`BusUtils`
也是可以的,需要你自己拷贝一份这个类放到你工程里,记得还要拷贝
`ThreadUtils`
哦,然后在 app 下的
`build.gradle`
中 配置 bus 的 SDL 域如下所示:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录