English | Site Directory

Android - An Open Handset Alliance Project

android.text
public class

android.text.BoringLayout

java.lang.Object
android.text.Layout
android.text.BoringLayout

A BoringLayout is a very simple Layout implementation for text that fits on a single line and is all left-to-right characters. You will probably never want to make one of these yourself; if you do, be sure to call isBoring(CharSequence, TextPaint) first to make sure the text meets the criteria.

This class 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.

Nested Classes

Summary

Constants inherited from class android.text.Layout

Public Constructors

          BoringLayout(CharSequence source, TextPaint paint, int outerwidth, Alignment align, float spacingmult, float spacingadd, Metrics metrics, boolean includepad)

Public Methods

        int  getBottomPadding()
Returns the number of extra pixels of descent padding in the bottom line of the Layout.
        int  getHeight()
Return the total height of this 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.
        float  getLineMax(int line)
Get the horizontal extent of 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.
      static  Metrics  isBoring(CharSequence text, TextPaint paint)
Returns null if not boring; the width, ascent, and descent if boring.
      static  BoringLayout  make(CharSequence source, TextPaint paint, int outerwidth, Alignment align, float spacingmult, float spacingadd, Metrics metrics, boolean includepad)
Methods inherited from class android.text.Layout
Methods inherited from class java.lang.Object

Details

Public Constructors

public BoringLayout(CharSequence source, TextPaint paint, int outerwidth, Alignment align, float spacingmult, float spacingadd, Metrics metrics, boolean includepad)

Public Methods

public int getBottomPadding()

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

public int getHeight()

Return the total height of this 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 float getLineMax(int line)

Get the horizontal extent of the specified 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.

public static Metrics isBoring(CharSequence text, TextPaint paint)

Returns null if not boring; the width, ascent, and descent if boring.

public static BoringLayout make(CharSequence source, TextPaint paint, int outerwidth, Alignment align, float spacingmult, float spacingadd, Metrics metrics, boolean includepad)

Build m5-rc15i - 10 Jun 2008 13:54