Created
March 16, 2022 08:41
-
-
Save hiking93/77e6018fa2952b8d16347627a962b608 to your computer and use it in GitHub Desktop.
Use `OnApplyWindowInsetsListener` to get window insets.
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
class EdgeToEdgeActivity : ViewBindingActivity<ActivityMainBinding>() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setupWindow() | |
} | |
private fun setupWindow() { | |
WindowCompat.setDecorFitsSystemWindows(window, false) | |
ViewCompat.setOnApplyWindowInsetsListener(binding.root) { v, insets -> | |
TODO("Handle window insets here.") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment