android:autoLink="web" - Does the development road...
# compose-android
k
android:autoLink="web" • Does the development road map include implementing in Compose the functionality of `TextView`'s
android:autoLink="web"
attribute, in some form or another? • In the meantime, anyone have a suggested/preferred approach?
For the second bullet, looks like https://github.com/Calvin-LL/AutoLinkText may be the way to go...?
d
Clickable links in text are an antipattern on mobile apps - the click area would not be big enough to cover minimum touch target requirements and making the touch target invisibly bigger is not straightforward because there could also be a link on the line directly above and/or directly below.
☝️ 1
Anyone, have you seen https://developer.android.com/develop/ui/compose/text/user-interactions#create-clickable-text ? Granted you don't get the "auto" part but at least you don't have to include a third party library...
k
@dorche yeah, for sure we've used
LinkAnnotation
. In all of those cases we were building the string ourselves, the difference in this most recent case is we get it from the server. So if it's no longer automatic (in the move from
TextView
to
Text
), then we'd have to parse it to look for links, etc. Or use the library. But, I do hear your comments on touch target trickiness.
👍 1
but really I agree, inline links are a mispattern on touch input
c
FWIW (not sure if it does it in this case) but compose makes sure that all touch targets are 48.dp even if something is smaller. /shruggie
e
it doesn't (and can't) for text spans
with my aforementioned custom LinkMovementMethod for example
today i learned 1
chrome on android does that touch target expansion invisibly
but it can't guarantee target size, you can easily construct cases where it can't work out