无论如何要在关闭和打开时为浮动操作菜单设置自定义图标?

Is there anyway to set custom icon for FloatingActionMenu on close and open?

我在我的项目中使用了带有 GitHub 库 link here 的 FloatingActionMenu。但是我无法自定义打开和关闭时浮动操作菜单的图标。

您可以监听点击并维护一个布尔值

boolean is_Expanded;

现在第一次点击设置

is_Expanded = !is_Expanded;

if(is_Expanded){
           fab.setBackgroundDrawable(drawable_expanded);
            }else{
           fab.setBackgroundDrawable(drawable_collapsed);

}