setOnApplyWindowInsetsListener - statusBar color problem

Viewed 149

Why when I use

setOnApplyWindowInsetsListener

statusBar color disappears?

 fun isKeyboardVisible(view: View) {
    ViewCompat.setOnApplyWindowInsetsListener(view) { view, windowInsets ->
        val isKeyboardVisible = windowInsets.isVisible(WindowInsetsCompat.Type.ime())
        if (isKeyboardVisible) Toast.makeText(applicationContext, "opened", Toast.LENGTH_SHORT).show()
        else Toast.makeText(applicationContext, "closed", Toast.LENGTH_SHORT).show()

        windowInsets
    }
}
0 Answers
Related