Package icyllis.modernui.text
Interface Spannable
- All Superinterfaces:
CharSequence,Spanned
- All Known Subinterfaces:
Editable
- All Known Implementing Classes:
PrecomputedText,SpannableString,SpannableStringBuilder
This is the interface for text to which markup objects can be
attached and detached.
Not all
Not all
Spannable classes have mutable text; see
Editable for that.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceFactory used byTextViewto create newSpannables. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Spannable.FactoryStandard factory.static final Spannable.FactoryNo copy factory.Fields inherited from interface icyllis.modernui.text.Spanned
SPAN_COMPOSING, SPAN_EXCLUSIVE_EXCLUSIVE, SPAN_EXCLUSIVE_INCLUSIVE, SPAN_INCLUSIVE_EXCLUSIVE, SPAN_INCLUSIVE_INCLUSIVE, SPAN_INTERMEDIATE, SPAN_MARK_MARK, SPAN_MARK_POINT, SPAN_PARAGRAPH, SPAN_POINT_MARK, SPAN_POINT_MARK_MASK, SPAN_POINT_POINT, SPAN_PRIORITY, SPAN_PRIORITY_SHIFT, SPAN_USER, SPAN_USER_SHIFT -
Method Summary
Modifier and TypeMethodDescriptionvoidremoveSpan(Object span) Remove the specified object from the range of text to which it was attached, if any.default voidremoveSpan(Object span, int flags) Remove the specified object from the range of text to which it was attached, if any.voidAttach the specified markup object to the rangestart…endof the text, or move the object to that range if it was already attached elsewhere.Methods inherited from interface java.lang.CharSequence
charAt, chars, codePoints, isEmpty, length, subSequence, toStringMethods inherited from interface icyllis.modernui.text.Spanned
getSpanEnd, getSpanFlags, getSpans, getSpans, getSpanStart, nextSpanTransition
-
Field Details
-
DEFAULT_FACTORY
Standard factory. -
NO_COPY_FACTORY
No copy factory. If the input is a Spannable, return it as is.
-
-
Method Details
-
setSpan
Attach the specified markup object to the rangestart…endof the text, or move the object to that range if it was already attached elsewhere. SeeSpannedfor an explanation of what the flags mean. The object can be one that has meaning only within your application, or it can be one that the text system will use to affect text display or behavior. Some noteworthy ones are the subclasses ofCharacterStyleandParagraphStyle, andTextWatcherandSpanWatcher.- Parameters:
span- the markup objectstart- the start char index of the spanend- the end char index of the spanflags- the flags of the span
-
removeSpan
Remove the specified object from the range of text to which it was attached, if any.
It is OK to remove an object that was never attached in the first place.- Parameters:
span- markup object to remove
-
removeSpan
Remove the specified object from the range of text to which it was attached, if any.
It is OK to remove an object that was never attached in the first place.See
Spannedfor an explanation of what the flags mean.- Parameters:
span- markup object to removeflags- flags
-