SpannableStringBuilder Class

Definition

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
SpannableStringBuilder
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 Object.

(Inherited from Object)
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 (Inherited from JavaObject)
JniPeerMembers
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 text and spans what over the appended part.

Append(ICharSequence, Int32, Int32)

Appends the character sequence text and spans what over the appended part.

Append(ICharSequence, Object, SpanTypes)

Appends the character sequence text and spans what over the appended part.

Append(ICharSequence)

Appends the character sequence text and spans what over the appended part.

Append(String, Int32, Int32)

Appends the character sequence text and spans what over the appended part.

Append(String, Object, SpanTypes)

Appends the character sequence text and spans what over the appended part.

Append(String)

Appends the character sequence text and spans what over the appended part.

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) (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() (Inherited from JavaObject)
Equals(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()
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)
Insert(Int32, String)
JavaFinalize()

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 start but less than or equal to limit where a span of the specified type begins or ends.

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 (st&hellip;en) of text in this Editable with a copy of the slice start&hellip;end from source.

Replace(Int32, Int32, ICharSequence)

Convenience for replace(st, en, text, 0, text.length())

Replace(Int32, Int32, String, Int32, Int32)
Replace(Int32, Int32, 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) (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)
ValueOf(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()
IJavaPeerable.Disposed() (Inherited from JavaObject)
IJavaPeerable.Finalized() (Inherited from JavaObject)
IJavaPeerable.JniObjectReferenceControlBlock (Inherited from JavaObject)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from JavaObject)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from JavaObject)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from JavaObject)
IJavaPeerable.UnregisterFromRuntime()

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)
Append(IEditable, String)
GetJniTypeName(IJavaPeerable)

Gets the JNI name of the type of the instance self.

Insert(IEditable, Int32, String, Int32, Int32)
Insert(IEditable, Int32, String)
JavaAs<TResult>(IJavaPeerable)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
Replace(IEditable, Int32, Int32, String, Int32, Int32)
Replace(IEditable, Int32, Int32, String)
SubSequence(ICharSequence, Int32, Int32)

Returns the character subsequence within the specified range.

TryJavaCast<TResult>(IJavaPeerable, TResult)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

Applies to