提交 1d45e4a4 编写于 作者: B Blankj

see 09/13 log

上级 94c0dffd
......@@ -41,7 +41,7 @@
[logo]: https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/logo.png
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.20.2-brightgreen.svg
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.20.3-brightgreen.svg
[auc]: https://github.com/Blankj/AndroidUtilCode
[apisvg]: https://img.shields.io/badge/API-14+-brightgreen.svg
......
......@@ -41,7 +41,7 @@ If this project helps you a lot and you want to support the project's developmen
[logo]: https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/logo.png
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.20.2-brightgreen.svg
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.20.3-brightgreen.svg
[auc]: https://github.com/Blankj/AndroidUtilCode
[apisvg]: https://img.shields.io/badge/API-14+-brightgreen.svg
......
......@@ -2,7 +2,6 @@ package com.blankj.androidutilcode.feature.core.keyboard;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AlertDialog;
......@@ -11,12 +10,9 @@ import android.widget.EditText;
import android.widget.TextView;
import com.blankj.androidutilcode.R;
import com.blankj.androidutilcode.base.BaseActivity;
import com.blankj.androidutilcode.base.BaseBackActivity;
import com.blankj.androidutilcode.helper.DialogHelper;
import com.blankj.utilcode.util.BarUtils;
import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.ScreenUtils;
import com.blankj.utilcode.util.SpanUtils;
/**
......
......@@ -6,8 +6,8 @@ ext {
compileSdkVersion: 27,
minSdkVersion : 14,
targetSdkVersion : 27,
versionCode : 1_020_002,
versionName : '1.20.2'// E.g. 1.9.72 => 1,009,072
versionCode : 1_020_003,
versionName : '1.20.3'// E.g. 1.9.72 => 1,009,072
]
versionConfig = [
......@@ -172,7 +172,7 @@ def configAppDependencies(Project pro) {
// LeakCanary
debugImplementation depConfig.leakcanary.android
releaseImplementation depConfig.leakcanary.android_no_op
// implementation 'com.blankj:utilcode:1.20.2'
// implementation 'com.blankj:utilcode:1.20.3'
}
}
......
* `18/09/13` 修复 ToastUtils 在小米手机显示 Toast 带有 App 名,发布 1.20.3
* `18/09/12` 修复 KeyBoardUtils#fixAndroidBug5497,完善 ToastUtils,发布 1.20.2
* `18/09/11` 新增 BarUtils#isSupportNavBar,删除 BarUtils#setNavBarImmersive
* `18/09/10` 修复 KeyboardUtils 中 getWindowVisibleDisplayFrame 空指针异常,更新 BarUtils#isNavBarVisible
......
......@@ -2,7 +2,7 @@
Gradle:
```groovy
implementation 'com.blankj:utilcode:1.20.2'
implementation 'com.blankj:utilcode:1.20.3'
```
......
......@@ -2,7 +2,7 @@
Gradle:
```groovy
implementation 'com.blankj:utilcode:1.20.2'
implementation 'com.blankj:utilcode:1.20.3'
```
......
......@@ -3,6 +3,7 @@ package com.blankj.utilcode.util;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.PixelFormat;
import android.graphics.PorterDuff;
......@@ -333,13 +334,13 @@ public final class ToastUtils {
static IToast makeToast(Context context, CharSequence text, int duration) {
if (NotificationManagerCompat.from(context).areNotificationsEnabled()) {
return new SystemToast(Toast.makeText(context, text, duration));
return new SystemToast(makeNormalToast(context, text, duration));
}
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N_MR1) {
return new ToastWithoutNotification(Toast.makeText(context, text, duration));
return new ToastWithoutNotification(makeNormalToast(context, text, duration));
}
Log.e("ToastUtils", "Toast is GG. In fact, next step is useless.");
return new SystemToast(Toast.makeText(context, text, duration));
return new SystemToast(makeNormalToast(context, text, duration));
}
static IToast newToast(Context context) {
......@@ -352,6 +353,21 @@ public final class ToastUtils {
Log.e("ToastUtils", "Toast is GG. In fact, next step is useless.");
return new SystemToast(new Toast(context));
}
private static Toast makeNormalToast(Context context, CharSequence text, int duration) {
if ("Xiaomi".equals(Build.MANUFACTURER)) {
Toast toast = new Toast(context);
int identifier = Resources.getSystem()
.getIdentifier("transient_notification", "layout", "android");
View view = getView(identifier);
toast.setView(view);
toast.setDuration(duration);
TextView tv = view.findViewById(android.R.id.message);
tv.setText(text);
return toast;
}
return Toast.makeText(context, text, duration);
}
}
static class SystemToast implements IToast {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册