Material-BottomNavigation icon indicating copy to clipboard operation
Material-BottomNavigation copied to clipboard

FAB is always 0dp above BottomNavigation

Open fmt-Println-MKO opened this issue 9 years ago • 1 comments

if the FAB is anchored to BottomNavigation and the Behavior is set on FAB (the one provided)

the FAB is always above BottomNav, doesn't matter which values are set for marginBottom on FAB or marginTop on BottomNav.

the only visible space between them is just the space the shadow takes.

according to Material Design the FAB should be 16dp above, BottomNav or Bottom

fmt-Println-MKO avatar Jan 03 '17 11:01 fmt-Println-MKO

I found a work-around for now:

  1. Copy FloatingActionButtonBehavior.java to your project.
  2. Update FloatingActionButton's app:layout_behavior to use this custom behavior.
  3. On line #87, change the code to: child.setTranslationY(t - dependency.getResources().getDimensionPixelSize(R.dimen.fab_margin));

Should the shadow height be subtracted too? Anyone know how to get the FAB button shadow height?

kt215 avatar Apr 17 '17 12:04 kt215