Home > Net >  How cancel fullscreen (only statusbar)
How cancel fullscreen (only statusbar)

Time:02-10

I found this code to make status bar transparent. I'm trying to cancel it. But I couldn't do. Please, help me.

fun makeFullScreen() {
        if (Build.VERSION.SDK_INT in 19..20)
            window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)

        if (Build.VERSION.SDK_INT >= 19) {
            screenState = window.decorView.systemUiVisibility
            window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
        }

        if (Build.VERSION.SDK_INT >= 21) {
            window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
            window.statusBarColor = Color.TRANSPARENT
        }
    }

CodePudding user response:

  •  Tags:  
  • Related