In simple buttons we do
android:clickable:"false"
button.setEnabled="false"
Is there any way to simply disable floating action button? I repeat i am not asking about hiding i am asking about disabling floating action button.
By default, the FloatingActionButton is enabled. To disable the component, set its disabled property to true .
Add the floating action button to your layout The size of the FAB, using the app:fabSize attribute or the setSize() method. The ripple color of the FAB, using the app:rippleColor attribute or the setRippleColor() method. The FAB icon, using the android:src attribute or the setImageDrawable() method.
To disable button in Flutter, just assign the null value to the onPressed parameter of the Button.
A floating action button (FAB) performs the primary, or most common, action on a screen. It appears in front of all screen content, typically as a circular shape with an icon in its center. FABs come in three types: regular, mini, and extended.
It can be done just like a button.
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab)
fab.setEnabled(false);
fab.setEnabled(true);
You can use the api
fab.setEnabled(boolean state);
Sample
If you have your FabButton you can do this:
FloatingActionButton fab = new FloatingActionButton(getActivity());
fab.setEnabled(false);
That disables the OnClick() of the FAB
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With