disable menu item
Is there an easy way to disable a particular menu item? I see you can remove and replace, but it would be nice to disable menu items (still show them, but semi-transparent). For instance, I may want to disable an item temporarily until a feature is available. Thanks!
Hi @joey-harward, unfortunately there is no such feature but probably you can achieve this manually setting the alpha after creating the item:
FabWithLabelView fabWithLabelView = mSpeedDialView.addActionItem(new SpeedDialActionItem.Builder(R.id.fab_custom_color, drawable).create());
fabWithLabelView.setAlpha(0.6f);
I cannot test this right now but if you try, please let me know if works or not.
Thank you for responding, but that does not seem to work. I am using version 1.0.2 and addActionItem returns void so I can't set alpha :)
Oh right, sorry about that. Then I guess you can still do it using findViewById() and the id of the action:
FabWithLabelView fabWithLabelView = mSpeedDialView.addActionItem(new SpeedDialActionItem.Builder(R.id.fab_custom_color, drawable).create());
findViewById(R.id.fab_custom_color).setAlpha(0.6f)
Yes, that does change the transparency and give the "appearance" of being disabled. Thanks.
I was hoping, however, to be able to disable it using the menu item parameter (android:enabled="false"). This would not only set it semitransparent but disable click handling for that item.
Not a bug really, more of a feature request ;)
Sure I will add it to my to do list :+1:
This issue has been automatically marked as stale because it has not had activity in the last 60 days.