saket / Better-Link-Movement-Method

Attempts to improve how clickable links are detected, highlighted and handled in TextView
Apache License 2.0
780 stars 78 forks source link

Add support for listening to long-clicks #7

Closed saket closed 6 years ago

saket commented 6 years ago

Fixes issue #5.

@ehehhh @debjitk, would you like to take a look at this? The logic for registering long-clicks was taken from View.class.

You might also want to read the final class instead of going through the diff, because I ended up moving things around for making the code more understandable.

saket commented 6 years ago

@madhu314 I also made another change, where ClickableSpanWithText is only created when a click/long-click callback has to be dispatched instead of on every touch event.

This way,

Since this was originally written by you, I hope this doesn't break anything.

ehehhh commented 6 years ago

Looks good, man! 👍