I have a Floating Action Button with a custom menu of mini Floating Action Buttons, that appears upon click on the main Floating Action Button.
The mini FABs are in a LinearLayout.
I want that after opening the FAB menu, when the user clicks elsewhere, the menu disappears. However, I haven't been able to find how to do this.
What listener do I need for this?
Any help?
Thanks.
You are most likely interested in a custom FloatingActionButton.Behavior
:
Otherwise you can simply set the Visibility
of the respective controls to Gone
based on a OnTouchListener
that checks if you are touching outside the FAB
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.