JoaquimLey / faboptions

A multi-functional FAB component with customizable options
http://joaquimley.com/
Apache License 2.0
1.04k stars 140 forks source link

Manually open and close menu #35

Closed pzienowicz closed 6 years ago

pzienowicz commented 7 years ago

Hi,

Is it possible to make open and close method as public? I want to close menu when clicking other element in activity and this function will be helpful.

JoaquimLey commented 7 years ago

Hello @pzienowicz Well, this goes a bit against the guidelines. I know the component isn't exactly following but:

Create a custom FabOptions (extend) and have a public method calling the open/close private methods.

I wanted to keep it away from the public API since it might need changes (new params etc).

What do you think?

pzienowicz commented 7 years ago

Hi @JoaquimLey.

Yes, I was thinking about this way to resolve it and of course it is correct and easy to achieve. But I think many devs want to manage the state of fabOptions in their code so you could make it easier :)

You could also think about "onBlur" feature - when clicked outside the menu, it should be closed automatically. This is exactly what I need to do, so if this will be implemented, public open/close methods are no longer needed.

What do you think? Thanks for the great library!

JoaquimLey commented 7 years ago

@pzienowicz Sorry for the late response! I missed the notification ☮️ . Thank you for the kind words 🙏 .

Well, I do get where you coming from and I can see how useful it would be but, that's actually a bit outside of the scope of the view, I would need to handle touch events that are outside of the view, as you can imagine that may cause some strange issues. Sorry but I'm a bit hesitant on opening methods, I estimate around 300 different projects using the library and once it's public it's there forever to maintain.

I'm going to leave this issue open for now and see if it gets +1's.