Skip to content

Instantly share code, notes, and snippets.

Last active Jun 25, 2021
What would you like to do?
ViewCompat.setOnApplyWindowInsetsListener(fabIncrement) { view, windowInsets ->
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.navigationBars())
// 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.
leftMargin = insets.left,
bottomMargin = insets.bottom,
rightMargin = insets.right,
topMargin =
// Return CONSUMED if you don't want want the window insets to keep being
// passed down to descendant views.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment