Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpeedDialMenu not showing #2

Closed
TurhanOz opened this issue Jun 1, 2016 · 6 comments
Closed

SpeedDialMenu not showing #2

TurhanOz opened this issue Jun 1, 2016 · 6 comments

Comments

@TurhanOz
Copy link

TurhanOz commented Jun 1, 2016

If a ClickListener is set to the FAB, the speedDialMenu doesn't show when clicked (otherwise it shows).
Cheers

@TurhanOz
Copy link
Author

TurhanOz commented Jun 1, 2016

This is due to the fact that the setOnClickListener() reset the adapter for no reason.
@OverRide
public void setOnClickListener(OnClickListener listener) {
this.menuAdapter = null;
this.listener = listener;
}
Cheers

@markormesher
Copy link
Owner

Thanks for raising this. There is actually a good reason that the menu adapter is reset: as per Material Design specs, the FAB is intended to work as a standard button or as an access point for the speed-dial menu, but not both. Setting one option disables the other; this is alluded to in the README.md file, but it definitely could be clearer.

I'm already planning to change the onClick listener to a more flexible callback interface, so I'll make sure that includes callbacks for the speed-dial menu opening and closing.

@TurhanOz
Copy link
Author

TurhanOz commented Jun 1, 2016

Hi Mark,
Indeed, the developer is responsible for matching the behavior recommanded by the specs, but I don't think it should be enforced by the library.

Here is my point :

  • the reason why I need to set a listener on the fab is simply adding a tracking event and not triggering an user 'action'.
  • in my situation, I have to workaround this by setting the listener first and feeding the adapter after. But it was confusing because the method name should match the expected behaviour (setOnClickListener shoud only set the listener, otherwise I would have called it setOnClickListenerAndResetSpeedDial (or resetAdapter or something...)
  • this is adding extra investigation which could be saved. The developer should be aware of the spec and reset the adapter if he will use the listener in conjuction with the speed dial capabilities.

What do you think ?
Cheers

@markormesher
Copy link
Owner

I agree, mostly, with your points, and it's one of the main reasons I'm putting together the callback layer instead of the current system. It's the way it is right now because that's what supported my use cases when it was just a personal project. The new callback should be pushed in a couple of days when I get some time off.

@TurhanOz
Copy link
Author

TurhanOz commented Jun 1, 2016

Thanks 👍 :)

@markormesher
Copy link
Owner

Fixed in release 1.2.0 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants