Skip to content

Commit 9f454f1

Browse files
committed
see 05/25 log
1 parent 495a4ab commit 9f454f1

File tree

15 files changed

+796
-181
lines changed

15 files changed

+796
-181
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.16.0-brightgreen.svg
44+
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.16.1-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.16.0-brightgreen.svg
44+
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.16.1-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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ android {
4747

4848
dependencies {
4949
implementation fileTree(include: ['*.jar'], dir: 'libs')
50-
// implementation project(':utilcode')
50+
implementation project(':utilcode')
5151
implementation project(':subutil')
5252

5353
implementation "com.android.support:appcompat-v7:$support_version"
@@ -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.16.0'
59+
// implementation 'com.blankj:utilcode:1.16.1'
6060
}
6161

6262

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
android:theme="@style/AppTheme">
5454
<activity
5555
android:name=".MainActivity"
56-
android:launchMode="singleTop"
56+
android:screenOrientation="user"
5757
android:windowSoftInputMode="stateHidden|adjustPan">
5858
<intent-filter>
5959
<action android:name="android.intent.action.MAIN" />

app/src/main/java/com/blankj/androidutilcode/feature/core/app/AppActivity.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import com.blankj.utilcode.util.LogUtils;
1717
import com.blankj.utilcode.util.SpanUtils;
1818
import com.blankj.utilcode.util.ToastUtils;
19+
import com.blankj.utilcode.util.Utils;
1920

2021
/**
2122
* <pre>
@@ -42,7 +43,17 @@ public static void start(Context context) {
4243

4344
@Override
4445
public void initData(@Nullable Bundle bundle) {
46+
AppUtils.registerAppStatusChangedListener(this, new Utils.OnAppStatusChangedListener() {
47+
@Override
48+
public void onForeground() {
49+
ToastUtils.showShort("foreground");
50+
}
4551

52+
@Override
53+
public void onBackground() {
54+
ToastUtils.showShort("background");
55+
}
56+
});
4657
}
4758

4859
@Override
@@ -147,4 +158,10 @@ public void onPermissionGranted() {
147158
break;
148159
}
149160
}
161+
162+
@Override
163+
protected void onDestroy() {
164+
AppUtils.unregisterAppStatusChangedListener(this);
165+
super.onDestroy();
166+
}
150167
}

app/src/main/java/com/blankj/androidutilcode/feature/core/permission/PermissionActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void onWidgetClick(View view) {
8282
PermissionUtils.launchAppDetailsSettings();
8383
break;
8484
case R.id.btn_request_calendar:
85-
PermissionUtils.permission(PermissionConstants.CALENDAR)
85+
PermissionUtils.permission(PermissionConstants.PHONE, PermissionConstants.STORAGE)
8686
.rationale(new PermissionUtils.OnRationaleListener() {
8787
@Override
8888
public void rationale(final ShouldRequest shouldRequest) {

app/src/main/res/values/styles.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<item name="android:textAllCaps">false</item>
2525
</style>
2626

27-
<style name="AnimationActivity" parent="@android:style/Animation.Activity">
27+
<style name="AnimationActivity" parent="@android:style/Animation.Translucent">
2828
<item name="android:activityOpenEnterAnimation">@anim/slide_in_left</item>
2929
<item name="android:activityOpenExitAnimation">@anim/slide_out_left</item>
3030
<item name="android:activityCloseEnterAnimation">@anim/slide_in_right</item>

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ ext {
4444
min_sdk_version = 14
4545
target_sdk_version = 27
4646

47-
version_code = 1_016_000
48-
version_name = '1.16.0'// E.g 1.9.72 => 1,009,072
47+
version_code = 1_016_001
48+
version_name = '1.16.1'// E.g 1.9.72 => 1,009,072
4949

5050
// App dependencies
5151
support_version = '27.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/05/25 新增 AppUtils#registerAppStatusChangedListener 和 AppUtils#unregisterAppStatusChangedListener,发布 1.16.1 版本
12
* 18/05/22 新增 ThreadUtils,发布 1.16.0 版本
23
* 18/05/15 新增 MetaDataUtils 和 ActivityUtils#startActivityForResult,发布 1.15.1 版本
34
* 18/05/08 新增 ResourceUtils,发布 1.15.0 版本

utilcode/README-CN.md

Lines changed: 5 additions & 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.16.0'
5+
implementation 'com.blankj:utilcode:1.16.1'
66
```
77

88

@@ -624,6 +624,7 @@ toSBC : 转化为全角字符
624624
isMainThread : 判断当前是否主线程
625625
getFixedPool : 获取固定线程池
626626
getSinglePool : 获取单线程池
627+
getCachedPool : 获取缓冲线程池
627628
getIoPool : 获取 IO 线程池
628629
getCpuPool : 获取 CPU 线程池
629630
executeByFixed : 在固定线程池执行任务
@@ -632,6 +633,9 @@ executeByFixedAtFixRate : 在固定线程池按固定频率执行任务
632633
executeBySingle : 在单线程池执行任务
633634
executeBySingleWithDelay: 在单线程池延时执行任务
634635
executeBySingleAtFixRate: 在单线程池按固定频率执行任务
636+
executeByCached : 在缓冲线程池执行任务
637+
executeByCachedWithDelay: 在缓冲线程池延时执行任务
638+
executeByCachedAtFixRate: 在缓冲线程池按固定频率执行任务
635639
executeByIo : 在 IO 线程池执行任务
636640
executeByIoWithDelay : 在 IO 线程池延时执行任务
637641
executeByIoAtFixRate : 在 IO 线程池按固定频率执行任务

utilcode/README.md

Lines changed: 5 additions & 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.16.0'
5+
implementation 'com.blankj:utilcode:1.16.1'
66
```
77

88

@@ -624,6 +624,7 @@ toSBC
624624
isMainThread
625625
getFixedPool
626626
getSinglePool
627+
getCachedPool
627628
getIoPool
628629
getCpuPool
629630
executeByFixed
@@ -632,6 +633,9 @@ executeByFixedAtFixRate
632633
executeBySingle
633634
executeBySingleWithDelay
634635
executeBySingleAtFixRate
636+
executeByCached
637+
executeByCachedWithDelay
638+
executeByCachedAtFixRate
635639
executeByIo
636640
executeByIoWithDelay
637641
executeByIoAtFixRate

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ public static String getLauncherActivity(@NonNull final String pkg) {
10481048
* @return the top activity in activity's stack
10491049
*/
10501050
public static Activity getTopActivity() {
1051-
return Utils.getTopActivity();
1051+
return Utils.getActivityLifecycle().getTopActivity();
10521052
}
10531053

10541054
/**

0 commit comments

Comments
 (0)