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

OnColorSelectionListener as SAM #27

Open
ligi opened this issue Oct 17, 2018 · 2 comments
Open

OnColorSelectionListener as SAM #27

ligi opened this issue Oct 17, 2018 · 2 comments
Labels

Comments

@ligi
Copy link
Contributor

ligi commented Oct 17, 2018

thanks for the library - really like it! I just find the OnColorSelectionListener a bit clumsy to use from Kotlin as you cannot just pass a lambda. What do you think converting it to a SAM so we can use it this way and have nicer code?
My suggestion would be to combine onColorSelected onColorSelectionStart onColorSelectionEnd and differentiate via a parameter (e.g. an enum SELECTED,START,END)
I could also provide this as a PR - but wanted your opinion first as it is a breaking change.

@ligi ligi changed the title OnColorSelectionListener OnColorSelectionListener as SAM Oct 17, 2018
@thsaravana
Copy link
Member

thsaravana commented Oct 18, 2018

@ligi Could you show a usage of this interface for a client who's overriding all the 3 methods in the interface? We want to see how it would look like at the client code.

@ligi
Copy link
Contributor Author

ligi commented Oct 19, 2018

It would then just be a when/switch depending on the parameter inside

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

No branches or pull requests

2 participants