带状态栏的Activity启动一个全屏幕 不带 状态栏的dialog 会出现状态栏从有到没 弹一下过程

    https://blog.csdn.net/xuwb123xuwb/article/details/89478093

    1. 继承Dialog
    2. @Override
    3. public void show() {
    4. super.show();
    5. /**
    6. * 设置宽度全屏,要设置在show的后面
    7. */
    8. getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    9. WindowManager.LayoutParams layoutParams = getWindow().getAttributes();
    10. layoutParams.gravity = Gravity.BOTTOM;
    11. layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
    12. layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT;
    13. layoutParams.flags = WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
    14. getWindow().getDecorView().setPadding(0, 0, 0, 0);
    15. getWindow().setAttributes(layoutParams);
    16. }