Package icyllis.modernui.text.style
Class URLSpan
java.lang.Object
icyllis.modernui.text.style.CharacterStyle
icyllis.modernui.text.style.ClickableSpan
icyllis.modernui.text.style.URLSpan
- All Implemented Interfaces:
icyllis.modernui.text.ParcelableSpan,UpdateAppearance,Parcelable,Cloneable
Implementation of the
Text with
ClickableSpan that allows setting a url string. When
selecting and clicking on the text to which the span is attached, the URLSpan
will try to open the url, by calling Core.openURI(String).
For example, a URLSpan can be used like this:
SpannableString string = new SpannableString("Text with a url span");
string.setSpan(new URLSpan("https://google.com"), 12, 15, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
URLSpan.-
Nested Class Summary
Nested classes/interfaces inherited from interface icyllis.modernui.util.Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>, Parcelable.WriteFlags -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturn a special type identifier for this span class.getURL()Get the url string for this span.voidPerforms the click action associated with this span.toString()voidwriteToParcel(Parcel dest, int flags) The subclass implements the method to flatten its contents by calling the methods ofParcelfor its primitive values.Methods inherited from class icyllis.modernui.text.style.ClickableSpan
clone, updateDrawStateMethods inherited from class icyllis.modernui.text.style.CharacterStyle
wrap
-
Constructor Details
-
Method Details
-
getSpanTypeId
public int getSpanTypeId()Return a special type identifier for this span class.- Specified by:
getSpanTypeIdin interfaceicyllis.modernui.text.ParcelableSpan
-
writeToParcel
Description copied from interface:ParcelableThe subclass implements the method to flatten its contents by calling the methods ofParcelfor its primitive values.- Specified by:
writeToParcelin interfaceParcelable- Parameters:
dest- the parcel to write the object's data toflags- the flags about how the object should be written
-
getURL
Get the url string for this span.- Returns:
- the url string.
-
onClick
Description copied from class:ClickableSpanPerforms the click action associated with this span.- Specified by:
onClickin classClickableSpan
-
toString
- Overrides:
toStringin classClickableSpan
-