0

Does anyone know how to add a click listener to this FloatingActionsMenu?

Mine is ignored

floatingActionsMenu.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v){
                if(img.getVisibility()==View.VISIBLE) img.setVisibility(View.GONE);
                else img.setVisibility(View.VISIBLE);
            }
        });

To be clear: I want when I click on the main FAB for it to not only toggle, which it does now, but to also do some additional work for me.

Nouvel Travay
  • 6,292
  • 13
  • 40
  • 65

1 Answers1

0

Extend FloatingActionsMenu.java then add desired functionality to toggle:

@Override
public void toggle() {
    //do your job here
    super.toggle();
}
Tomek Gozdek
  • 206
  • 2
  • 5