We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d26e398 commit da2bf78Copy full SHA for da2bf78
library/src/main/java/com/hjq/toast/ToastImpl.java
@@ -154,6 +154,15 @@ public void run() {
154
params.horizontalMargin = mToast.getHorizontalMargin();
155
params.windowAnimations = mToast.getAnimationsId();
156
157
+ // 指定 WindowManager 忽略系统窗口可见性的影响
158
+ // 例如下面这些的显示和隐藏都会影响当前 WindowManager 的显示(触发位置调整)
159
+ // WindowInsets.Type.statusBars():状态栏
160
+ // WindowInsets.Type.navigationBars():导航栏
161
+ // WindowInsets.Type.ime():输入法(软键盘)
162
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
163
+ params.setFitInsetsIgnoringVisibility(true);
164
+ }
165
+
166
// 如果是全局显示
167
if (mGlobalShow) {
168
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
0 commit comments