Skip to content

Commit 711d1ce

Browse files
committed
see 06/25 log
1 parent 542ea59 commit 711d1ce

21 files changed

+270
-151
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.17.0-brightgreen.svg
44+
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.17.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.17.0-brightgreen.svg
44+
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.17.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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ dependencies {
5757
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
5858
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakcanary_version"
5959
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary_version"
60-
// implementation 'com.blankj:utilcode:1.16.4'
60+
// implementation 'com.blankj:utilcode:1.17.1'
6161
}

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@
120120
android:launchMode="singleTop" />
121121
<activity
122122
android:name=".feature.core.keyboard.KeyboardActivity"
123-
android:launchMode="singleTop"
124-
android:windowSoftInputMode="stateHidden|adjustPan" />
123+
android:launchMode="singleTop" />
125124
<activity
126125
android:name=".feature.core.log.LogActivity"
127126
android:launchMode="singleTop" />

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

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,14 @@
55
import android.os.Bundle;
66
import android.support.annotation.Nullable;
77
import android.support.v7.app.AlertDialog;
8-
import android.view.MotionEvent;
98
import android.view.View;
10-
import android.view.inputmethod.InputMethodManager;
119
import android.widget.EditText;
1210
import android.widget.TextView;
1311

1412
import com.blankj.androidutilcode.R;
1513
import com.blankj.androidutilcode.base.BaseBackActivity;
1614
import com.blankj.androidutilcode.helper.DialogHelper;
1715
import com.blankj.utilcode.util.KeyboardUtils;
18-
import com.blankj.utilcode.util.ScreenUtils;
1916
import com.blankj.utilcode.util.SpanUtils;
2017

2118
/**
@@ -49,8 +46,8 @@ public int bindLayout() {
4946

5047
@Override
5148
public void initView(Bundle savedInstanceState, View contentView) {
49+
KeyboardUtils.fixAndroidBug5497(this);
5250
getToolBar().setTitle(getString(R.string.demo_keyboard));
53-
ScreenUtils.setFullScreen(this);
5451
etInput = findViewById(R.id.et_input);
5552
findViewById(R.id.btn_hide_soft_input).setOnClickListener(this);
5653
findViewById(R.id.btn_show_soft_input).setOnClickListener(this);
@@ -95,34 +92,34 @@ public void onWidgetClick(View view) {
9592
}
9693
}
9794

98-
@Override
99-
public boolean dispatchTouchEvent(MotionEvent ev) {
100-
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
101-
View v = getCurrentFocus();
102-
if (isShouldHideKeyboard(v, ev)) {
103-
InputMethodManager imm =
104-
(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
105-
if (imm == null) return super.dispatchTouchEvent(ev);
106-
imm.hideSoftInputFromWindow(v.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
107-
}
108-
}
109-
return super.dispatchTouchEvent(ev);
110-
}
111-
112-
// 根据 EditText 所在坐标和用户点击的坐标相对比,来判断是否隐藏键盘
113-
private boolean isShouldHideKeyboard(View v, MotionEvent event) {
114-
if (v != null && (v instanceof EditText)) {
115-
int[] l = {0, 0};
116-
v.getLocationInWindow(l);
117-
int left = l[0],
118-
top = l[1],
119-
bottom = top + v.getHeight(),
120-
right = left + v.getWidth();
121-
return !(event.getX() > left && event.getX() < right
122-
&& event.getY() > top && event.getY() < bottom);
123-
}
124-
return false;
125-
}
95+
// @Override
96+
// public boolean dispatchTouchEvent(MotionEvent ev) {
97+
// if (ev.getAction() == MotionEvent.ACTION_DOWN) {
98+
// View v = getCurrentFocus();
99+
// if (isShouldHideKeyboard(v, ev)) {
100+
// InputMethodManager imm =
101+
// (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
102+
// if (imm == null) return super.dispatchTouchEvent(ev);
103+
// imm.hideSoftInputFromWindow(v.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
104+
// }
105+
// }
106+
// return super.dispatchTouchEvent(ev);
107+
// }
108+
//
109+
// // 根据 EditText 所在坐标和用户点击的坐标相对比,来判断是否隐藏键盘
110+
// private boolean isShouldHideKeyboard(View v, MotionEvent event) {
111+
// if (v != null && (v instanceof EditText)) {
112+
// int[] l = {0, 0};
113+
// v.getLocationInWindow(l);
114+
// int left = l[0],
115+
// top = l[1],
116+
// bottom = top + v.getHeight(),
117+
// right = left + v.getWidth();
118+
// return !(event.getX() > left && event.getX() < right
119+
// && event.getY() > top && event.getY() < bottom);
120+
// }
121+
// return false;
122+
// }
126123

127124
@Override
128125
protected void onDestroy() {

app/src/main/res/layout/activity_back.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<android.support.design.widget.CoordinatorLayout
3-
xmlns:android="http://schemas.android.com/apk/res/android"
2+
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
43
xmlns:app="http://schemas.android.com/apk/res-auto"
54
android:id="@+id/root_layout"
65
android:layout_width="match_parent"
Lines changed: 121 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,131 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
33
android:layout_width="match_parent"
4-
android:layout_height="match_parent"
5-
android:gravity="center_horizontal"
6-
android:orientation="vertical"
7-
android:padding="@dimen/spacing_16">
8-
9-
<TextView
10-
android:id="@+id/tv_about_keyboard"
11-
style="@style/TextStyle"
12-
android:layout_width="match_parent"
13-
android:layout_height="wrap_content" />
4+
android:layout_height="match_parent">
145

15-
<Button
16-
android:id="@+id/btn_hide_soft_input"
17-
style="@style/WideBtnStyle"
6+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
187
android:layout_width="match_parent"
198
android:layout_height="wrap_content"
20-
android:text="@string/keyboard_hide_soft_input" />
9+
android:gravity="center_horizontal"
10+
android:orientation="vertical"
11+
android:padding="@dimen/spacing_16">
2112

22-
<Button
23-
android:id="@+id/btn_show_soft_input"
24-
style="@style/WideBtnStyle"
25-
android:layout_width="match_parent"
26-
android:layout_height="wrap_content"
27-
android:text="@string/keyboard_show_soft_input" />
13+
<TextView
14+
android:id="@+id/tv_about_keyboard"
15+
style="@style/TextStyle"
16+
android:layout_width="match_parent"
17+
android:layout_height="wrap_content" />
2818

29-
<Button
30-
android:id="@+id/btn_toggle_soft_input"
31-
style="@style/WideBtnStyle"
32-
android:layout_width="match_parent"
33-
android:layout_height="wrap_content"
34-
android:text="@string/keyboard_toggle_soft_input" />
19+
<Button
20+
android:id="@+id/btn_hide_soft_input"
21+
style="@style/WideBtnStyle"
22+
android:layout_width="match_parent"
23+
android:layout_height="wrap_content"
24+
android:text="@string/keyboard_hide_soft_input" />
3525

36-
<Button
37-
android:id="@+id/btn_keyboard_in_fragment"
38-
style="@style/WideBtnStyle"
39-
android:layout_width="match_parent"
40-
android:layout_height="wrap_content"
41-
android:text="@string/keyboard_show_dialog" />
26+
<Button
27+
android:id="@+id/btn_show_soft_input"
28+
style="@style/WideBtnStyle"
29+
android:layout_width="match_parent"
30+
android:layout_height="wrap_content"
31+
android:text="@string/keyboard_show_soft_input" />
4232

43-
<EditText
44-
android:id="@+id/et_input"
45-
android:layout_width="match_parent"
46-
android:layout_height="match_parent"
47-
android:layout_gravity="bottom"
48-
android:inputType="text" />
33+
<Button
34+
android:id="@+id/btn_toggle_soft_input"
35+
style="@style/WideBtnStyle"
36+
android:layout_width="match_parent"
37+
android:layout_height="wrap_content"
38+
android:text="@string/keyboard_toggle_soft_input" />
39+
40+
<Button
41+
android:id="@+id/btn_keyboard_in_fragment"
42+
style="@style/WideBtnStyle"
43+
android:layout_width="match_parent"
44+
android:layout_height="wrap_content"
45+
android:text="@string/keyboard_show_dialog" />
46+
47+
<EditText
48+
android:id="@+id/et_input"
49+
android:layout_width="match_parent"
50+
android:layout_height="match_parent"
51+
android:layout_gravity="bottom"
52+
android:inputType="text" />
53+
54+
55+
<EditText
56+
android:id="@+id/et_input1"
57+
android:layout_width="match_parent"
58+
android:layout_height="match_parent"
59+
android:layout_gravity="bottom"
60+
android:inputType="text" />
61+
62+
63+
<EditText
64+
android:id="@+id/et_input2"
65+
android:layout_width="match_parent"
66+
android:layout_height="match_parent"
67+
android:layout_gravity="bottom"
68+
android:inputType="text" />
69+
70+
71+
<EditText
72+
android:id="@+id/et_input3"
73+
android:layout_width="match_parent"
74+
android:layout_height="match_parent"
75+
android:layout_gravity="bottom"
76+
android:inputType="text" />
77+
78+
79+
<EditText
80+
android:id="@+id/et_input4"
81+
android:layout_width="match_parent"
82+
android:layout_height="match_parent"
83+
android:layout_gravity="bottom"
84+
android:inputType="text" />
85+
86+
87+
<EditText
88+
android:id="@+id/et_input5"
89+
android:layout_width="match_parent"
90+
android:layout_height="match_parent"
91+
android:layout_gravity="bottom"
92+
android:inputType="text" />
93+
94+
95+
<EditText
96+
android:id="@+id/et_input6"
97+
android:layout_width="match_parent"
98+
android:layout_height="match_parent"
99+
android:layout_gravity="bottom"
100+
android:inputType="text" />
101+
102+
<EditText
103+
android:id="@+id/et_input7"
104+
android:layout_width="match_parent"
105+
android:layout_height="match_parent"
106+
android:layout_gravity="bottom"
107+
android:inputType="text" />
108+
109+
<EditText
110+
android:id="@+id/et_input8"
111+
android:layout_width="match_parent"
112+
android:layout_height="match_parent"
113+
android:layout_gravity="bottom"
114+
android:inputType="text" />
115+
116+
<EditText
117+
android:id="@+id/et_input9"
118+
android:layout_width="match_parent"
119+
android:layout_height="match_parent"
120+
android:layout_gravity="bottom"
121+
android:inputType="text" />
122+
123+
<EditText
124+
android:id="@+id/et_input10"
125+
android:layout_width="match_parent"
126+
android:layout_height="match_parent"
127+
android:layout_gravity="bottom"
128+
android:inputType="text" />
49129

50-
</LinearLayout>
130+
</LinearLayout>
131+
</ScrollView>

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ buildscript {
77
min_sdk_version = 14
88
target_sdk_version = 27
99

10-
version_code = 1_017_000
11-
version_name = '1.17.0'// E.g 1.9.72 => 1,009,072
10+
version_code = 1_017_001
11+
version_name = '1.17.1'// E.g 1.9.72 => 1,009,072
1212

1313
// App dependencies
1414
support_version = '27.1.0'
@@ -26,7 +26,7 @@ buildscript {
2626
jcenter()
2727
}
2828
dependencies {
29-
classpath 'com.android.tools.build:gradle:3.1.2'
29+
classpath 'com.android.tools.build:gradle:3.1.3'
3030
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
3131
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
3232

update_log.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* 18/06/25 新增 KeyboardUtils#fixAndroidBug5497,发布 1.17.1 版本
2+
* 18/06/21 修复 FragmentUtils#add 死循环的 BUG
13
* 18/06/14 替换 CacheUtils 为 CacheDiskUtils,CacheUtils 标记 deprecated,发布 1.17.0 版本
24
* 18/06/13 新增 CacheMemoryUtils 和 CacheDoubleUtils
35
* 18/06/12 完善 FragmentUtils#add 和 replace 新增 tag

utilcode/README-CN.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Gradle:
44
```groovy
5-
implementation 'com.blankj:utilcode:1.17.0'
5+
implementation 'com.blankj:utilcode:1.17.1'
66
```
77

88

@@ -384,6 +384,7 @@ toggleSoftInput : 切换键盘显示与否状态
384384
isSoftInputVisible : 判断软键盘是否可见
385385
registerSoftInputChangedListener : 注册软键盘改变监听器
386386
unregisterSoftInputChangedListener: 注销软键盘改变监听器
387+
fixAndroidBug5497 : 修复安卓 5497 BUG
387388
fixSoftInputLeaks : 修复软键盘内存泄漏
388389
clickBlankArea2HideSoftInput : 点击屏幕空白区域隐藏软键盘
389390
```
@@ -467,6 +468,7 @@ request : 开始请求
467468
```
468469
isPhone : 判断设备是否是手机
469470
getDeviceId : 获取设备码
471+
getSerial : 获取序列号
470472
getIMEI : 获取 IMEI 码
471473
getMEID : 获取 MEID 码
472474
getIMSI : 获取 IMSI 码
@@ -610,7 +612,6 @@ setLineHeight : 设置行高
610612
setQuoteColor : 设置引用线的颜色
611613
setLeadingMargin : 设置缩进
612614
setBullet : 设置列表标记
613-
setIconMargin : 设置图标
614615
setFontSize : 设置字体尺寸
615616
setFontProportion : 设置字体比例
616617
setFontXProportion: 设置字体横向比例

utilcode/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Gradle:
44
```groovy
5-
implementation 'com.blankj:utilcode:1.17.0'
5+
implementation 'com.blankj:utilcode:1.17.1'
66
```
77

88

@@ -384,6 +384,7 @@ toggleSoftInput
384384
isSoftInputVisible
385385
registerSoftInputChangedListener
386386
unregisterSoftInputChangedListener
387+
fixAndroidBug5497
387388
fixSoftInputLeaks
388389
clickBlankArea2HideSoftInput
389390
```
@@ -467,6 +468,7 @@ request
467468
```
468469
isPhone
469470
getDeviceId
471+
getSerial
470472
getIMEI
471473
getMEID
472474
getIMSI
@@ -610,7 +612,6 @@ setLineHeight
610612
setQuoteColor
611613
setLeadingMargin
612614
setBullet
613-
setIconMargin
614615
setFontSize
615616
setFontProportion
616617
setFontXProportion

0 commit comments

Comments
 (0)