带状态栏的Activity启动一个全屏幕 不带 状态栏的dialog 会出现状态栏从有到没 弹一下过程
https://blog.csdn.net/xuwb123xuwb/article/details/89478093
继承Dialog
@Override
public void show() {
super.show();
/**
* 设置宽度全屏,要设置在show的后面
*/
getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
WindowManager.LayoutParams layoutParams = getWindow().getAttributes();
layoutParams.gravity = Gravity.BOTTOM;
layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT;
layoutParams.flags = WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
getWindow().getDecorView().setPadding(0, 0, 0, 0);
getWindow().setAttributes(layoutParams);
}