java.lang.Object | |
↳ | android.text.SpannableStringBuilder |
This is the class for text whose content and markup can both be changed.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.text.Spanned
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new SpannableStringBuilder with empty contents
| |||||||||||
Create a new SpannableStringBuilder containing a copy of the
specified text, including its spans if any.
| |||||||||||
Create a new SpannableStringBuilder containing a copy of the
specified slice of the specified text, including its spans if any.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Convenience for append(String.valueOf(text)).
| |||||||||||
Convenience for replace(length(), length(), text, 0, text.length())
| |||||||||||
Convenience for replace(length(), length(), text, start, end)
| |||||||||||
Return the char at the specified offset within the buffer.
| |||||||||||
Convenience for replace(0, length(), "", 0, 0)
| |||||||||||
Removes all spans from the Editable, as if by calling
removeSpan(Object) on each of them.
| |||||||||||
Convenience for replace(st, en, "", 0, 0)
| |||||||||||
Copy the specified range of chars from this buffer into the
specified array, beginning at the specified offset.
| |||||||||||
Returns the array of input filters that are currently applied
to changes to this Editable.
| |||||||||||
Return the buffer offset of the end of the specified
markup object, or -1 if it is not attached to this buffer.
| |||||||||||
Return the flags of the end of the specified
markup object, or 0 if it is not attached to this buffer.
| |||||||||||
Return the buffer offset of the beginning of the specified
markup object, or -1 if it is not attached to this buffer.
| |||||||||||
Return an array of the spans of the specified type that overlap
the specified range of the buffer.
| |||||||||||
Just like getTextWidths(char[], int, int, float[]).
| |||||||||||
Convenience for replace(where, where, text, 0, text.length());
| |||||||||||
Convenience for replace(where, where, text, start, end)
| |||||||||||
Return the number of chars in the buffer.
| |||||||||||
Just like measureText(char[], int, int).
| |||||||||||
Return the next offset after
start but less than or
equal to limit where a span of the specified type
begins or ends. | |||||||||||
Remove the specified markup object from the buffer.
| |||||||||||
Convenience for replace(st, en, text, 0, text.length())
| |||||||||||
Replaces the specified range (
st…en ) of text in this
Editable with a copy of the slice start…end from
source . | |||||||||||
Sets the series of filters that will be called in succession
whenever the text of this Editable is changed, each of which has
the opportunity to limit or transform the text that is being inserted.
| |||||||||||
Mark the specified range of text with the specified object.
| |||||||||||
Return a new CharSequence containing a copy of the specified
range of this buffer, including the overlapping spans.
| |||||||||||
Return a String containing a copy of the chars in this buffer.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
| |||||||||||
From interface android.text.Editable
| |||||||||||
From interface android.text.GetChars
| |||||||||||
From interface android.text.Spannable
| |||||||||||
From interface android.text.Spanned
| |||||||||||
From interface java.lang.Appendable
| |||||||||||
From interface java.lang.CharSequence
|
Create a new SpannableStringBuilder with empty contents
Create a new SpannableStringBuilder containing a copy of the specified text, including its spans if any.
Create a new SpannableStringBuilder containing a copy of the specified slice of the specified text, including its spans if any.
Convenience for append(String.valueOf(text)).
text | the character to append. |
---|
Appendable
.Convenience for replace(length(), length(), text, 0, text.length())
text | the character sequence to append. |
---|
Appendable
.Convenience for replace(length(), length(), text, start, end)
text | the character sequence to append. |
---|---|
start | the first index of the subsequence of csq that is
appended. |
end | the last index of the subsequence of csq that is
appended. |
Appendable
.Return the char at the specified offset within the buffer.
where | the index of the character to return. |
---|
Convenience for replace(0, length(), "", 0, 0)
Removes all spans from the Editable, as if by calling removeSpan(Object) on each of them.
Convenience for replace(st, en, "", 0, 0)
Copy the specified range of chars from this buffer into the specified array, beginning at the specified offset.
Returns the array of input filters that are currently applied to changes to this Editable.
Return the buffer offset of the end of the specified markup object, or -1 if it is not attached to this buffer.
Return the flags of the end of the specified markup object, or 0 if it is not attached to this buffer.
Return the buffer offset of the beginning of the specified markup object, or -1 if it is not attached to this buffer.
Return an array of the spans of the specified type that overlap the specified range of the buffer. The kind may be Object.class to get a list of all the spans regardless of type.
Just like getTextWidths(char[], int, int, float[]).
Convenience for replace(where, where, text, 0, text.length());
Convenience for replace(where, where, text, start, end)
Return the number of chars in the buffer.
Just like measureText(char[], int, int).
Return the next offset after start
but less than or
equal to limit
where a span of the specified type
begins or ends.
Remove the specified markup object from the buffer.
Convenience for replace(st, en, text, 0, text.length())
Replaces the specified range (st…en
) of text in this
Editable with a copy of the slice start…end
from
source
. The destination slice may be empty, in which case
the operation is an insertion, or the source slice may be empty,
in which case the operation is a deletion.
Before the change is committed, each filter that was set with
setFilters(InputFilter[]) is given the opportunity to modify the
source
text.
If source
is Spanned, the spans from it are preserved into the Editable.
Existing spans within the Editable that entirely cover the replaced
range are retained, but any that were strictly within the range
that was replaced are removed. As a special case, the cursor
position is preserved even when the entire range where it is
located is replaced.
Sets the series of filters that will be called in succession whenever the text of this Editable is changed, each of which has the opportunity to limit or transform the text that is being inserted.
Mark the specified range of text with the specified object. The flags determine how the span will behave when text is inserted at the start or end of the span's range.
Return a new CharSequence containing a copy of the specified range of this buffer, including the overlapping spans.
start | the start offset of the sub-sequence. It is inclusive, that is, the index of the first character that is included in the sub-sequence. |
---|---|
end | the end offset of the sub-sequence. It is exclusive, that is, the index of the first character after those that are included in the sub-sequence |
Return a String containing a copy of the chars in this buffer.