Floating action button and white background

前端 未结 3 1262
青春惊慌失措
青春惊慌失措 2020-12-16 03:21

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 fo

3条回答
  •  猫巷女王i
    2020-12-16 03:51

    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);
      }
    

提交回复
热议问题