Solution 1 :
With a BottomAppBar
and a FloatingActionButton
just use:
fab.hide()
Problem :
I have a FAB in my layout that is anchored to the BottomAppBar. On certain screens, I want to display the FAB (and the cutout), on other I want it gone.
this is my layout containing the FAB and BottomAppBar.
this is my BaseFragment, where I handle whether or not the FAB should be visible.
My app is built in a way, where the fab isn’t visible on the first screen.
When I use View.GONE for my visibility, the fab and cutout are correct on screens WITH a fab, but on screens WITHOUT a fab, the cutout remains.
When I use View.INVISIBLE for my visibility, the fab is correct but the cutout doesn’t exist on screens WITH a fab, but on screens without a fab, both are correct.
Comments
Comment posted by Gabriele Mariotti
just use
Comment posted by TormundThunderfist
@GabrieleMariotti I love you. If you want, you can post your comment as an answer and I’ll mark it as such