SpannableStringBuilder Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
This is the class for text whose content and markup can both be changed.
[Android.Runtime.Register("android/text/SpannableStringBuilder", DoNotGenerateAcw=true)]
public class SpannableStringBuilder : Java.Lang.Object, Android.Text.IEditable, IDisposable, System.Collections.Generic.IEnumerable<char>
[<Android.Runtime.Register("android/text/SpannableStringBuilder", DoNotGenerateAcw=true)>]
type SpannableStringBuilder = class
inherit Object
interface IEditable
interface IGetChars
interface ICharSequence
interface seq<char>
interface IEnumerable
interface IJavaObject
interface IDisposable
interface IJavaPeerable
interface ISpannable
interface ISpanned
interface IAppendable
- Inheritance
- Attributes
- Implements
Remarks
This is the class for text whose content and markup can both be changed.
Java documentation for android.text.SpannableStringBuilder.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Constructors
| Name | Description |
|---|---|
| SpannableStringBuilder() |
Create a new SpannableStringBuilder with empty contents |
| SpannableStringBuilder(ICharSequence, Int32, Int32) |
Create a new SpannableStringBuilder containing a copy of the specified slice of the specified text, including its spans if any. |
| SpannableStringBuilder(ICharSequence) |
Create a new SpannableStringBuilder containing a copy of the specified text, including its spans if any. |
| SpannableStringBuilder(IntPtr, JniHandleOwnership) |
A constructor used when creating managed representations of JNI objects; called by the runtime. |
| SpannableStringBuilder(String, Int32, Int32) |
Create a new SpannableStringBuilder containing a copy of the specified slice of the specified text, including its spans if any. |
| SpannableStringBuilder(String) |
Create a new SpannableStringBuilder containing a copy of the specified text, including its spans if any. |
Properties
| Name | Description |
|---|---|
| Class |
Returns the runtime class of this |
| Handle |
The handle to the underlying Android instance. (Inherited from Object) |
| JniIdentityHashCode |
Gets the identity hash code assigned to this Java peer by the interop runtime. (Inherited from Object) |
| JniManagedPeerState |
Gets the state flags last assigned by the runtime. (Inherited from JavaObject) |
| JniPeerMembers |
Gets the JNI metadata used to access members of this Java binding. |
| PeerReference |
Gets the JNI object reference for this Java peer. (Inherited from Object) |
| TextWatcherDepth |
Returns the depth of TextWatcher callbacks. |
| ThresholdClass |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |
| ThresholdType |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |
Methods
| Name | Description |
|---|---|
| Append(Char) |
Appends the character sequence |
| Append(ICharSequence, Int32, Int32) |
Appends the character sequence |
| Append(ICharSequence, Object, SpanTypes) |
Appends the character sequence |
| Append(ICharSequence) |
Appends the character sequence |
| Append(String, Int32, Int32) |
Appends the character sequence |
| Append(String, Object, SpanTypes) |
Appends the character sequence |
| Append(String) |
Appends the character sequence |
| CharAt(Int32) |
Return the char at the specified offset within the buffer. |
| Clear() |
Convenience for replace(0, length(), "", 0, 0) |
| ClearSpans() |
Removes all spans from the Editable, as if by calling RemoveSpan(Object) on each of them. |
| Clone() |
Creates and returns a copy of this object. (Inherited from Object) |
| Construct(JniObjectReference, JniObjectReferenceOptions) |
Delegates construction of this peer to the runtime's value manager. (Inherited from JavaObject) |
| Delete(Int32, Int32) |
Convenience for replace(st, en, "", 0, 0) |
| Dispose() |
Releases the resources held by this Java peer. (Inherited from Object) |
| Dispose(Boolean) |
Releases the resources held by this Java peer. (Inherited from Object) |
| DisposeUnlessReferenced() |
Asks the value manager to dispose this peer unless its mapping retains this same managed instance. (Inherited from JavaObject) |
| Equals(Object) |
Tests whether another managed peer refers to the same Java object. (Inherited from JavaObject) |
| Equals(Object) |
Indicates whether some other object is "equal to" this one. (Inherited from Object) |
| GetChars(Int32, Int32, Char[], Int32) |
Copy the specified range of chars from this buffer into the specified array, beginning at the specified offset. |
| GetEnumerator() |
Enumerates the text's UTF-16 characters in index order. |
| GetFilters() |
Returns the array of input filters that are currently applied to changes to this Editable. |
| GetHashCode() |
Returns a hash code value for the object. (Inherited from Object) |
| GetSpanEnd(Object) |
Return the buffer offset of the end of the specified markup object, or -1 if it is not attached to this buffer. |
| GetSpanFlags(Object) |
Return the flags of the end of the specified markup object, or 0 if it is not attached to this buffer. |
| GetSpans(Int32, Int32, Class) |
Return an array of the spans of the specified type that overlap the specified range of the buffer. |
| GetSpanStart(Object) |
Return the buffer offset of the beginning of the specified markup object, or -1 if it is not attached to this buffer. |
| GetTextRunCursor(Int32, Int32, Int32, Int32, Int32, Paint) |
Obsolete.
Returns the next cursor position in the run. |
| Insert(Int32, ICharSequence, Int32, Int32) |
Convenience for replace(where, where, text, start, end) |
| Insert(Int32, ICharSequence) |
Convenience for replace(where, where, text, 0, text.length()); |
| Insert(Int32, String, Int32, Int32) |
Inserts a selected string range at a buffer offset. |
| Insert(Int32, String) |
Inserts the supplied string at a buffer offset. |
| JavaFinalize() |
Obsolete.
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. (Inherited from Object) |
| Length() |
Return the number of chars in the buffer. |
| NextSpanTransition(Int32, Int32, Class) |
Return the next offset after |
| Notify() |
Wakes up a single thread that is waiting on this object's monitor. (Inherited from Object) |
| NotifyAll() |
Wakes up all threads that are waiting on this object's monitor. (Inherited from Object) |
| RemoveSpan(Object) |
Remove the specified markup object from the buffer. |
| Replace(Int32, Int32, ICharSequence, Int32, Int32) |
Replaces the specified range ( |
| Replace(Int32, Int32, ICharSequence) |
Convenience for replace(st, en, text, 0, text.length()) |
| Replace(Int32, Int32, String, Int32, Int32) |
Replaces a buffer range with a selected string range. |
| Replace(Int32, Int32, String) |
Replaces a buffer range with the supplied string. |
| SetFilters(IInputFilter[]) |
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. |
| SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
| SetPeerReference(JniObjectReference, JniObjectReferenceOptions) |
Stores a reference value in the control block without creating a JNI reference copy. (Inherited from JavaObject) |
| SetSpan(Object, Int32, Int32, SpanTypes) |
Mark the specified range of text with the specified object. |
| SubSequence(Int32, Int32) |
Return a new CharSequence containing a copy of the specified range of this buffer, including the overlapping spans. |
| SubSequenceFormatted(Int32, Int32) |
Return a new CharSequence containing a copy of the specified range of this buffer, including the overlapping spans. |
| ToArray<T>() |
Creates a managed array from this Java array wrapper. (Inherited from Object) |
| ToString() |
Returns a string representation of the object. (Inherited from Object) |
| UnregisterFromRuntime() |
Unregisters this Java peer from the interop runtime. (Inherited from Object) |
| ValueOf(ICharSequence) |
Gets an editable builder, reusing an existing builder when possible. |
| ValueOf(String) |
Creates an editable text builder from a string. |
| Wait() |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>. (Inherited from Object) |
| Wait(Int64, Int32) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
| Wait(Int64) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Explicit Interface Implementations
| Name | Description |
|---|---|
| IEnumerable.GetEnumerator() |
Gets a non-generic enumerator for the text's characters. |
| IJavaPeerable.Disposed() |
Marks this peer as disposed and calls |
| IJavaPeerable.Finalized() |
Marks this peer as disposed and calls |
| IJavaPeerable.JniObjectReferenceControlBlock |
Gets the native control-block pointer used by this peer. (Inherited from JavaObject) |
| IJavaPeerable.SetJniIdentityHashCode(Int32) |
Stores the identity hash code supplied by the runtime. (Inherited from JavaObject) |
| IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) |
Replaces the stored managed peer state flags. (Inherited from JavaObject) |
| IJavaPeerable.SetPeerReference(JniObjectReference) |
Updates the peer reference and releases a disposed peer's control block when the reference is invalid. (Inherited from JavaObject) |
| IJavaPeerable.UnregisterFromRuntime() |
Removes this instance from the runtime's Java object lookup. |
Extension Methods
| Name | Description |
|---|---|
| Append(IAppendable, String, Int32, Int32) |
Appends the specified value to this character sequence. |
| Append(IAppendable, String) |
Appends the specified value to this character sequence. |
| Append(IEditable, String, Int32, Int32) |
Appends a selected string range to editable text. |
| Append(IEditable, String) |
Appends a string to editable text. |
| GetJniTypeName(IJavaPeerable) |
Gets the JNI name of the type of the instance |
| Insert(IEditable, Int32, String, Int32, Int32) |
Inserts a selected string range into editable text. |
| Insert(IEditable, Int32, String) |
Inserts a string into editable text. |
| JavaAs<TResult>(IJavaPeerable) |
Try to coerce |
| JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
| JavaCast<TResult>(IJavaObject) |
Reuses a compatible managed peer or obtains a wrapper of the requested type. |
| Replace(IEditable, Int32, Int32, String, Int32, Int32) |
Replaces an editable-text range with a selected string range. |
| Replace(IEditable, Int32, Int32, String) |
Replaces an editable-text range with a string. |
| SubSequence(ICharSequence, Int32, Int32) |
Returns the character subsequence within the specified range. |
| TryJavaCast<TResult>(IJavaPeerable, TResult) |
Try to coerce |