Skip to content

Instantly share code, notes, and snippets.

@hiking93
Last active March 17, 2022 07:23
Show Gist options
  • Save hiking93/f754d700fce027cde263b86333a5f713 to your computer and use it in GitHub Desktop.
Save hiking93/f754d700fce027cde263b86333a5f713 to your computer and use it in GitHub Desktop.
Update padding with system window insets.
binding.root.updatePadding(
left = systemWindowInsets.left,
right = systemWindowInsets.right,
)
binding.appBarLayout.updatePadding(
top = systemWindowInsets.top,
)
binding.recyclerView.updatePadding(
bottom = systemWindowInsets.bottom + 8f.dpToPxSize(v.context),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment