Skip to content

Commit e6dee89

Browse files
committed
优化 ApplicationToast 类命名
优化 ToastLogInterceptor 类筛除类的规则 修复在 Android 13 上面会出现 Toast 布局被半透明化的问题
1 parent 87a97e9 commit e6dee89

File tree

15 files changed

+60
-41
lines changed

15 files changed

+60
-41
lines changed

HelpDoc-en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public class ToastStrategy {
144144

145145
#### What should I do if the framework cannot meet the scene I am currently using
146146

147-
* The Toaster framework is intended to solve some toast requirements. If Toaster cannot meet your needs, you can consider using the [XToast](https://github.com/getActivity/XToast) floating window framework to achieve it.
147+
* The Toaster framework is intended to solve some toast requirements. If Toaster cannot meet your needs, you can consider using the [EasyWindow](https://github.com/getActivity/EasyWindow) floating window framework to achieve it.
148148

149149
#### Why the framework prefers to use window manager to implement toast
150150

HelpDoc-zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public class ToastStrategy {
160160

161161
#### 框架无法满足我当前使用的场景怎么办
162162

163-
* Toaster 框架意在解决一些的 Toast 需求,如果 Toaster 无法满足你的需求,你可以考虑使用 [XToast](https://github.com/getActivity/XToast) 悬浮窗框架来实现。
163+
* Toaster 框架意在解决一些的 Toast 需求,如果 Toaster 无法满足你的需求,你可以考虑使用 [EasyWindow](https://github.com/getActivity/EasyWindow) 悬浮窗框架来实现。
164164

165165
#### 为什么框架优先使用 WindowManager 来实现 Toast
166166

README-en.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
* Project address: [Github](https://github.com/getActivity/Toaster)
66

7-
* [Click here to download demo apk directly](https://github.com/getActivity/Toaster/releases/download/12.2/Toaster.apk)
7+
* [Click here to download demo apk directly](https://github.com/getActivity/Toaster/releases/download/12.3/Toaster.apk)
88

99
![](picture/en/demo_toast_activity.jpg) ![](picture/en/demo_toast_style_white.jpg) ![](picture/en/demo_toast_style_black.jpg)
1010

@@ -49,7 +49,7 @@ android {
4949
5050
dependencies {
5151
// Toast framework:https://github.com/getActivity/Toaster
52-
implementation 'com.github.getActivity:Toaster:12.2'
52+
implementation 'com.github.getActivity:Toaster:12.3'
5353
}
5454
```
5555

@@ -134,7 +134,7 @@ Toaster.getInterceptor();
134134

135135
| Function or detail | [Toaster](https://github.com/getActivity/Toaster) |[ AndroidUtilCode-ToastUtils ](https://github.com/Blankj/AndroidUtilCode)| [Toasty](https://github.com/GrenderG/Toasty) |
136136
| :----: | :------: | :-----: | :-----: |
137-
| Corresponding version | 12.2 | 1.30.6 | 1.5.0 |
137+
| Corresponding version | 12.3 | 1.30.6 | 1.5.0 |
138138
| Number of issues | [![](https://img.shields.io/github/issues/getActivity/Toaster.svg)](https://github.com/getActivity/Toaster/issues) |[![](https://img.shields.io/github/issues/Blankj/AndroidUtilCode.svg)](https://github.com/Blankj/AndroidUtilCode/issues)| [![](https://img.shields.io/github/issues/GrenderG/Toasty.svg)](https://github.com/GrenderG/Toasty/issues) |
139139
| Framework pack size | 31 KB | 500 KB | 50 KB |
140140
| Framework maintenance status| 维护中 | 停止维护 | 停止维护 |
@@ -234,7 +234,7 @@ new Toast
234234

235235
* Title bar framework: [TitleBar](https://github.com/getActivity/TitleBar)![](https://img.shields.io/github/stars/getActivity/TitleBar.svg)![](https://img.shields.io/github/forks/getActivity/TitleBar.svg)
236236

237-
* Floating window framework: [XToast](https://github.com/getActivity/XToast)![](https://img.shields.io/github/stars/getActivity/XToast.svg)![](https://img.shields.io/github/forks/getActivity/XToast.svg)
237+
* Floating window framework: [EasyWindow](https://github.com/getActivity/EasyWindow)![](https://img.shields.io/github/stars/getActivity/EasyWindow.svg)![](https://img.shields.io/github/forks/getActivity/EasyWindow.svg)
238238

239239
* Shape view framework: [ShapeView](https://github.com/getActivity/ShapeView)![](https://img.shields.io/github/stars/getActivity/ShapeView.svg)![](https://img.shields.io/github/forks/getActivity/ShapeView.svg)
240240

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
* 博客地址:[只需体验三分钟,你就会跟我一样,爱上这款 Toast](https://www.jianshu.com/p/9b174ee2c571)
88

9-
* 可以扫码下载 Demo 进行演示或者测试,如果扫码下载不了的,[点击此处可直接下载](https://github.com/getActivity/Toaster/releases/download/12.2/Toaster.apk)
9+
* 可以扫码下载 Demo 进行演示或者测试,如果扫码下载不了的,[点击此处可直接下载](https://github.com/getActivity/Toaster/releases/download/12.3/Toaster.apk)
1010

1111
![](picture/zh/download_demo_apk_qr_code.png)
1212

@@ -53,7 +53,7 @@ android {
5353
5454
dependencies {
5555
// 吐司框架:https://github.com/getActivity/Toaster
56-
implementation 'com.github.getActivity:Toaster:12.2'
56+
implementation 'com.github.getActivity:Toaster:12.3'
5757
}
5858
```
5959

@@ -138,7 +138,7 @@ Toaster.getInterceptor();
138138

139139
| 功能或细节 | [Toaster](https://github.com/getActivity/Toaster) | [AndroidUtilCode-ToastUtils](https://github.com/Blankj/AndroidUtilCode) | [Toasty](https://github.com/GrenderG/Toasty) |
140140
| :----: | :------: | :-----: | :-----: |
141-
| 对应版本 | 12.2 | 1.30.6 | 1.5.0 |
141+
| 对应版本 | 12.3 | 1.30.6 | 1.5.0 |
142142
| issues 数 | [![](https://img.shields.io/github/issues/getActivity/Toaster.svg)](https://github.com/getActivity/Toaster/issues) | [![](https://img.shields.io/github/issues/Blankj/AndroidUtilCode.svg)](https://github.com/Blankj/AndroidUtilCode/issues) | [![](https://img.shields.io/github/issues/GrenderG/Toasty.svg)](https://github.com/GrenderG/Toasty/issues) |
143143
| 框架体积 | 32 KB | 500 KB | 50 KB |
144144
| 框架维护状态 | 维护中 | 停止维护 | 停止维护 |
@@ -242,7 +242,7 @@ new Toast
242242

243243
* 标题栏框架:[TitleBar](https://github.com/getActivity/TitleBar) ![](https://img.shields.io/github/stars/getActivity/TitleBar.svg) ![](https://img.shields.io/github/forks/getActivity/TitleBar.svg)
244244

245-
* 悬浮窗框架:[XToast](https://github.com/getActivity/XToast) ![](https://img.shields.io/github/stars/getActivity/XToast.svg) ![](https://img.shields.io/github/forks/getActivity/XToast.svg)
245+
* 悬浮窗框架:[EasyWindow](https://github.com/getActivity/EasyWindow) ![](https://img.shields.io/github/stars/getActivity/EasyWindow.svg) ![](https://img.shields.io/github/forks/getActivity/EasyWindow.svg)
246246

247247
* Shape 框架:[ShapeView](https://github.com/getActivity/ShapeView) ![](https://img.shields.io/github/stars/getActivity/ShapeView.svg) ![](https://img.shields.io/github/forks/getActivity/ShapeView.svg)
248248

@@ -282,6 +282,18 @@ new Toast
282282

283283
#### [点击查看捐赠列表](https://github.com/getActivity/Donate)
284284

285+
#### 广告区
286+
287+
* 我现在任腾讯云服务器推广大使,大家如果有购买服务器的需求,可以通过下面的链接购买
288+
289+
[![](https://upload-dianshi-1255598498.file.myqcloud.com/upload/nodir/345X200-9ae456f58874df499adf7c331c02cb0fed12b81d.jpg)](https://curl.qcloud.com/A6cYskvv)
290+
291+
[【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中](https://curl.qcloud.com/A6cYskvv)
292+
293+
[![](https://upload-dianshi-1255598498.file.myqcloud.com/345-200-b28f7dee9552f4241ea6a543f15a9798049701d4.jpg)](https://curl.qcloud.com/up4fQsdn)
294+
295+
[【腾讯云】中小企业福利专场,多款刚需产品,满足企业通用场景需求](https://curl.qcloud.com/up4fQsdn)
296+
285297
## License
286298

287299
```text

app/build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 31
4+
compileSdkVersion 33
55

66
defaultConfig {
77
applicationId "com.hjq.toast.demo"
88
minSdkVersion 16
9-
targetSdkVersion 31
10-
versionCode 1202
11-
versionName "12.2"
9+
targetSdkVersion 33
10+
versionCode 1203
11+
versionName "12.3"
1212
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1313
}
1414

@@ -62,13 +62,13 @@ dependencies {
6262
implementation 'com.google.android.material:material:1.4.0'
6363

6464
// 标题栏框架:https://github.com/getActivity/TitleBar
65-
implementation 'com.github.getActivity:TitleBar:10.0'
65+
implementation 'com.github.getActivity:TitleBar:10.3'
6666

6767
// 权限请求框架:https://github.com/getActivity/XXPermissions
68-
implementation 'com.github.getActivity:XXPermissions:16.6'
68+
implementation 'com.github.getActivity:XXPermissions:18.0'
6969

70-
// 悬浮窗框架:https://github.com/getActivity/XToast
71-
implementation 'com.github.getActivity:XToast:8.9'
70+
// 悬浮窗框架:https://github.com/getActivity/EasyWindow
71+
implementation 'com.github.getActivity:EasyWindow:10.0'
7272

7373
// 内存泄漏捕捉:https://github.com/square/leakcanary
7474
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10'

app/src/main/java/com/hjq/toast/demo/MainActivity.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import com.hjq.toast.style.BlackToastStyle;
2222
import com.hjq.toast.style.CustomToastStyle;
2323
import com.hjq.toast.style.WhiteToastStyle;
24-
import com.hjq.xtoast.XToast;
24+
import com.hjq.window.EasyWindow;
2525

2626
/**
2727
* author : Android 轮子哥
@@ -169,13 +169,13 @@ public void run() {
169169
}, 5000);
170170
}
171171

172-
public void combinationXToastShow(View v) {
173-
new XToast<>(this)
172+
public void combinationEasyWindowShow(View v) {
173+
new EasyWindow<>(this)
174174
.setDuration(1000)
175-
// 将 Toaster 中的 View 转移给 XToast 来显示
175+
// 将 Toaster 中的 View 转移给 EasyWindow 来显示
176176
.setContentView(Toaster.getStyle().createView(getApplication()))
177177
.setAnimStyle(android.R.style.Animation_Translucent)
178-
.setText(android.R.id.message, R.string.demo_combining_xtoast_use_result)
178+
.setText(android.R.id.message, R.string.demo_combining_window_framework_use_result)
179179
.setGravity(Gravity.BOTTOM)
180180
.setYOffset((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 50, getResources().getDisplayMetrics()))
181181
.show();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@
159159
android:layout_gravity="center_horizontal"
160160
android:layout_marginTop="10dp"
161161
android:layout_marginBottom="10dp"
162-
android:onClick="combinationXToastShow"
163-
android:text="@string/demo_combining_xtoast_use" />
162+
android:onClick="combinationEasyWindowShow"
163+
android:text="@string/demo_combining_window_framework_use" />
164164

165165
</LinearLayout>
166166

app/src/main/res/values-zh/strings.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
<string name="demo_switch_to_toast_queuing_strategy">切换成 Toast 排队显示策略</string>
1717
<string name="demo_click_show_three_toast">点我连续显示 3 个 Toast</string>
1818
<string name="demo_show_toast_in_background_state">在后台状态下显示 Toast</string>
19-
<string name="demo_combining_xtoast_use">搭配 XToast 悬浮窗框架</string>
19+
<string name="demo_combining_window_framework_use">搭配 EasyWindow 悬浮窗框架</string>
2020

21-
<string name="demo_show_toast_result">我是普通的 Toast</string>
21+
<string name="demo_show_toast_result">我是普通的 Toast我是普通的 Toast我是普通的 Toast我是普通的 Toast我是普通的 Toast</string>
2222
<string name="demo_show_short_toast_result">我是一个短 Toast</string>
2323
<string name="demo_show_long_toast_result">我是一个长 Toast</string>
2424
<string name="demo_show_toast_with_two_second_delay_result">我是延迟 2 秒显示的 Toast</string>
@@ -32,10 +32,10 @@
3232
<string name="demo_custom_toast_layout_result">我是自定义布局的 Toast(全局生效)</string>
3333
<string name="demo_switch_to_toast_queuing_strategy_result">切换到排队显示策略成功,请点击下方文本来体验效果</string>
3434
<string name="demo_show_three_toast_copywriting">我是第 %d 个 Toast</string>
35-
<string name="demo_show_toast_in_background_state_hint">系好安全带,即将跳转到手机桌面</string>
35+
<string name="demo_show_toast_in_background_state_hint">请系好安全带,即将跳转到手机桌面</string>
3636
<string name="demo_show_toast_in_background_state_snack_bar">温馨提示:安卓 10 在后台显示 Toast 需要有通知栏权限或者悬浮窗权限的情况下才可以显示</string>
3737
<string name="demo_show_toast_in_background_state_result_1">我是在后台显示的 Toast(有悬浮窗权限真的可以为所欲为)</string>
3838
<string name="demo_show_toast_in_background_state_result_2">我是在后台显示的 Toast(安卓 11 及以上在后台显示只能使用系统样式)</string>
3939
<string name="demo_show_toast_in_background_state_result_3">我是在后台显示的 Toast</string>
40-
<string name="demo_combining_xtoast_use_result">就问你溜不溜</string>
40+
<string name="demo_combining_window_framework_use_result">就问你溜不溜</string>
4141
</resources>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<string name="demo_switch_to_toast_queuing_strategy">Switch to toast queuing display strategy</string>
1818
<string name="demo_click_show_three_toast">Click and I show 3 toast in a row</string>
1919
<string name="demo_show_toast_in_background_state">Show toast in background state</string>
20-
<string name="demo_combining_xtoast_use">Combining xtoast suspension window frames</string>
20+
<string name="demo_combining_window_framework_use">Combining EasyWindow suspension window frames</string>
2121

2222
<string name="demo_show_toast_result">I am an normal toast</string>
2323
<string name="demo_show_short_toast_result">I am a short toast</string>
@@ -38,5 +38,5 @@
3838
<string name="demo_show_toast_in_background_state_result_1">I display the toast in the background (you can really do whatever you want with the floating window permission)</string>
3939
<string name="demo_show_toast_in_background_state_result_2">I am displaying the toast in the background (Android 11 and above can only use the system style in the background display)</string>
4040
<string name="demo_show_toast_in_background_state_result_3">I am displaying toast in the background</string>
41-
<string name="demo_combining_xtoast_use_result">Hello Word</string>
41+
<string name="demo_combining_window_framework_use_result">Hello Word</string>
4242
</resources>

library/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
apply plugin: 'com.android.library'
22

33
android {
4-
compileSdkVersion 31
4+
compileSdkVersion 33
55

66
defaultConfig {
77
minSdkVersion 14
8-
versionCode 1202
9-
versionName "12.2"
8+
versionCode 1203
9+
versionName "12.3"
1010
}
1111

1212
// 使用 JDK 1.8

0 commit comments

Comments
 (0)