diff --git a/README-CN.md b/README-CN.md
index b31ecd7661f149f0399b1ad9d362e152dd72dba4..b7830c5f94074eac450fc27fc4bfb245277ae3da 100644
--- a/README-CN.md
+++ b/README-CN.md
@@ -41,7 +41,7 @@
[logo]: https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/logo.png
-[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.13.4-brightgreen.svg
+[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.13.5-brightgreen.svg
[auc]: https://github.com/Blankj/AndroidUtilCode
[apisvg]: https://img.shields.io/badge/API-14+-brightgreen.svg
diff --git a/README.md b/README.md
index 273ec711eb4a79f02c28b0ae55c8303958d17ea9..16fcc7187814db5fbffb6802fcfcc8252ab45b54 100644
--- a/README.md
+++ b/README.md
@@ -41,7 +41,7 @@ If this ptoject helps you a lot, and you would like to support this ptoject's fu
[logo]: https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/logo.png
-[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.13.4-brightgreen.svg
+[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.13.5-brightgreen.svg
[auc]: https://github.com/Blankj/AndroidUtilCode
[apisvg]: https://img.shields.io/badge/API-14+-brightgreen.svg
diff --git a/app/build.gradle b/app/build.gradle
index 4f64cfb4d03149f0133b3f51446c16d394689731..c0176560e871b77f7a476d6b4b447380fdc71ee9 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -56,7 +56,7 @@ dependencies {
// LeakCanary
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakcanary_version"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary_version"
-// implementation 'com.blankj:utilcode:1.13.4'
+// implementation 'com.blankj:utilcode:1.13.5'
}
diff --git a/app/src/main/res_core/values/strings.xml b/app/src/main/res_core/values/strings.xml
index b91c37f513e71d06833df14102eb3d779bb4005c..a02fcc9c65fa4c00d86e45b2a7c8a260fa9dda6d 100644
--- a/app/src/main/res_core/values/strings.xml
+++ b/app/src/main/res_core/values/strings.xml
@@ -133,6 +133,7 @@
Src
+ Add Color
Scale
Clip
Skew
diff --git a/build.gradle b/build.gradle
index 2ec8e312c6666fa58687f87518248180ec0f67c7..4569fdf5f4d8b8c40ac5a2e7fb89131594c1ae91 100644
--- a/build.gradle
+++ b/build.gradle
@@ -34,8 +34,8 @@ ext {
min_sdk_version = 14
target_sdk_version = 26
- version_code = 1_013_004
- version_name = '1.13.4'// E.g 1.9.72 => 1,009,072
+ version_code = 1_013_005
+ version_name = '1.13.5'// E.g 1.9.72 => 1,009,072
// App dependencies
support_version = '26.1.0'
diff --git a/update_log.md b/update_log.md
index 041ba638a95d2cee7087a2c5244a373fed83edbb..5b2f60165dbcaa69eb9224fef3c3024c5e797396 100644
--- a/update_log.md
+++ b/update_log.md
@@ -1,3 +1,4 @@
+* 18/03/20 修复 PermissionUtils 子进程的问题
* 18/03/16 新增 gradle 插件来格式化 README
* 18/03/14 修复 KeyboardUtils#getContentViewInvisibleHeight,发布 1.13.4 版本
* 18/03/10 完善 Utils#installAppSilent 和 DeviceUtils#getMacAddress,发布 1.13.3 版本
diff --git a/utilcode/README-CN.md b/utilcode/README-CN.md
index 0e564668a6fef3ca86f4f49191aa72d9042fab04..8987879b2728da058581b3c99e9842dad7df3240 100644
--- a/utilcode/README-CN.md
+++ b/utilcode/README-CN.md
@@ -2,7 +2,7 @@
Gradle:
```groovy
-compile 'com.blankj:utilcode:1.13.4'
+compile 'com.blankj:utilcode:1.13.5'
```
diff --git a/utilcode/README.md b/utilcode/README.md
index e02e3588d5b2d91bba6d23e9f57e2d1b379495e8..ac07d8d4a360d0f569b87dfff1c3ca2b62fb17a9 100644
--- a/utilcode/README.md
+++ b/utilcode/README.md
@@ -2,7 +2,7 @@
Gradle:
```groovy
-compile 'com.blankj:utilcode:1.13.4'
+compile 'com.blankj:utilcode:1.13.5'
```
diff --git a/utilcode/src/main/AndroidManifest.xml b/utilcode/src/main/AndroidManifest.xml
index 8eacc3472b1f4b99528c0474569d8dc0b22abb9c..dada788fa4c3d551b7dbb2df146a1729397e7d40 100644
--- a/utilcode/src/main/AndroidManifest.xml
+++ b/utilcode/src/main/AndroidManifest.xml
@@ -5,6 +5,7 @@
diff --git a/utilcode/src/main/java/com/blankj/utilcode/util/ImageUtils.java b/utilcode/src/main/java/com/blankj/utilcode/util/ImageUtils.java
index 3c24c63effc6fd8046e944b1654f919c5ad89c62..ded23770eeb29bc88161e9ea3bddb82dc500b4ad 100644
--- a/utilcode/src/main/java/com/blankj/utilcode/util/ImageUtils.java
+++ b/utilcode/src/main/java/com/blankj/utilcode/util/ImageUtils.java
@@ -32,6 +32,7 @@ import android.support.annotation.ColorInt;
import android.support.annotation.DrawableRes;
import android.support.annotation.FloatRange;
import android.support.annotation.IntRange;
+import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.view.View;
@@ -358,6 +359,35 @@ public final class ImageUtils {
return BitmapFactory.decodeFileDescriptor(fd, null, options);
}
+ /**
+ * Return the bitmap with the specified color.
+ *
+ * @param src The source of bitmap.
+ * @param color The color.
+ * @return the bitmap with the specified color
+ */
+ public static Bitmap drawColor(@NonNull final Bitmap src, @ColorInt final int color) {
+ return drawColor(src, color, false);
+ }
+
+ /**
+ * Return the bitmap with the specified color.
+ *
+ * @param src The source of bitmap.
+ * @param color The color.
+ * @param recycle True to recycle the source of bitmap, false otherwise.
+ * @return the bitmap with the specified color
+ */
+ public static Bitmap drawColor(@NonNull final Bitmap src,
+ @ColorInt final int color,
+ final boolean recycle) {
+ if (isEmptyBitmap(src)) return null;
+ Bitmap ret = recycle ? src : src.copy(src.getConfig(), true);
+ Canvas canvas = new Canvas(ret);
+ canvas.drawColor(color, PorterDuff.Mode.DARKEN);
+ return ret;
+ }
+
/**
* Return the scaled bitmap.
*
diff --git a/utilcode/src/main/java/com/blankj/utilcode/util/PermissionUtils.java b/utilcode/src/main/java/com/blankj/utilcode/util/PermissionUtils.java
index 7f5c3aa62463946842196088d3442010eca0d206..6f06b45e7457289931f6c91942943d23cdc83c60 100755
--- a/utilcode/src/main/java/com/blankj/utilcode/util/PermissionUtils.java
+++ b/utilcode/src/main/java/com/blankj/utilcode/util/PermissionUtils.java
@@ -298,7 +298,10 @@ public final class PermissionUtils {
}
if (sInstance.mPermissionsRequest != null) {
int size = sInstance.mPermissionsRequest.size();
- if (size <= 0) return;
+ if (size <= 0) {
+ finish();
+ return;
+ }
requestPermissions(sInstance.mPermissionsRequest.toArray(new String[size]), 1);
}
}