Skip to content

Commit

Permalink
Merge branch '1.25.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
Blankj committed Aug 25, 2019
2 parents 4a3c080 + bfc0a67 commit 7bc1ec6
Show file tree
Hide file tree
Showing 33 changed files with 259 additions and 143 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* `19/08/25` [upd] ImageUtils#getImageType. [add] LogUtils# Publish v1.25.9.
* `19/08/24` [fix] PhoneUtils#getIMEI crash on SDK 29.
* `19/08/23` [add] ViewUtils#isLayoutRtl.
* `19/08/22` [add] LogUtils#getLogFiles.
* `19/08/13` [add] MapUtils and MapUtilsTest. Publish v1.25.8.
* `19/08/12` [add] CollectionUtils and CollectionUtilsTest.
* `19/08/11` [add] ArrayUtils and ArrayUtilsTest.
Expand Down
2 changes: 1 addition & 1 deletion README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

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

[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.25.8-brightgreen.svg
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.25.9-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 @@ -51,7 +51,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.8-brightgreen.svg
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.25.9-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 buildSrc/src/main/groovy/Config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class Config {
static compileSdkVersion = 28
static minSdkVersion = 14
static targetSdkVersion = 28
static versionCode = 1_025_008
static versionName = '1.25.8-alpha1'// E.g. 1.9.72 => 1,009,072
static versionCode = 1_025_009
static versionName = '1.25.9'// E.g. 1.9.72 => 1,009,072

// lib version
static kotlin_version = '1.3.10'
Expand Down
77 changes: 32 additions & 45 deletions buildSrc/src/main/groovy/GitUtils.groovy
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import org.gradle.api.Action
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.invocation.Gradle

import java.text.SimpleDateFormat
Expand Down Expand Up @@ -34,55 +33,43 @@ class GitUtils {
}

static void addGitPushTask(Project project) {
project.task("gitPush", new Action<Task>() {
@Override
void execute(Task task) {
task.doLast {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd")
String date = simpleDateFormat.format(new Date())
GLog.d(ShellUtils.execCmd([
"git add -A",
"git commit -m \"see $date log\"",
"git push origin $sCurBranchName"
] as String[]))
}
}
})
project.task("gitPush").doLast {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd")
String date = simpleDateFormat.format(new Date())
GLog.d(ShellUtils.execCmd([
"git add -A",
"git commit -m \"see $date log\"",
"git push origin $sCurBranchName"
] as String[]))
}
}

static void addGitPushAndMerge2MasterTask(Project project) {
project.task("gitPushAndMerge2Master", new Action<Task>() {
@Override
void execute(Task task) {
task.doLast {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd")
String date = simpleDateFormat.format(new Date())
GLog.d(ShellUtils.execCmd([
"git add -A",
"git commit -m \"see $date log\"",
"git push origin $sCurBranchName",
"git checkout master",
"git merge $sCurBranchName",
"git push origin master",
"git checkout $sCurBranchName",
] as String[]))
}
}
})
project.task("gitPushAndMerge2Master").doLast {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd")
String date = simpleDateFormat.format(new Date())
GLog.d(ShellUtils.execCmd([
"git add -A",
"git commit -m \"see $date log\"",
"git push origin $sCurBranchName",
"git checkout master",
"git merge $sCurBranchName",
"git push origin master",
"git checkout $sCurBranchName",
] as String[]))
}
}

static void addGitNewBranchTask(Project project) {
project.task("gitNewBranch", new Action<Task>() {
@Override
void execute(Task task) {
task.doLast {
GLog.d(ShellUtils.execCmd([
"git checkout master",
"git checkout -b ${Config.versionName}",
"git push origin ${Config.versionName}:${Config.versionName}",
] as String[]))
}
}
})
project.task("gitNewBranch").doLast {
GLog.d(ShellUtils.execCmd([
"git checkout master",
"git checkout -b ${Config.versionName}",
"git push origin ${Config.versionName}:${Config.versionName}",
] as String[]))
}
}
}
// ./gradlew gitPush
// ./gradlew gitPushAndMerge2Master
// ./gradlew gitNewBranch
12 changes: 0 additions & 12 deletions buildSrc/src/main/groovy/GitUtils.java

This file was deleted.

3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
org.gradle.jvmargs=-Xmx8192m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:-UseGCOverheadLimit -Dfile.encoding=UTF-8
org.gradle.daemon=true
#org.gradle.configureondemand=true
#org.gradle.parallel=true
org.gradle.parallel=true
org.gradle.caching=true

#-Dorg.gradle.debug=true --no-daemon
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
15 changes: 13 additions & 2 deletions lib/utilcode/README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

Gradle:
```groovy
implementation 'com.blankj:utilcode:1.25.8'
implementation 'com.blankj:utilcode:1.25.9'
// if u use AndroidX, use the following
implementation 'com.blankj:utilcodex:1.25.8'
implementation 'com.blankj:utilcodex:1.25.9'
```


Expand Down Expand Up @@ -1069,6 +1069,15 @@ vibrate: 震动
cancel : 取消
```

* ### 视图相关 -> [ViewUtils.java][view.java]
```
setViewEnabled : 设置视图是否可用
runOnUiThread : 在 UI 线程运行
runOnUiThreadDelayed: 在 UI 线程延迟运行
isLayoutRtl : 布局是否从右到左
fixScrollViewTopping: 修复 ScrollView 置顶问题
```

* ### 压缩相关 -> [ZipUtils.java][zip.java] -> [Test][zip.test]
```
zipFiles : 批量压缩文件
Expand Down Expand Up @@ -1269,5 +1278,7 @@ getComments : 获取压缩文件中的注释链表
[vibrate.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/lib/utilcode/src/main/java/com/blankj/utilcode/util/VibrateUtils.java
[vibrate.demo]: https://github.com/Blankj/AndroidUtilCode/blob/master/feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/vibrate/VibrateActivity.kt

[view.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/lib/utilcode/src/main/java/com/blankj/utilcode/util/ViewUtils.java

[zip.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/lib/utilcode/src/main/java/com/blankj/utilcode/util/ZipUtils.java
[zip.test]: https://github.com/Blankj/AndroidUtilCode/blob/master/lib/utilcode/src/test/java/com/blankj/utilcode/util/ZipUtilsTest.java
15 changes: 13 additions & 2 deletions lib/utilcode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

Gradle:
```groovy
implementation 'com.blankj:utilcode:1.25.8'
implementation 'com.blankj:utilcode:1.25.9'
// if u use AndroidX, use the following
implementation 'com.blankj:utilcodex:1.25.8'
implementation 'com.blankj:utilcodex:1.25.9'
```


Expand Down Expand Up @@ -1069,6 +1069,15 @@ vibrate
cancel
```

* ### About View -> [ViewUtils.java][view.java]
```
setViewEnabled
runOnUiThread
runOnUiThreadDelayed
isLayoutRtl
fixScrollViewTopping
```

* ### About Zip -> [ZipUtils.java][zip.java] -> [Test][zip.test]
```
zipFiles
Expand Down Expand Up @@ -1266,5 +1275,7 @@ getComments
[vibrate.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/lib/utilcode/src/main/java/com/blankj/utilcode/util/VibrateUtils.java
[vibrate.demo]: https://github.com/Blankj/AndroidUtilCode/blob/master/feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/vibrate/VibrateActivity.kt

[view.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/lib/utilcode/src/main/java/com/blankj/utilcode/util/ViewUtils.java

[zip.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/lib/utilcode/src/main/java/com/blankj/utilcode/util/ZipUtils.java
[zip.test]: https://github.com/Blankj/AndroidUtilCode/blob/master/lib/utilcode/src/test/java/com/blankj/utilcode/util/ZipUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public final class PermissionConstants {
permission.RECEIVE_WAP_PUSH, permission.RECEIVE_MMS,
};
private static final String[] GROUP_STORAGE = {
permission.READ_EXTERNAL_STORAGE, permission.WRITE_EXTERNAL_STORAGE
permission.READ_EXTERNAL_STORAGE, permission.WRITE_EXTERNAL_STORAGE,
};

@StringDef({CALENDAR, CAMERA, CONTACTS, LOCATION, MICROPHONE, PHONE, SENSORS, SMS, STORAGE,})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ private static boolean isSpace(final String s) {
return true;
}

private static final char HEX_DIGITS[] =
private static final char[] HEX_DIGITS =
{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};

private static byte[] hashTemplate(final byte[] data, final String algorithm) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private ConvertUtils() {
throw new UnsupportedOperationException("u can't instantiate me...");
}

private static final char hexDigits[] =
private static final char[] hexDigits =
{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};

/**
Expand Down Expand Up @@ -581,7 +581,7 @@ public static Bitmap view2Bitmap(final View view) {
* @return value of px
*/
public static int dp2px(final float dpValue) {
final float scale = Resources.getSystem().getDisplayMetrics().density;
final float scale = Utils.getApp().getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
}

Expand All @@ -592,7 +592,7 @@ public static int dp2px(final float dpValue) {
* @return value of dp
*/
public static int px2dp(final float pxValue) {
final float scale = Resources.getSystem().getDisplayMetrics().density;
final float scale = Utils.getApp().getResources().getDisplayMetrics().density;
return (int) (pxValue / scale + 0.5f);
}

Expand All @@ -603,7 +603,7 @@ public static int px2dp(final float pxValue) {
* @return value of px
*/
public static int sp2px(final float spValue) {
final float fontScale = Resources.getSystem().getDisplayMetrics().scaledDensity;
final float fontScale = Utils.getApp().getResources().getDisplayMetrics().scaledDensity;
return (int) (spValue * fontScale + 0.5f);
}

Expand All @@ -614,7 +614,7 @@ public static int sp2px(final float spValue) {
* @return value of sp
*/
public static int px2sp(final float pxValue) {
final float fontScale = Resources.getSystem().getDisplayMetrics().scaledDensity;
final float fontScale = Utils.getApp().getResources().getDisplayMetrics().scaledDensity;
return (int) (pxValue / fontScale + 0.5f);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public final class CrashUtils {

private static final String FILE_SEP = System.getProperty("file.separator");
@SuppressLint("SimpleDateFormat")
private static final Format FORMAT = new SimpleDateFormat("MM-dd HH-mm-ss");
private static final Format FORMAT = new SimpleDateFormat("MM-dd_HH-mm-ss");

private static final UncaughtExceptionHandler DEFAULT_UNCAUGHT_EXCEPTION_HANDLER;
private static final UncaughtExceptionHandler UNCAUGHT_EXCEPTION_HANDLER;
Expand Down
Loading

0 comments on commit 7bc1ec6

Please sign in to comment.