In fact, I search a way to mimic the FAB's inbox. When user press the red button, an opac view and a menu should appear. Because images are more more meaningful, see the following picture
I know it exists this wonderful library (https://github.com/futuresimple/android-floating-action-button) and with this library, i can display floating action menu. But my problem is displaying the white background (with opacity). I didn't find a solution to solve my problem ...
Thx in advance
Place the
FloatingActionMenu
insideFrameLayout
that will be on top of other views and will match parent in width and height. Use same margins to lift up and offset from right the menu accordingly.Set
OnFloatingActionsMenuUpdateListener
to your floating action menu. Now toggle/replace frame layout background color inside methods:Take one co-ordinator layout with Toolbar,floating menu, your contents and relative layout. Set relative layout's background color to white transparent and set it's visibility to Gone. Set "NoActionBar" theme and use toolbar instead of action bar in activity. Now whenever you open the floating menu, set Relative layout's visibility to visible and on close set back to gone.
I achieved the effect you just mentioned by the following method. I just added a view behind the floating button and above the other layouts, and keep the view visibility GONE, until the menu is expanded. Then i set the view visibility to VISIBLE. And yes i set the background of the view to any opaque color you want.
My code
My XML file
And at the Activity or Fragment where the FloatingButtons are handled
This will give the effect you wanted. Hope this helps. It sure helped me. :)