According to the docs, we can disable the FAB by setting null
to its onClick
:
onClick - will be called when user clicked on this FAB. The FAB will be disabled when it is null.
When I tried it I stumbled across that the onClick
parameter is not nullable,
So, how to disable the FAB?
Currently (
1.x.y
) theFloatingActionButton
doesn't support theenabled
property.As workaround you can use a
Button
with aCircleShape
.If you want to use a
FloatingActionButton
you can do something like:with: