android.graphics.drawable.PaintDrawable
Drawable that draws its bounds in the given paint, with optional
rounded corners.
Summary
Public Constructors
Public Methods
Protected Methods
draw,
getChangingConfigurations,
getConstantState,
getIntrinsicHeight,
getIntrinsicWidth,
getOpacity,
getPadding,
getPaint,
getShaderFactory,
getShape,
inflate,
inflateTag,
onBoundsChange,
onDraw,
setAlpha,
setColorFilter,
setDither,
setIntrinsicHeight,
setIntrinsicWidth,
setPadding,
setPadding,
setShaderFactory,
setShape
|
|
|
|
|
void |
draw(Canvas canvas) |
|
|
|
|
|
int |
getChangingConfigurations() |
|
|
|
|
|
Drawable.ConstantState |
getConstantState() |
|
|
|
|
|
int |
getIntrinsicHeight() |
|
|
|
|
|
int |
getIntrinsicWidth() |
|
|
|
|
|
int |
getOpacity() |
|
|
|
|
|
boolean |
getPadding(Rect padding) |
|
|
|
|
|
Paint |
getPaint() |
|
|
|
|
|
ShapeDrawable.ShaderFactory |
getShaderFactory() |
|
|
|
|
|
Shape |
getShape() |
|
|
|
|
|
void |
inflate(Resources r, XmlPullParser parser, AttributeSet attrs) |
|
|
|
|
|
boolean |
inflateTag(String name, Resources r, XmlPullParser parser, AttributeSet attrs) |
|
|
|
|
|
void |
onBoundsChange(Rect bounds) |
|
|
|
|
|
void |
onDraw(Shape shape, Canvas canvas, Paint paint) |
|
|
|
|
|
void |
setAlpha(int alpha) |
|
|
|
|
|
void |
setColorFilter(ColorFilter cf) |
|
|
|
|
|
void |
setDither(boolean dither) |
|
|
|
|
|
void |
setIntrinsicHeight(int height) |
|
|
|
|
|
void |
setIntrinsicWidth(int width) |
|
|
|
|
|
void |
setPadding(int left, int top, int right, int bottom) |
|
|
|
|
|
void |
setPadding(Rect padding) |
|
|
|
|
|
void |
setShaderFactory(ShapeDrawable.ShaderFactory fact) |
|
|
|
|
|
void |
setShape(Shape s) |
clearColorFilter,
copyBounds,
copyBounds,
createFromPath,
createFromStream,
createFromXml,
createFromXmlInner,
draw,
getBounds,
getChangingConfigurations,
getConstantState,
getCurrent,
getIntrinsicHeight,
getIntrinsicWidth,
getLevel,
getMinimumHeight,
getMinimumWidth,
getOpacity,
getPadding,
getState,
getTransparentRegion,
inflate,
invalidateSelf,
isStateful,
isVisible,
onBoundsChange,
onLevelChange,
onStateChange,
resolveOpacity,
scheduleSelf,
setAlpha,
setBounds,
setBounds,
setCallback,
setChangingConfigurations,
setColorFilter,
setColorFilter,
setDither,
setFilterBitmap,
setLevel,
setState,
setVisible,
unscheduleSelf
|
|
|
|
|
void |
clearColorFilter() |
|
|
final |
|
|
Rect |
copyBounds() |
|
|
final |
|
|
void |
copyBounds(Rect bounds) |
|
|
|
static |
|
Drawable |
createFromPath(String pathName) |
|
|
|
static |
|
Drawable |
createFromStream(InputStream is, String srcName) |
|
|
|
static |
|
Drawable |
createFromXml(Resources r, XmlPullParser parser) |
|
|
|
static |
|
Drawable |
createFromXmlInner(Resources r, XmlPullParser parser, AttributeSet attrs) |
abstract |
|
|
|
|
void |
draw(Canvas canvas) |
|
|
final |
|
|
Rect |
getBounds() |
|
|
|
|
|
int |
getChangingConfigurations() |
|
|
|
|
|
Drawable.ConstantState |
getConstantState() |
|
|
|
|
|
Drawable |
getCurrent() |
|
|
|
|
|
int |
getIntrinsicHeight() |
|
|
|
|
|
int |
getIntrinsicWidth() |
|
|
final |
|
|
int |
getLevel() |
|
|
|
|
|
int |
getMinimumHeight() |
|
|
|
|
|
int |
getMinimumWidth() |
abstract |
|
|
|
|
int |
getOpacity() |
|
|
|
|
|
boolean |
getPadding(Rect padding) |
|
|
|
|
|
int[] |
getState() |
|
|
|
|
|
Region |
getTransparentRegion() |
|
|
|
|
|
void |
inflate(Resources r, XmlPullParser parser, AttributeSet attrs) |
|
|
|
|
|
void |
invalidateSelf() |
|
|
|
|
|
boolean |
isStateful() |
|
|
final |
|
|
boolean |
isVisible() |
|
|
|
|
|
void |
onBoundsChange(Rect bounds) |
|
|
|
|
|
boolean |
onLevelChange(int level) |
|
|
|
|
|
boolean |
onStateChange(int[] state) |
|
|
|
static |
|
int |
resolveOpacity(int op1, int op2) |
|
|
|
|
|
void |
scheduleSelf(Runnable what, long when) |
abstract |
|
|
|
|
void |
setAlpha(int alpha) |
|
|
|
|
|
void |
setBounds(Rect bounds) |
|
|
|
|
|
void |
setBounds(int left, int top, int right, int bottom) |
|
|
final |
|
|
void |
setCallback(Drawable.Callback cb) |
|
|
|
|
|
void |
setChangingConfigurations(int configs) |
abstract |
|
|
|
|
void |
setColorFilter(ColorFilter cf) |
|
|
|
|
|
void |
setColorFilter(int color, PorterDuff.Mode mode) |
|
|
|
|
|
void |
setDither(boolean dither) |
|
|
|
|
|
void |
setFilterBitmap(boolean filter) |
|
|
final |
|
|
boolean |
setLevel(int level) |
|
|
|
|
|
boolean |
setState(int[] stateSet) |
|
|
|
|
|
boolean |
setVisible(boolean visible, boolean restart) |
|
|
|
|
|
void |
unscheduleSelf(Runnable what) |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Constructors
public
PaintDrawable(int color)
Public Methods
public
void
setCornerRadii(float[] radii)
Specify radii for each of the 4 corners. For each corner, the array
contains 2 values, [X_radius, Y_radius]. The corners are ordered
top-left, top-right, bottom-right, bottom-left
Parameters
radii
| the x and y radii of the corners
|
public
void
setCornerRadius(float radius)
Specify radius for the corners of the rectangle. If this is > 0, then the
drawable is drawn in a round-rectangle, rather than a rectangle.
Parameters
radius
| the radius for the corners of the rectangle
|
Protected Methods
protected
boolean
inflateTag(String name, Resources r, XmlPullParser parser, AttributeSet attrs)
Subclasses override this to parse custom subelements.
If you handle it, return true, else return super.inflateTag(...).