FloatingActionButton icon indicating copy to clipboard operation
FloatingActionButton copied to clipboard

Can't find a FabMenu button

Open NikolayKul opened this issue 8 years ago • 0 comments

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()

NikolayKul avatar Sep 21 '17 09:09 NikolayKul