Skip to content

Commit e5b5bcc

Browse files
committed
see 05/02 log
1 parent 9409d89 commit e5b5bcc

File tree

10 files changed

+25
-9
lines changed

10 files changed

+25
-9
lines changed

README-CN.md

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

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

README.md

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

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

app/build.gradle

+1-1
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.14.1'
59+
// implementation 'com.blankj:utilcode:1.14.2'
6060
}
6161

6262

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.blankj.androidutilcode.base;
22

3+
import android.annotation.SuppressLint;
34
import android.support.annotation.LayoutRes;
45
import android.support.design.widget.AppBarLayout;
56
import android.support.design.widget.CoordinatorLayout;
@@ -31,6 +32,7 @@ public abstract class BaseBackActivity extends BaseActivity {
3132
protected AppBarLayout abl;
3233
protected FrameLayout flActivityContainer;
3334

35+
@SuppressLint("ResourceType")
3436
@Override
3537
protected void setBaseView(@LayoutRes int layoutId) {
3638
Slidr.attach(this);
@@ -40,7 +42,9 @@ protected void setBaseView(@LayoutRes int layoutId) {
4042
abl = findViewById(R.id.abl);
4143
mToolbar = findViewById(R.id.toolbar);
4244
flActivityContainer = findViewById(R.id.activity_container);
43-
flActivityContainer.addView(LayoutInflater.from(this).inflate(layoutId, flActivityContainer, false));
45+
if (layoutId > 0) {
46+
flActivityContainer.addView(LayoutInflater.from(this).inflate(layoutId, flActivityContainer, false));
47+
}
4448
setSupportActionBar(mToolbar);
4549
getToolBar().setDisplayHomeAsUpEnabled(true);
4650

build.gradle

+2-2
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_014_001
48-
version_name = '1.14.1'// E.g 1.9.72 => 1,009,072
47+
version_code = 1_014_002
48+
version_name = '1.14.2'// E.g 1.9.72 => 1,009,072
4949

5050
// App dependencies
5151
support_version = '27.1.0'

update_log.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* 18/05/02 修复 PermissionUtils 空异常,发布 1.14.2 版本
12
* 18/04/28 新增 FlashlightUtils,发布 1.14.1 版本
23
* 18/04/26 修复 KeyboardUtils 全屏 NO_LIMIT 的 bug
34
* 18/04/25 修复多个空异常

utilcode/README-CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

88

utilcode/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

88

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ public static void showSoftInput(final Activity activity) {
4141
(InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
4242
if (imm == null) return;
4343
View view = activity.getCurrentFocus();
44-
if (view == null) view = new View(activity);
44+
if (view == null) {
45+
view = new View(activity);
46+
view.setFocusable(true);
47+
view.setFocusableInTouchMode(true);
48+
view.requestFocus();
49+
}
4550
imm.showSoftInput(view, InputMethodManager.SHOW_FORCED);
4651
}
4752

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

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import android.support.annotation.Nullable;
1212
import android.support.annotation.RequiresApi;
1313
import android.support.v4.content.ContextCompat;
14+
import android.util.Log;
1415

1516
import com.blankj.utilcode.constant.PermissionConstants;
1617
import com.blankj.utilcode.util.PermissionUtils.OnRationaleListener.ShouldRequest;
@@ -287,6 +288,11 @@ public static void start(final Context context) {
287288

288289
@Override
289290
protected void onCreate(@Nullable Bundle savedInstanceState) {
291+
if (sInstance == null) {
292+
Log.e("PermissionUtils", "request permissions failed");
293+
finish();
294+
return;
295+
}
290296
if (sInstance.mThemeCallback != null) {
291297
sInstance.mThemeCallback.onActivityCreate(this);
292298
}

0 commit comments

Comments
 (0)