Place the FloatingActionMenu
inside FrameLayout
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:
@Override
void onMenuExpanded(){
mFrameLayoutWrapper.setBackgroundColor(mAlpaWhite);
}
@Override
void onMenuCollapsed(){
mFrameLayoutWrapper.setBackgroundColor(Color.TRANSPARENT);
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…