在开启了导航栏的项目上,想要全屏显示一个悬浮窗口,比如:手势唤醒动画窗口,如果没有设置窗口的布局参数
导航栏会显示出来,影响窗口的全屏显示
所以添加窗口的布局参数是关键,按以下设置是有效的:
private mLp;
private WindowManager mWm = (WindowManager) getSystemService(this.WINDOW_SERVICE);
设置布局参数,红色部分是关键参数
mLp = new ();
= PixelFormat.RGBA_8888;
= .TYPE_DRAG;
= | ;
|= .FLAG_NOT_FOCUSABLE
| .FLAG_LAYOUT_NO_LIMITS;
= 0;
= 0;
Display display = ();
Point p = new Point();
(p);
= ;
= ;
("GestureAnim");
添加并显示窗口
(mLayout, mLp);