Skip to content

Commit f213c60

Browse files
author
Blankj
committed
see 03/21 log
1 parent 4d22bf6 commit f213c60

File tree

11 files changed

+44
-8
lines changed

11 files changed

+44
-8
lines changed

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.13.4-brightgreen.svg
44+
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.13.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 ptoject helps you a lot, and you would like to support this ptoject's fu
4141

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

44-
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.13.4-brightgreen.svg
44+
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.13.5-brightgreen.svg
4545
[auc]: https://github.com/Blankj/AndroidUtilCode
4646

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

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ dependencies {
5656
// LeakCanary
5757
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakcanary_version"
5858
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary_version"
59-
// implementation 'com.blankj:utilcode:1.13.4'
59+
// implementation 'com.blankj:utilcode:1.13.5'
6060
}
6161

6262

app/src/main/res_core/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@
133133

134134
<!--Image 相关-->
135135
<string name="image_src">Src</string>
136+
<string name="image_add_color">Add Color</string>
136137
<string name="image_scale">Scale</string>
137138
<string name="image_clip">Clip</string>
138139
<string name="image_skew">Skew</string>

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ ext {
3434
min_sdk_version = 14
3535
target_sdk_version = 26
3636

37-
version_code = 1_013_004
38-
version_name = '1.13.4'// E.g 1.9.72 => 1,009,072
37+
version_code = 1_013_005
38+
version_name = '1.13.5'// E.g 1.9.72 => 1,009,072
3939

4040
// App dependencies
4141
support_version = '26.1.0'

update_log.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* 18/03/20 修复 PermissionUtils 子进程的问题
12
* 18/03/16 新增 gradle 插件来格式化 README
23
* 18/03/14 修复 KeyboardUtils#getContentViewInvisibleHeight,发布 1.13.4 版本
34
* 18/03/10 完善 Utils#installAppSilent 和 DeviceUtils#getMacAddress,发布 1.13.3 版本

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-
compile 'com.blankj:utilcode:1.13.4'
5+
compile 'com.blankj:utilcode:1.13.5'
66
```
77

88

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-
compile 'com.blankj:utilcode:1.13.4'
5+
compile 'com.blankj:utilcode:1.13.5'
66
```
77

88

utilcode/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<activity
66
android:name=".util.PermissionUtils$PermissionActivity"
77
android:configChanges="orientation|keyboardHidden|screenSize"
8+
android:multiprocess="true"
89
android:theme="@style/ActivityTranslucent"
910
android:windowSoftInputMode="stateHidden|stateAlwaysHidden" />
1011
</application>

utilcode/src/main/java/com/blankj/utilcode/util/ImageUtils.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import android.support.annotation.DrawableRes;
3333
import android.support.annotation.FloatRange;
3434
import android.support.annotation.IntRange;
35+
import android.support.annotation.NonNull;
3536
import android.support.v4.content.ContextCompat;
3637
import android.view.View;
3738

@@ -358,6 +359,35 @@ public static Bitmap getBitmap(final FileDescriptor fd,
358359
return BitmapFactory.decodeFileDescriptor(fd, null, options);
359360
}
360361

362+
/**
363+
* Return the bitmap with the specified color.
364+
*
365+
* @param src The source of bitmap.
366+
* @param color The color.
367+
* @return the bitmap with the specified color
368+
*/
369+
public static Bitmap drawColor(@NonNull final Bitmap src, @ColorInt final int color) {
370+
return drawColor(src, color, false);
371+
}
372+
373+
/**
374+
* Return the bitmap with the specified color.
375+
*
376+
* @param src The source of bitmap.
377+
* @param color The color.
378+
* @param recycle True to recycle the source of bitmap, false otherwise.
379+
* @return the bitmap with the specified color
380+
*/
381+
public static Bitmap drawColor(@NonNull final Bitmap src,
382+
@ColorInt final int color,
383+
final boolean recycle) {
384+
if (isEmptyBitmap(src)) return null;
385+
Bitmap ret = recycle ? src : src.copy(src.getConfig(), true);
386+
Canvas canvas = new Canvas(ret);
387+
canvas.drawColor(color, PorterDuff.Mode.DARKEN);
388+
return ret;
389+
}
390+
361391
/**
362392
* Return the scaled bitmap.
363393
*

utilcode/src/main/java/com/blankj/utilcode/util/PermissionUtils.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,10 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
298298
}
299299
if (sInstance.mPermissionsRequest != null) {
300300
int size = sInstance.mPermissionsRequest.size();
301-
if (size <= 0) return;
301+
if (size <= 0) {
302+
finish();
303+
return;
304+
}
302305
requestPermissions(sInstance.mPermissionsRequest.toArray(new String[size]), 1);
303306
}
304307
}

0 commit comments

Comments
 (0)