setFabAlignmentModeAndReplaceMenu

open fun setFabAlignmentModeAndReplaceMenu(fabAlignmentMode: Int, @MenuRes newMenu: Int)

Sets the current fabAlignmentMode and replaces the BottomAppBar's menu resource. An animated transition between the current and desired mode will be played in coordination with a menu resource swap animation.

Parameters

fabAlignmentMode

the desired fabAlignmentMode, either FAB_ALIGNMENT_MODE_CENTER or FAB_ALIGNMENT_MODE_END.

newMenu

the menu resource of a new menu to be inflated and swapped during the animation. Passing 0 for newMenu will not clear the menu but will skip all menu manipulation. If you'd like to animate the FAB's alignment and clear the menu at the same time, use getMenu().clear() and setFabAlignmentMode.