This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Add these lines inside your MainActivity. | |
if (Build.VERSION.SDK_INT >= 30) { | |
ViewCompat.setOnApplyWindowInsetsListener(binding.root) { view, windowInsets -> | |
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) | |
// Apply the insets as a margin to the view. Here the system is setting | |
// only the bottom, left, and right dimensions, but apply whichever insets are | |
// appropriate to your layout. You can also update the view padding | |
// if that's more appropriate. |