public class TextRect
extends android.graphics.RectF
Modifier and Type | Class and Description |
---|---|
static class |
TextRect.TextLine |
static class |
TextRect.TextSeg |
Modifier and Type | Field and Description |
---|---|
static int |
ALIGN_BOTTOM |
static int |
ALIGN_LEFT |
static int |
ALIGN_RIGHT |
static int |
ALIGN_TOP |
static int |
ALIGN_X_CENTER |
static int |
ALIGN_Y_CENTER |
static android.os.Parcelable.Creator<TextRect> |
CREATOR |
Constructor and Description |
---|
TextRect(android.graphics.Paint paint,
float padding,
java.lang.String... lines) |
Modifier and Type | Method and Description |
---|---|
void |
alignTo(int align) |
void |
draw(android.graphics.Canvas can) |
void |
draw(android.graphics.Canvas can,
float weight) |
void |
draw(android.graphics.Canvas can,
float weight,
int borderColor) |
void |
draw(android.graphics.Canvas can,
int startLine) |
void |
draw(android.graphics.Canvas can,
int startLine,
int endLine) |
void |
draw(android.graphics.Canvas can,
int startLine,
int endLine,
float weight,
int borderColor) |
boolean |
equals(java.lang.Object o) |
int |
getNumLines() |
static android.graphics.RectF |
getTextBounds(android.graphics.Paint p,
java.lang.String text) |
int |
hashCode() |
void |
setPos(android.graphics.PointF pos) |
void |
setPos(android.graphics.PointF pos,
int align) |
void |
setTypeface(int lineNum,
android.graphics.Typeface typeface)
Set the typeface of a line (default, bold, italic, etc.)
This will affect the rectangle size
|
centerX, centerY, contains, contains, contains, describeContents, height, inset, intersect, intersect, intersects, intersects, isEmpty, offset, offsetTo, readFromParcel, round, roundOut, set, set, set, setEmpty, setIntersect, sort, toShortString, toString, union, union, union, width, writeToParcel
public static final int ALIGN_TOP
public static final int ALIGN_Y_CENTER
public static final int ALIGN_BOTTOM
public static final int ALIGN_LEFT
public static final int ALIGN_X_CENTER
public static final int ALIGN_RIGHT
public static final android.os.Parcelable.Creator<TextRect> CREATOR
public TextRect(android.graphics.Paint paint, float padding, java.lang.String... lines)
public boolean equals(java.lang.Object o)
equals
in class android.graphics.RectF
public int hashCode()
hashCode
in class android.graphics.RectF
public int getNumLines()
public void setTypeface(int lineNum, android.graphics.Typeface typeface)
lineNum
- Line numbertypeface
- Typeface enumpublic void setPos(android.graphics.PointF pos, int align)
public void setPos(android.graphics.PointF pos)
public void alignTo(int align)
public void draw(android.graphics.Canvas can, int startLine, int endLine, float weight, int borderColor)
public void draw(android.graphics.Canvas can, int startLine)
public void draw(android.graphics.Canvas can, int startLine, int endLine)
public void draw(android.graphics.Canvas can, float weight, int borderColor)
public void draw(android.graphics.Canvas can, float weight)
public void draw(android.graphics.Canvas can)
public static android.graphics.RectF getTextBounds(android.graphics.Paint p, java.lang.String text)