English | Site Directory

Android - An Open Handset Alliance Project

android.text
public class

android.text.DynamicLayout

java.lang.Object
android.text.Layout
android.text.DynamicLayout

DynamicLayout is a text layout that updates itself as the text is edited.

This is used by widgets to control text layout. You should not need to use this class directly unless you are implementing your own widget or custom display object, or need to call Canvas.drawText() directly.

Summary

Constants inherited from class android.text.Layout

Public Constructors

          DynamicLayout(CharSequence base, TextPaint paint, int width, Alignment align, float spacingmult, float spacingadd, boolean includepad)
Make a layout for the specified text that will be updated as the text is changed.
          DynamicLayout(CharSequence base, CharSequence display, TextPaint paint, int width, Alignment align, float spacingmult, float spacingadd, boolean includepad)
Make a layout for the transformed text (password transformation being the primary example of a transformation) that will be updated as the base text is changed.

Public Methods

        int  getBottomPadding()
Returns the number of extra pixels of descent padding in the bottom line of the Layout.
        boolean  getLineContainsTab(int line)
Returns whether the specified line contains one or more tabs.
        int  getLineCount()
Return the number of lines of text in this layout.
        int  getLineDescent(int line)
Return the descent of the specified line.
    final    Directions  getLineDirections(int line)
Returns an array of directionalities for the specified line.
        int  getLineStart(int line)
Return the text offset of the beginning of the specified line.
        int  getLineTop(int line)
Return the vertical position of the top of the specified line.
        int  getParagraphDirection(int line)
Returns the primary directionality of the paragraph containing the specified line.
        int  getTopPadding()
Returns the (negative) number of extra pixels of ascent padding in the top line of the Layout.
Methods inherited from class android.text.Layout
Methods inherited from class java.lang.Object

Details

Public Constructors

public DynamicLayout(CharSequence base, TextPaint paint, int width, Alignment align, float spacingmult, float spacingadd, boolean includepad)

Make a layout for the specified text that will be updated as the text is changed.

public DynamicLayout(CharSequence base, CharSequence display, TextPaint paint, int width, Alignment align, float spacingmult, float spacingadd, boolean includepad)

Make a layout for the transformed text (password transformation being the primary example of a transformation) that will be updated as the base text is changed.

Public Methods

public int getBottomPadding()

Returns the number of extra pixels of descent padding in the bottom line of the Layout.

public boolean getLineContainsTab(int line)

Returns whether the specified line contains one or more tabs.

public int getLineCount()

Return the number of lines of text in this layout.

public int getLineDescent(int line)

Return the descent of the specified line.

public final Directions getLineDirections(int line)

Returns an array of directionalities for the specified line. The array alternates counts of characters in left-to-right and right-to-left segments of the line.

public int getLineStart(int line)

Return the text offset of the beginning of the specified line. If the specified line is one beyond the last line, returns the end of the last line.

public int getLineTop(int line)

Return the vertical position of the top of the specified line. If the specified line is one beyond the last line, returns the bottom of the last line.

public int getParagraphDirection(int line)

Returns the primary directionality of the paragraph containing the specified line.

public int getTopPadding()

Returns the (negative) number of extra pixels of ascent padding in the top line of the Layout.
Build m5-rc15i - 10 Jun 2008 13:54