coordinator-behaviors
coordinator-behaviors copied to clipboard
There is a gap between Fab and snackbar when using fabBehavior
example
fab.setOnClickListener {
val snackbar = Snackbar.make(root, "test", Snackbar.LENGTH_LONG)
val behavior = BottomNavigationBehavior.from(navigation)
val layoutParams = snackbar.view.layoutParams as CoordinatorLayout.LayoutParams
behavior?.let {
if (it.animatingDirection != BottomNavigationBehavior.SCROLL_DOWN) {
layoutParams.bottomMargin = navigation.height
snackbar.view.layoutParams = layoutParams
}
}
snackbar.show()
}