coordinator-behaviors icon indicating copy to clipboard operation
coordinator-behaviors copied to clipboard

There is a gap between Fab and snackbar when using fabBehavior

Open ttymsd opened this issue 9 years ago • 0 comments

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()
    }

ttymsd avatar Jan 15 '17 23:01 ttymsd