Skip to content

Commit 205943d

Browse files
committed
see 08/08 log
1 parent a269b5f commit 205943d

File tree

14 files changed

+62
-194
lines changed

14 files changed

+62
-194
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.18.4-brightgreen.svg
44+
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.18.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 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.18.4-brightgreen.svg
44+
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.18.5-brightgreen.svg
4545
[auc]: https://github.com/Blankj/AndroidUtilCode
4646

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

apk/output.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1018004,"versionName":"1.18.4","enabled":true,"outputFile":"util_1_18_4.apk","fullName":"release","baseName":"release"},"path":"util_1_18_4.apk","properties":{}}]
1+
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1018005,"versionName":"1.18.5","enabled":true,"outputFile":"util_1_18_5.apk","fullName":"release","baseName":"release"},"path":"util_1_18_5.apk","properties":{}}]
Binary file not shown.

app/src/main/java/com/blankj/androidutilcode/feature/core/screen/ScreenAdaptActivity.java

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ public static void start(Context context) {
3636
@Override
3737
public void initData(@Nullable Bundle bundle) {
3838
if (ScreenUtils.isPortrait()) {
39-
ScreenUtils.adaptScreen4VerticalSlide(this, 540);
39+
ScreenUtils.adaptScreen4VerticalSlide(this, 360);
4040
} else {
41-
ScreenUtils.adaptScreen4HorizontalSlide(this, 540);
41+
ScreenUtils.adaptScreen4HorizontalSlide(this, 360);
4242
}
4343
}
4444

@@ -49,11 +49,7 @@ public int bindLayout() {
4949

5050
@Override
5151
public void initView(Bundle savedInstanceState, View contentView) {
52-
tvUp = findViewById(R.id.tv_up);
53-
tvDown = findViewById(R.id.tv_down);
54-
if (!ScreenUtils.isPortrait()) {
55-
updateLayout();
56-
}
52+
5753
}
5854

5955
@Override
@@ -68,34 +64,11 @@ public void onWidgetClick(View view) {
6864

6965
public void toggleFullScreen(View view) {
7066
ScreenUtils.toggleFullScreen(this);
71-
updateLayout();
7267
}
7368

74-
private void updateLayout() {
75-
int statusBarHeight = BarUtils.getStatusBarHeight();
76-
int statusBarHeightInDp = SizeUtils.px2dp(this, statusBarHeight);
77-
ViewGroup.LayoutParams upLayoutParams = tvUp.getLayoutParams();
78-
ViewGroup.LayoutParams downLayoutParams = tvDown.getLayoutParams();
79-
if (ScreenUtils.isFullScreen(this)) {
80-
int height = 360 / 2;
81-
String s = height + "dp";
82-
upLayoutParams.height = SizeUtils.dp2px(this, height);
83-
tvUp.setLayoutParams(upLayoutParams);
84-
tvUp.setText(s);
85-
86-
downLayoutParams.height = SizeUtils.dp2px(this, height);
87-
tvDown.setLayoutParams(downLayoutParams);
88-
tvDown.setText(s);
89-
} else {
90-
int height = 360 / 2 - statusBarHeightInDp / 2;
91-
String s = height + "dp";
92-
upLayoutParams.height = SizeUtils.dp2px(this, height);
93-
tvUp.setLayoutParams(upLayoutParams);
94-
tvUp.setText(s);
95-
96-
downLayoutParams.height = SizeUtils.dp2px(this, height);
97-
tvDown.setLayoutParams(downLayoutParams);
98-
tvDown.setText(s);
99-
}
69+
@Override
70+
protected void onDestroy() {
71+
ScreenUtils.cancelAdaptScreen(this);
72+
super.onDestroy();
10073
}
10174
}

app/src/main/res_core/layout-land/activity_screen_adapt.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
android:id="@+id/tv_up"
2222
style="@style/TextStyle"
2323
android:layout_width="2000dp"
24-
android:layout_height="1dp"
24+
android:layout_height="180dp"
2525
android:layout_alignParentTop="true"
2626
android:layout_toRightOf="@id/tv_fullscreen"
2727
android:background="@color/colorAccentHalfTrans"
@@ -32,7 +32,7 @@
3232
android:id="@+id/tv_down"
3333
style="@style/TextStyle"
3434
android:layout_width="2000dp"
35-
android:layout_height="1dp"
35+
android:layout_height="180dp"
3636
android:layout_alignParentBottom="true"
3737
android:layout_toRightOf="@id/tv_fullscreen"
3838
android:background="@color/colorPrimaryHalfTrans"

app/src/main/res_core/layout/activity_screen.xml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<ScrollView
3-
xmlns:android="http://schemas.android.com/apk/res/android"
2+
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
43
android:layout_width="match_parent"
54
android:layout_height="match_parent"
65
android:background="@color/white">
@@ -9,9 +8,7 @@
98
android:layout_width="match_parent"
109
android:layout_height="wrap_content"
1110
android:gravity="center_horizontal"
12-
android:orientation="vertical"
13-
android:paddingLeft="@dimen/spacing_16"
14-
android:paddingRight="@dimen/spacing_16">
11+
android:orientation="vertical">
1512

1613
<ImageView
1714
android:id="@+id/iv_screenshot"

config.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ ext {
66
compileSdkVersion: 27,
77
minSdkVersion : 14,
88
targetSdkVersion : 27,
9-
versionCode : 1_018_004,
10-
versionName : '1.18.4'// E.g 1.9.72 => 1,009,072
9+
versionCode : 1_018_005,
10+
versionName : '1.18.5'// E.g 1.9.72 => 1,009,072
1111
]
1212

1313
versionConfig = [
@@ -167,7 +167,7 @@ def configAppDependencies(Project pro) {
167167
// LeakCanary
168168
debugImplementation depConfig.leakcanary.android
169169
releaseImplementation depConfig.leakcanary.android_no_op
170-
// implementation 'com.blankj:utilcode:1.18.4'
170+
// implementation 'com.blankj:utilcode:1.18.5'
171171
}
172172
}
173173

update_log.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* 18/08/08 修复 ScreenUtils#adaptxx 在第三方 SDK 会出现的问题,发布 1.18.5
12
* 18/08/07 修复 ScreenUtils#adaptxx 在 API 26 以下无效的 bug,发布 1.18.4
23
* 18/08/06 修复 ScreenUtils#screenShot 中 decorView.getDrawingCache() 为空的问题,发布 1.18.3
34
* 18/08/05 修复 1.18.0 版本删去 `if (activity.getClass() == PermissionUtils.PermissionActivity.class) return;` 造成 PermissionUtils 获取栈顶 Activity 问题,发布 1.18.2

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-
implementation 'com.blankj:utilcode:1.18.4'
5+
implementation 'com.blankj:utilcode:1.18.5'
66
```
77

88

0 commit comments

Comments
 (0)