Clans / FloatingActionButton

Android Floating Action Button based on Material Design specification
Apache License 2.0
5.23k stars 1.13k forks source link

Can't find a FabMenu button #420

Open NikolayKul opened 6 years ago

NikolayKul commented 6 years ago

Hello! I need to enable/disable FabMenu button. So I have to write something like this:

public class MyFabMenu extends FloatingActionMenu {
...
    public void setMenuEnabled(boolean enabled) {
        final FloatingActionButton menuFab = findMenuFab();
        if (menuFab != null) {
            menuFab.setEnabled(enabled);
        }
    }
...
    @Nullable
    private FloatingActionButton findMenuFab() {
        for (int i = getChildCount() - 1; i >= 0; --i) {
            final View child = getChildAt(i);
            if (child instanceof FloatingActionButton) {
                return (FloatingActionButton) child;
            }
        }
        return null;
    }
...
}

It'd be nice if you add tag or id for mMenuButton in FloatingActionMenu#createMenuButton()