Skip to content

Commit 94c0dff

Browse files
committed
see 09/12 log
1 parent cdcb76f commit 94c0dff

29 files changed

+475
-383
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1-
**Describe the bug**
2-
A clear and concise description of what the bug is.
1+
## Describe the bug
32

4-
**The version of utilcode: [e.g. 1.16.3]**
3+
A clear and concise description of what the bug is.
54

6-
**The device: [e.g. Nexus 5X]**
5+
- The version of utilcode: <!-- e.g. 1.16.3 -->
6+
- The device: <!-- e.g. Nexus 5X -->
7+
- The version of device: <!-- API 27 -->
78

8-
**The version of device: [e.g. API 27]**
9+
## The code of bug
910

10-
**The code:**
11-
[e.g.
11+
<!-- e.g.
1212
```java
1313
CrashUtils.init();
1414
```
15-
]
15+
-->
16+
```
17+
put your code here
18+
```
19+
20+
## The stack of crash
1621

17-
**The stack of crash:**
18-
[e.g.
22+
<!-- e.g.
1923
```
2024
Caused by: java.lang.NullPointerException: u should init first
2125
at com.blankj.utilcode.util.Utils.getApp(Utils.java:98)
@@ -24,9 +28,14 @@ Caused by: java.lang.NullPointerException: u should init first
2428
at com.blankj.androidutilcode.UtilsApp.initCrash(UtilsApp.java:71) 
2529
at com.blankj.androidutilcode.UtilsApp.onCreate(UtilsApp.java:33) 
2630
```
27-
]
31+
-->
32+
33+
```
34+
put the stack of crash here
35+
```
36+
37+
## Screenshots
2838

29-
**Screenshots**
3039
If applicable, add screenshots to help explain your problem.
3140

3241

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

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

app/src/main/java/com/blankj/androidutilcode/base/BaseActivity.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ public abstract class BaseActivity extends AppCompatActivity
3131

3232
@Override
3333
protected void onCreate(Bundle savedInstanceState) {
34-
ScreenUtils.adaptScreen4VerticalSlide(this, 720);
34+
// if (ScreenUtils.isPortrait()) {
35+
// ScreenUtils.adaptScreen4VerticalSlide(this, 720);
36+
// } else {
37+
// ScreenUtils.adaptScreen4HorizontalSlide(this, 720);
38+
// }
3539
super.onCreate(savedInstanceState);
3640
mActivity = this;
3741
Bundle bundle = getIntent().getExtras();

app/src/main/java/com/blankj/androidutilcode/feature/core/bar/BarNavActivity.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public void initView(Bundle savedInstanceState, View contentView) {
5757
tvAboutNav = findViewById(R.id.tv_about_nav);
5858
findViewById(R.id.btn_nav_show).setOnClickListener(this);
5959
findViewById(R.id.btn_nav_hide).setOnClickListener(this);
60-
findViewById(R.id.btn_nav_immersive).setOnClickListener(this);
6160
findViewById(R.id.btn_nav_set_color).setOnClickListener(this);
6261
updateAboutNav();
6362
}
@@ -71,21 +70,18 @@ public void doBusiness() {
7170
public void onWidgetClick(View view) {
7271
switch (view.getId()) {
7372
case R.id.btn_nav_show:
74-
BarUtils.setNavBarVisibility(this, true);
75-
BarUtils.setStatusBarColor(this, ContextCompat.getColor(UtilsApp.getInstance(), R.color.colorPrimary), 0);
76-
BarUtils.addMarginTopEqualStatusBarHeight(rootLayout);
73+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
74+
BarUtils.setNavBarVisibility(this, true);
75+
}
7776
break;
7877
case R.id.btn_nav_hide:
79-
BarUtils.setNavBarVisibility(this, false);
80-
break;
81-
case R.id.btn_nav_immersive:
8278
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
83-
BarUtils.setNavBarImmersive(this);
79+
BarUtils.setNavBarVisibility(this, false);
8480
}
8581
break;
8682
case R.id.btn_nav_set_color:
8783
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
88-
BarUtils.setNavBarColor(this, Color.rgb(random.nextInt(256), random.nextInt(256), random.nextInt(256)));
84+
BarUtils.setNavBarColor(this, Color.argb(random.nextInt(256), random.nextInt(256), random.nextInt(256), random.nextInt(256)));
8985
}
9086
break;
9187
}
@@ -97,13 +93,15 @@ private void updateAboutNav() {
9793
tvAboutNav.setText(new SpanUtils()
9894
.appendLine("navHeight: " + BarUtils.getNavBarHeight())
9995
.appendLine("isNavBarVisible: " + BarUtils.isNavBarVisible(this))
100-
.append("getNavBarColor: #" + Integer.toHexString(BarUtils.getNavBarColor(this)))
96+
.appendLine("getNavBarColor: #" + Integer.toHexString(BarUtils.getNavBarColor(this)))
97+
.append("isSupportNavBar: " + BarUtils.isSupportNavBar())
10198
.create()
10299
);
103100
} else {
104101
tvAboutNav.setText(new SpanUtils()
105102
.appendLine("navHeight: " + BarUtils.getNavBarHeight())
106103
.appendLine("isNavBarVisible: " + BarUtils.isNavBarVisible(this))
104+
.append("isSupportNavBar: " + BarUtils.isSupportNavBar())
107105
.create()
108106
);
109107
}
@@ -113,6 +111,6 @@ private void updateAboutNav() {
113111
@Override
114112
public void onWindowFocusChanged(boolean hasFocus) {
115113
super.onWindowFocusChanged(hasFocus);
116-
BarUtils.setNavBarImmersive(this);
114+
BarUtils.setNavBarVisibility(this, BarUtils.isNavBarVisible(this));
117115
}
118116
}

app/src/main/java/com/blankj/androidutilcode/feature/core/keyboard/KeyboardActivity.java

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

33
import android.content.Context;
44
import android.content.Intent;
5+
import android.graphics.Color;
56
import android.os.Bundle;
67
import android.support.annotation.Nullable;
78
import android.support.v7.app.AlertDialog;

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.content.Context;
44
import android.content.Intent;
5+
import android.graphics.Color;
56
import android.os.Bundle;
67
import android.support.annotation.Nullable;
78
import android.view.View;
@@ -47,6 +48,8 @@ public void initView(Bundle savedInstanceState, View contentView) {
4748
ivScreenshot = findViewById(R.id.iv_screenshot);
4849
tvAboutScreen = findViewById(R.id.tv_about_screen);
4950
findViewById(R.id.btn_set_fullscreen).setOnClickListener(this);
51+
findViewById(R.id.btn_set_non_fullscreen).setOnClickListener(this);
52+
findViewById(R.id.btn_toggle_fullscreen).setOnClickListener(this);
5053
findViewById(R.id.btn_set_landscape).setOnClickListener(this);
5154
findViewById(R.id.btn_set_portrait).setOnClickListener(this);
5255
findViewById(R.id.btn_screenshot).setOnClickListener(this);
@@ -67,6 +70,12 @@ public void onWidgetClick(View view) {
6770
case R.id.btn_set_fullscreen:
6871
ScreenUtils.setFullScreen(this);
6972
break;
73+
case R.id.btn_set_non_fullscreen:
74+
ScreenUtils.setNonFullScreen(this);
75+
break;
76+
case R.id.btn_toggle_fullscreen:
77+
ScreenUtils.toggleFullScreen(this);
78+
break;
7079
case R.id.btn_set_landscape:
7180
ScreenUtils.setLandscape(this);
7281
break;
@@ -78,12 +87,12 @@ public void onWidgetClick(View view) {
7887
break;
7988
case R.id.btn_set_sleep_duration:
8089
ScreenUtils.setSleepDuration(100000);
81-
updateAboutScreen();
8290
break;
8391
case R.id.btn_test_adapt_screen:
8492
ScreenAdaptActivity.start(this);
8593
break;
8694
}
95+
updateAboutScreen();
8796
}
8897

8998
private void updateAboutScreen() {

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@
2828
android:layout_height="wrap_content"
2929
android:text="@string/bar_nav_hide" />
3030

31-
<Button
32-
android:id="@+id/btn_nav_immersive"
33-
style="@style/WideBtnStyle"
34-
android:layout_width="match_parent"
35-
android:layout_height="wrap_content"
36-
android:text="@string/bar_nav_immersive" />
37-
3831
<Button
3932
android:id="@+id/btn_nav_set_color"
4033
style="@style/WideBtnStyle"
Lines changed: 10 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
33
android:layout_width="match_parent"
4-
android:layout_height="match_parent">
4+
android:layout_height="match_parent"
5+
android:background="@color/rainbow_green">
56

6-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
7+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
78
android:layout_width="match_parent"
8-
android:layout_height="wrap_content"
9-
android:gravity="center_horizontal"
9+
android:layout_height="2000dp"
1010
android:orientation="vertical"
1111
android:padding="@dimen/spacing_16">
1212

@@ -21,119 +21,39 @@
2121
style="@style/WideBtnStyle"
2222
android:layout_width="match_parent"
2323
android:layout_height="wrap_content"
24+
android:layout_below="@id/tv_about_keyboard"
2425
android:text="@string/keyboard_hide_soft_input" />
2526

2627
<Button
2728
android:id="@+id/btn_show_soft_input"
2829
style="@style/WideBtnStyle"
2930
android:layout_width="match_parent"
3031
android:layout_height="wrap_content"
32+
android:layout_below="@id/btn_hide_soft_input"
3133
android:text="@string/keyboard_show_soft_input" />
3234

3335
<Button
3436
android:id="@+id/btn_toggle_soft_input"
3537
style="@style/WideBtnStyle"
3638
android:layout_width="match_parent"
3739
android:layout_height="wrap_content"
40+
android:layout_below="@id/btn_show_soft_input"
3841
android:text="@string/keyboard_toggle_soft_input" />
3942

4043
<Button
4144
android:id="@+id/btn_keyboard_in_fragment"
4245
style="@style/WideBtnStyle"
4346
android:layout_width="match_parent"
4447
android:layout_height="wrap_content"
48+
android:layout_below="@id/btn_toggle_soft_input"
4549
android:text="@string/keyboard_show_dialog" />
4650

4751
<EditText
4852
android:id="@+id/et_input"
4953
android:layout_width="match_parent"
5054
android:layout_height="match_parent"
55+
android:layout_alignParentBottom="true"
5156
android:inputType="text" />
5257

53-
54-
<EditText
55-
android:id="@+id/et_input1"
56-
android:layout_width="match_parent"
57-
android:layout_height="match_parent"
58-
android:inputType="text" />
59-
60-
61-
<EditText
62-
android:id="@+id/et_input2"
63-
android:layout_width="match_parent"
64-
android:layout_height="match_parent"
65-
android:inputType="text" />
66-
67-
68-
<EditText
69-
android:id="@+id/et_input3"
70-
android:layout_width="match_parent"
71-
android:layout_height="match_parent"
72-
android:layout_gravity="bottom"
73-
android:inputType="text" />
74-
75-
76-
<EditText
77-
android:id="@+id/et_input4"
78-
android:layout_width="match_parent"
79-
android:layout_height="match_parent"
80-
android:inputType="text" />
81-
82-
83-
<EditText
84-
android:id="@+id/et_input5"
85-
android:layout_width="match_parent"
86-
android:layout_height="match_parent"
87-
android:inputType="text" />
88-
89-
90-
<EditText
91-
android:id="@+id/et_input6"
92-
android:layout_width="match_parent"
93-
android:layout_height="match_parent"
94-
android:inputType="text" />
95-
96-
<EditText
97-
android:id="@+id/et_input7"
98-
android:layout_width="match_parent"
99-
android:layout_height="match_parent"
100-
android:inputType="text" />
101-
102-
<EditText
103-
android:id="@+id/et_input8"
104-
android:layout_width="match_parent"
105-
android:layout_height="match_parent"
106-
android:inputType="text" />
107-
108-
<EditText
109-
android:id="@+id/et_input9"
110-
android:layout_width="match_parent"
111-
android:layout_height="match_parent"
112-
android:inputType="text" />
113-
114-
<EditText
115-
android:id="@+id/et_input10"
116-
android:layout_width="match_parent"
117-
android:layout_height="match_parent"
118-
android:inputType="text" />
119-
120-
<EditText
121-
android:id="@+id/et_input11"
122-
android:layout_width="match_parent"
123-
android:layout_height="match_parent"
124-
android:inputType="text" />
125-
126-
<EditText
127-
android:id="@+id/et_input12"
128-
android:layout_width="match_parent"
129-
android:layout_height="match_parent"
130-
android:inputType="text" />
131-
132-
<EditText
133-
android:id="@+id/et_input13"
134-
android:layout_width="match_parent"
135-
android:layout_height="match_parent"
136-
android:inputType="text" />
137-
138-
</LinearLayout>
58+
</RelativeLayout>
13959
</ScrollView>

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
33
android:layout_width="match_parent"
44
android:layout_height="match_parent"
5-
android:background="@color/white">
5+
android:background="@android:color/darker_gray">
66

77
<LinearLayout
88
android:layout_width="match_parent"
@@ -28,6 +28,20 @@
2828
android:layout_height="wrap_content"
2929
android:text="@string/screen_set_fullscreen" />
3030

31+
<Button
32+
android:id="@+id/btn_set_non_fullscreen"
33+
style="@style/WideBtnStyle"
34+
android:layout_width="match_parent"
35+
android:layout_height="wrap_content"
36+
android:text="@string/screen_set_non_fullscreen" />
37+
38+
<Button
39+
android:id="@+id/btn_toggle_fullscreen"
40+
style="@style/WideBtnStyle"
41+
android:layout_width="match_parent"
42+
android:layout_height="wrap_content"
43+
android:text="@string/screen_toggle_fullscreen" />
44+
3145
<Button
3246
android:id="@+id/btn_set_landscape"
3347
style="@style/WideBtnStyle"

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@
223223

224224
<!--Screen 相关-->
225225
<string name="screen_set_fullscreen">Set Fullscreen</string>
226+
<string name="screen_set_non_fullscreen">Set NonFullscreen</string>
227+
<string name="screen_toggle_fullscreen">Toggle Fullscreen</string>
226228
<string name="screen_set_landscape">Set Landscape</string>
227229
<string name="screen_set_portrait">Set Portrait</string>
228230
<string name="screen_screenshot">Screenshot</string>

0 commit comments

Comments
 (0)