Skip to content

Instantly share code, notes, and snippets.

@saurabharora90
Created July 10, 2019 17:16
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save saurabharora90/711a8e4dcb54dcd8f48ae8a0f8ad6a34 to your computer and use it in GitHub Desktop.
Move FAB above so that it doesn't conflict with transparent floating navigation bar
root.setOnApplyWindowInsetsListener { _, insets ->
val fabLp = fab.layoutParams as CoordinatorLayout.LayoutParams
fabLp.bottomMargin = fabOriginalBottomMargin + insets.systemWindowInsetBottom
fab.layoutParams = fabLp
insets.consumeSystemWindowInsets()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment