IT. Expert System.

Android Reference

SpannableStringBuilder


android.text

Class SpannableStringBuilder

    • Constructor Detail

      • SpannableStringBuilder

        public SpannableStringBuilder()
        Create a new SpannableStringBuilder with empty contents
      • SpannableStringBuilder

        public SpannableStringBuilder(CharSequence text)
        Create a new SpannableStringBuilder containing a copy of the specified text, including its spans if any.
      • SpannableStringBuilder

        public SpannableStringBuilder(CharSequence text,
                              int start,
                              int end)
        Create a new SpannableStringBuilder containing a copy of the specified slice of the specified text, including its spans if any.
    • Method Detail

      • charAt

        public char charAt(int where)
        Return the char at the specified offset within the buffer.
        Specified by:
        charAt in interface CharSequence
        Parameters:
        where - the index of the character to return.
        Returns:
        the requested character.
      • length

        public int length()
        Return the number of chars in the buffer.
        Specified by:
        length in interface CharSequence
        Returns:
        the number of characters.
      • replace

        public SpannableStringBuilder replace(int start,
                                     int end,
                                     CharSequence tb,
                                     int tbstart,
                                     int tbend)
        Description copied from interface: Editable
        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 Editable.setFilters(android.text.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.

        Specified by:
        replace in interface Editable
        Returns:
        a reference to this object.
      • setSpan

        public void setSpan(Object what,
                   int start,
                   int end,
                   int flags)
        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.
        Specified by:
        setSpan in interface Spannable
      • removeSpan

        public void removeSpan(Object what)
        Remove the specified markup object from the buffer.
        Specified by:
        removeSpan in interface Spannable
      • getSpanStart

        public int getSpanStart(Object what)
        Return the buffer offset of the beginning of the specified markup object, or -1 if it is not attached to this buffer.
        Specified by:
        getSpanStart in interface Spanned
      • getSpanEnd

        public int getSpanEnd(Object what)
        Return the buffer offset of the end of the specified markup object, or -1 if it is not attached to this buffer.
        Specified by:
        getSpanEnd in interface Spanned
      • getSpanFlags

        public int getSpanFlags(Object what)
        Return the flags of the end of the specified markup object, or 0 if it is not attached to this buffer.
        Specified by:
        getSpanFlags in interface Spanned
      • getSpans

        public <T> T[] getSpans(int queryStart,
                       int queryEnd,
                       Class<T> kind)
        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.
        Specified by:
        getSpans in interface Spanned
      • nextSpanTransition

        public int nextSpanTransition(int start,
                             int limit,
                             Class kind)
        Return the next offset after start but less than or equal to limit where a span of the specified type begins or ends.
        Specified by:
        nextSpanTransition in interface Spanned
      • subSequence

        public CharSequence subSequence(int start,
                               int end)
        Return a new CharSequence containing a copy of the specified range of this buffer, including the overlapping spans.
        Specified by:
        subSequence in interface CharSequence
        Parameters:
        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
        Returns:
        the requested sub-sequence.
      • getChars

        public void getChars(int start,
                    int end,
                    char[] dest,
                    int destoff)
        Copy the specified range of chars from this buffer into the specified array, beginning at the specified offset.
        Specified by:
        getChars in interface GetChars
      • toString

        public String toString()
        Return a String containing a copy of the chars in this buffer.
        Specified by:
        toString in interface CharSequence
        Overrides:
        toString in class Object
        Returns:
        a printable representation of this object.
      • substring

        public String substring(int start,
                       int end)
        Return a String containing a copy of the chars in this buffer, limited to the [start, end[ range.
      • drawText

        public void drawText(Canvas c,
                    int start,
                    int end,
                    float x,
                    float y,
                    Paint p)
        Don't call this yourself -- exists for Canvas to use internally.
        Specified by:
        drawText in interface GraphicsOperations
      • drawTextRun

        public void drawTextRun(Canvas c,
                       int start,
                       int end,
                       int contextStart,
                       int contextEnd,
                       float x,
                       float y,
                       int flags,
                       Paint p)
        Don't call this yourself -- exists for Canvas to use internally.
        Specified by:
        drawTextRun in interface GraphicsOperations
      • measureText

        public float measureText(int start,
                        int end,
                        Paint p)
        Don't call this yourself -- exists for Paint to use internally.
        Specified by:
        measureText in interface GraphicsOperations
      • getTextWidths

        public int getTextWidths(int start,
                        int end,
                        float[] widths,
                        Paint p)
        Don't call this yourself -- exists for Paint to use internally.
        Specified by:
        getTextWidths in interface GraphicsOperations
      • getTextRunAdvances

        public float getTextRunAdvances(int start,
                               int end,
                               int contextStart,
                               int contextEnd,
                               int flags,
                               float[] advances,
                               int advancesPos,
                               Paint p)
        Don't call this yourself -- exists for Paint to use internally.
        Specified by:
        getTextRunAdvances in interface GraphicsOperations
      • getTextRunAdvances

        public float getTextRunAdvances(int start,
                               int end,
                               int contextStart,
                               int contextEnd,
                               int flags,
                               float[] advances,
                               int advancesPos,
                               Paint p,
                               int reserved)
        Don't call this yourself -- exists for Paint to use internally.
        Specified by:
        getTextRunAdvances in interface GraphicsOperations
      • getTextRunCursor

        @Deprecated
        public int getTextRunCursor(int contextStart,
                                      int contextEnd,
                                      int flags,
                                      int offset,
                                      int cursorOpt,
                                      Paint p)
        Deprecated. This is an internal method, refrain from using it in your code
        Returns the next cursor position in the run. This avoids placing the cursor between surrogates, between characters that form conjuncts, between base characters and combining marks, or within a reordering cluster.

        The context is the shaping context for cursor movement, generally the bounds of the metric span enclosing the cursor in the direction of movement. contextStart, contextEnd and offset are relative to the start of the string.

        If cursorOpt is CURSOR_AT and the offset is not a valid cursor position, this returns -1. Otherwise this will never return a value before contextStart or after contextEnd.

        Specified by:
        getTextRunCursor in interface GraphicsOperations
        Parameters:
        contextStart - the start index of the context
        contextEnd - the (non-inclusive) end index of the context
        flags - either DIRECTION_RTL or DIRECTION_LTR
        offset - the cursor position to move from
        cursorOpt - how to move the cursor, one of CURSOR_AFTER, CURSOR_AT_OR_AFTER, CURSOR_BEFORE, CURSOR_AT_OR_BEFORE, or CURSOR_AT
        p - the Paint object that is requesting this information
        Returns:
        the offset of the next position, or -1
      • setFilters

        public void setFilters(InputFilter[] filters)
        Description copied from interface: Editable
        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.
        Specified by:
        setFilters in interface Editable
      • getFilters

        public InputFilter[] getFilters()
        Description copied from interface: Editable
        Returns the array of input filters that are currently applied to changes to this Editable.
        Specified by:
        getFilters in interface Editable


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 403 / 158731958. Delta: 1.17410 с