-
Notifications
You must be signed in to change notification settings - Fork 383
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
Introducing token selected and double selected events #369
Conversation
@mgod, would love to get this in the next release |
This seems like a pretty unintuitive interaction and it's adding another layer of complexity on the selection code, which I'd much prefer to avoid. Can you help me understand your use case? |
Listening to when a token is selected has many use cases in itself, which this solves passively and simply. The majority of the logic is the double tap listener, which I'd argue that the complexity is minimal since it's using the View's tag and keeping the library as stateless as possible. On the other hand, moving the logic out of the switch statement could greatly increase the readability in all scenarios. I understand that there should be a line drawn in needless flexibility, but I believe this functionality is valuable to consumers. Maybe a separate listener is warranted, for selecting and double selecting. Let me know. |
In your code, what are you using the double tap behavior for? |
The double tap functionality, in this specific client-driven scenario, is used for editing a recipient while filling out the "To: " field. Works out nicely since |
Got it, thanks for the clarification. I do see how this is useful in your specific case. Unfortunately, I don't think supporting this behavior is something the core library should do. Double clicking in a mobile app is an unusual behavior and I don't think it makes a lot of sense to add these behaviors to an already complex set of view interactions. This is also something that's possible to implement without changing the library. I saw you looked at #350, and the implementation note there is still valid for this. In order to get this behavior without changing the library:
I agree that the switch statement makes things less readable, but my takeaway from the code is that I should only have implemented the behavior for |
Fair enough |
Added
TokenClickStyle.DoubleSelect
to allow double select functionality and introduced token selected listener functionality