android.text
public
interface
android.text.Spannable
This is the interface for text to which markup objects can be
attached and detached. Not all Spannable classes have mutable text;
see Editable for that.
Nested Classes
Known Indirect Subclasses
Editable |
This is the interface for text whose content and markup
can be changed (as opposed
to immutable text like Strings). |
SpannableString |
This is the class for text whose content is immutable but to which
markup objects can be attached and detached. |
SpannableStringBuilder |
This is the class for text whose content and markup can both be changed. |
Summary
SPAN_EXCLUSIVE_EXCLUSIVE,
SPAN_EXCLUSIVE_INCLUSIVE,
SPAN_INCLUSIVE_EXCLUSIVE,
SPAN_INCLUSIVE_INCLUSIVE,
SPAN_MARK_MARK,
SPAN_MARK_POINT,
SPAN_PARAGRAPH,
SPAN_POINT_MARK,
SPAN_POINT_POINT,
SPAN_PRIORITY,
SPAN_PRIORITY_SHIFT,
SPAN_USER,
SPAN_USER_SHIFT
|
|
|
Value |
|
int |
SPAN_EXCLUSIVE_EXCLUSIVE |
Spans of type SPAN_EXCLUSIVE_EXCLUSIVE do not expand
to include text inserted at either their starting or ending point. |
33 |
0x00000021 |
int |
SPAN_EXCLUSIVE_INCLUSIVE |
Non-0-length spans of type SPAN_INCLUSIVE_EXCLUSIVE expand
to include text inserted at their ending point but not at their
starting point. |
34 |
0x00000022 |
int |
SPAN_INCLUSIVE_EXCLUSIVE |
Non-0-length spans of type SPAN_INCLUSIVE_EXCLUSIVE expand
to include text inserted at their starting point but not at their
ending point. |
17 |
0x00000011 |
int |
SPAN_INCLUSIVE_INCLUSIVE |
Spans of type SPAN_INCLUSIVE_INCLUSIVE expand
to include text inserted at either their starting or ending point. |
18 |
0x00000012 |
int |
SPAN_MARK_MARK |
0-length spans with type SPAN_MARK_MARK behave like text marks:
they remain at their original offset when text is inserted
at that offset. |
17 |
0x00000011 |
int |
SPAN_MARK_POINT |
SPAN_MARK_POINT is a synonym for SPAN_INCLUSIVE_INCLUSIVE. |
18 |
0x00000012 |
int |
SPAN_PARAGRAPH |
SPAN_PARAGRAPH behaves like SPAN_INCLUSIVE_EXCLUSIVE
(SPAN_MARK_MARK), except that if either end of the span is
at the end of the buffer, that end behaves like _POINT
instead (so SPAN_INCLUSIVE_INCLUSIVE if it starts in the
middle and ends at the end, or SPAN_EXCLUSIVE_INCLUSIVE
if it both starts and ends at the end). |
51 |
0x00000033 |
int |
SPAN_POINT_MARK |
SPAN_POINT_MARK is a synonym for SPAN_EXCLUSIVE_EXCLUSIVE. |
33 |
0x00000021 |
int |
SPAN_POINT_POINT |
0-length spans with type SPAN_POINT_POINT behave like cursors:
they are pushed forward by the length of the insertion when text
is inserted at their offset. |
34 |
0x00000022 |
int |
SPAN_PRIORITY |
The bits specified by the SPAN_PRIORITY bitmap determine the order
of change notifications -- higher numbers go first. |
16711680 |
0x00ff0000 |
int |
SPAN_PRIORITY_SHIFT |
The bits numbered just above SPAN_PRIORITY_SHIFT determine the order
of change notifications -- higher numbers go first. |
16 |
0x00000010 |
int |
SPAN_USER |
The bits specified by the SPAN_USER bitfield are available
for callers to use to store scalar data associated with their
span object. |
-16777216 |
0xff000000 |
int |
SPAN_USER_SHIFT |
The bits numbered SPAN_USER_SHIFT and above are available
for callers to use to store scalar data associated with their
span object. |
24 |
0x00000018 |
Public Methods
Details
Public Methods
public
void
removeSpan(Object what)
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.
public
void
setSpan(Object what, int start, int end, int flags)
Attach the specified markup object to the range
start…end
of the text, or move the object to that range if it was already
attached elsewhere. See
Spanned for 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 of
CharacterStyle and
ParagraphStyle, and
TextWatcher and
SpanWatcher.