android.graphics.drawable
Class Drawable
java.lang.Object
android.graphics.drawable.Drawable
- Direct Known Subclasses:
- BitmapDrawable, ClipDrawable, ColorDrawable, DrawableContainer, GradientDrawable, InsetDrawable, LayerDrawable, NinePatchDrawable, PictureDrawable, RotateDrawable, ScaleDrawable, ShapeDrawable
public abstract class Drawable
- extends Object
Method Summary |
void |
clearColorFilter()
|
Rect |
copyBounds()
|
void |
copyBounds(Rect bounds)
|
static Drawable |
createFromPath(String pathName)
|
static Drawable |
createFromResourceStream(Resources res,
TypedValue value,
InputStream is,
String srcName)
|
static Drawable |
createFromResourceStream(Resources res,
TypedValue value,
InputStream is,
String srcName,
BitmapFactory.Options opts)
|
static Drawable |
createFromStream(InputStream is,
String srcName)
|
static Drawable |
createFromXml(Resources r,
org.xmlpull.v1.XmlPullParser parser)
|
static Drawable |
createFromXmlInner(Resources r,
org.xmlpull.v1.XmlPullParser parser,
AttributeSet attrs)
|
abstract void |
draw(Canvas canvas)
|
Rect |
getBounds()
|
Drawable.Callback |
getCallback()
|
int |
getChangingConfigurations()
|
Drawable.ConstantState |
getConstantState()
|
Drawable |
getCurrent()
|
int |
getIntrinsicHeight()
|
int |
getIntrinsicWidth()
|
int |
getLevel()
|
int |
getMinimumHeight()
|
int |
getMinimumWidth()
|
abstract int |
getOpacity()
|
boolean |
getPadding(Rect padding)
|
int[] |
getState()
|
Region |
getTransparentRegion()
|
void |
inflate(Resources r,
org.xmlpull.v1.XmlPullParser parser,
AttributeSet attrs)
|
void |
invalidateSelf()
|
boolean |
isStateful()
|
boolean |
isVisible()
|
void |
jumpToCurrentState()
|
Drawable |
mutate()
|
protected void |
onBoundsChange(Rect bounds)
|
protected boolean |
onLevelChange(int level)
|
protected boolean |
onStateChange(int[] state)
|
static int |
resolveOpacity(int op1,
int op2)
|
void |
scheduleSelf(Runnable what,
long when)
|
abstract void |
setAlpha(int alpha)
|
void |
setBounds(int left,
int top,
int right,
int bottom)
|
void |
setBounds(Rect bounds)
|
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)
|
boolean |
setLevel(int level)
|
boolean |
setState(int[] stateSet)
|
boolean |
setVisible(boolean visible,
boolean restart)
|
void |
unscheduleSelf(Runnable what)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Drawable
public Drawable()
draw
public abstract void draw(Canvas canvas)
setBounds
public void setBounds(int left,
int top,
int right,
int bottom)
setBounds
public void setBounds(Rect bounds)
copyBounds
public final void copyBounds(Rect bounds)
copyBounds
public final Rect copyBounds()
getBounds
public final Rect getBounds()
setChangingConfigurations
public void setChangingConfigurations(int configs)
getChangingConfigurations
public int getChangingConfigurations()
setDither
public void setDither(boolean dither)
setFilterBitmap
public void setFilterBitmap(boolean filter)
setCallback
public final void setCallback(Drawable.Callback cb)
getCallback
public Drawable.Callback getCallback()
invalidateSelf
public void invalidateSelf()
scheduleSelf
public void scheduleSelf(Runnable what,
long when)
unscheduleSelf
public void unscheduleSelf(Runnable what)
setAlpha
public abstract void setAlpha(int alpha)
setColorFilter
public abstract void setColorFilter(ColorFilter cf)
setColorFilter
public void setColorFilter(int color,
PorterDuff.Mode mode)
clearColorFilter
public void clearColorFilter()
isStateful
public boolean isStateful()
setState
public boolean setState(int[] stateSet)
getState
public int[] getState()
jumpToCurrentState
public void jumpToCurrentState()
getCurrent
public Drawable getCurrent()
setLevel
public final boolean setLevel(int level)
getLevel
public final int getLevel()
setVisible
public boolean setVisible(boolean visible,
boolean restart)
isVisible
public final boolean isVisible()
getOpacity
public abstract int getOpacity()
resolveOpacity
public static int resolveOpacity(int op1,
int op2)
getTransparentRegion
public Region getTransparentRegion()
onStateChange
protected boolean onStateChange(int[] state)
onLevelChange
protected boolean onLevelChange(int level)
onBoundsChange
protected void onBoundsChange(Rect bounds)
getIntrinsicWidth
public int getIntrinsicWidth()
getIntrinsicHeight
public int getIntrinsicHeight()
getMinimumWidth
public int getMinimumWidth()
getMinimumHeight
public int getMinimumHeight()
getPadding
public boolean getPadding(Rect padding)
mutate
public Drawable mutate()
createFromStream
public static Drawable createFromStream(InputStream is,
String srcName)
createFromResourceStream
public static Drawable createFromResourceStream(Resources res,
TypedValue value,
InputStream is,
String srcName)
createFromResourceStream
public static Drawable createFromResourceStream(Resources res,
TypedValue value,
InputStream is,
String srcName,
BitmapFactory.Options opts)
createFromXml
public static Drawable createFromXml(Resources r,
org.xmlpull.v1.XmlPullParser parser)
throws org.xmlpull.v1.XmlPullParserException,
IOException
- Throws:
org.xmlpull.v1.XmlPullParserException
IOException
createFromXmlInner
public static Drawable createFromXmlInner(Resources r,
org.xmlpull.v1.XmlPullParser parser,
AttributeSet attrs)
throws org.xmlpull.v1.XmlPullParserException,
IOException
- Throws:
org.xmlpull.v1.XmlPullParserException
IOException
createFromPath
public static Drawable createFromPath(String pathName)
inflate
public void inflate(Resources r,
org.xmlpull.v1.XmlPullParser parser,
AttributeSet attrs)
throws org.xmlpull.v1.XmlPullParserException,
IOException
- Throws:
org.xmlpull.v1.XmlPullParserException
IOException
getConstantState
public Drawable.ConstantState getConstantState()
Copyright © 2008-2012. All Rights Reserved.