Open ankitgoyal1009 opened 7 years ago
@ankitgoyal1009 You've probably meant "less then 2 childs then hide fab menu". Anyway you can always count FABs yourself:
public class MyFabMenu extends FloatingActionMenu {
...
private int getFabCount() {
int res = 0;
for (int i = 0; i < getChildCount(); ++i) {
final View child = getChildAt(i);
if (child instanceof FloatingActionButton) {
res++
}
}
return --res; // decrement for fab menu button
}
}
I was working on my project and got a requirement that if there is no buttons in fab menu don't show it so when I looked into class there is no method to get button count in FabMenu class. For now I have checked childView count and if it is more then 2 then hide fab menu.