TextLinks

public final class TextLinks
extends Object

java.lang.Object
   ↳ androidx.textclassifier.TextLinks


A collection of links, representing subsequences of text and the entity types (phone number, address, url, etc) they may be.

Summary

Nested classes

class TextLinks.Builder

A builder to construct a TextLinks instance. 

class TextLinks.DefaultTextLinkSpan

The default implementation of TextLinks.TextLinkSpan

class TextLinks.Request

A request object for generating TextLinks. 

interface TextLinks.SpanFactory

A factory to create spans from TextLinks. 

class TextLinks.TextLink

A link, identifying a substring of text and possible entity types for it. 

class TextLinks.TextLinkSpan

A ClickableSpan for a TextLink. 

class TextLinks.TextLinkSpanData

Contains necessary data for TextLinks.TextLinkSpan

Constants

int APPLY_STRATEGY_IGNORE

Do not replace ClickableSpans that exist where the TextLinks.TextLinkSpan needs to be applied to.

int APPLY_STRATEGY_REPLACE

Replace any ClickableSpans that exist where the TextLinks.TextLinkSpan needs to be applied to.

int STATUS_DIFFERENT_TEXT

The specified text does not match the text used to generate the links.

int STATUS_LINKS_APPLIED

Links were successfully applied to the text.

int STATUS_NO_LINKS_APPLIED

No links applied to text.

int STATUS_NO_LINKS_FOUND

No links exist to apply to text.

int STATUS_UNKNOWN

Status unknown.

Public methods

int apply(Spannable text, TextClassifier textClassifier, TextLinksParams textLinksParams)

Annotates the given text with the generated links.

static TextLinks createFromBundle(Bundle bundle)

Extracts an TextLinks object from a bundle that was added using