novoda/simple-chrome-custom-tabs

Include example of navigation using Linkify

juankysoriano opened this issue · 3 comments

It is very likely that developers want to make use of Linkify delegating navigation to a Chrome custom tab. What about providing a nice example in the demo about how to achieve this?

@juankysoriano - In its current state, Linkify doesn't provide a nice way (actually, any way) of injecting custom behaviour. All it does is create default URLSpans from any pattern matches it finds in the given textview. That means we cannot provide it with any custom intents to fire when the links it generates are clicked.

This has been complained at length here!
https://commonsware.com/blog/2013/10/23/linkify-autolink-need-custom-urlspan.html

If developers want to use this lib to open customised Chrome tabs when a text link is clicked on, it's much simpler and easier to use a custom OnClickListener rather than Linkify.

So, we'll make an example of doing that instead! Does this sound good?

So it seems that Linkify has some limitations...

Your alternative solution makes sense, and if that's the case with Linkify then it is becoming even more useful to provide an example of how to achieve the desired behaviour so go for it!

Closed, done in #21