|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.graphics.drawable.Drawable
android.graphics.drawable.ClipDrawable
public class ClipDrawable
A drawable that clips another drawable based on this drawable's current level value. You can control how much the child drawable gets clipped in width and height based on the level, as well as a gravity to control where it is placed in its overall container. Most often used to implement things like progress bars.
| Nested Class Summary | |
|---|---|
(package private) static class |
ClipDrawable.ClipState
|
| Nested classes/interfaces inherited from class android.graphics.drawable.Drawable |
|---|
Drawable.Callback, Drawable.ConstantState |
| Field Summary | |
|---|---|
static int |
HORIZONTAL
|
static int |
VERTICAL
|
| Fields inherited from class android.graphics.drawable.Drawable |
|---|
mCallback |
| Constructor Summary | |
|---|---|
ClipDrawable()
|
|
ClipDrawable(Drawable drawable,
int gravity,
int orientation)
|
|
| Method Summary | |
|---|---|
void |
draw(Canvas canvas)
Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha) and color filter (set via setColorFilter). |
int |
getChangingConfigurations()
Return a mask of the configuration parameters for which this drawable mau change, requiring that it be re-created. |
Drawable.ConstantState |
getConstantState()
|
int |
getIntrinsicHeight()
Return the intrinsic height of the underlying drawable object. |
int |
getIntrinsicWidth()
Return the intrinsic width of the underlying drawable object. |
int |
getOpacity()
Return the opacity/transparency of this Drawable. |
boolean |
getPadding(Rect padding)
Return in padding the insets suggested by this Drawable for placing content inside the drawable's bounds. |
void |
inflate(Resources r,
XmlPullParser parser,
AttributeSet attrs)
|
void |
invalidateDrawable(Drawable who)
Called when the drawable needs to be redrawn. |
boolean |
isStateful()
Indicates whether this view will change its appearance based on state. |
protected void |
onBoundsChange(Rect bounds)
Override this in your subclass to change appearance if you recognize the specified state. |
protected boolean |
onLevelChange(int level)
Override this in your subclass to change appearance if you vary based on level. |
protected boolean |
onStateChange(int[] state)
Override this in your subclass to change appearance if you recognize the specified state. |
void |
scheduleDrawable(Drawable who,
Runnable what,
long when)
A Drawable can call this to schedule the next frame of its animation. |
void |
setAlpha(int alpha)
Specify an alpha value for the drawable. |
void |
setColorFilter(ColorFilter cf)
Specify an optional colorFilter for the drawable. |
boolean |
setVisible(boolean visible,
boolean restart)
Set whether this Drawable is visible. |
void |
unscheduleDrawable(Drawable who,
Runnable what)
A Drawable can call this to unschedule an action previously scheduled with Drawable.Callback.scheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable, long). |
| Methods inherited from class android.graphics.drawable.Drawable |
|---|
clearColorFilter, copyBounds, copyBounds, createFromPath, createFromStream, createFromXml, createFromXmlInner, getBounds, getCurrent, getLevel, getMinimumHeight, getMinimumWidth, getState, getTransparentRegion, inflateWithAttributes, invalidateSelf, isVisible, resolveOpacity, scheduleSelf, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setDither, setFilterBitmap, setLevel, setState, unscheduleSelf |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int HORIZONTAL
public static final int VERTICAL
| Constructor Detail |
|---|
ClipDrawable()
public ClipDrawable(Drawable drawable,
int gravity,
int orientation)
orientation - Bitwise-or of HORIZONTAL and/or VERTICAL| Method Detail |
|---|
public void inflate(Resources r,
XmlPullParser parser,
AttributeSet attrs)
throws XmlPullParserException,
IOException
inflate in class DrawableXmlPullParserException
IOExceptionpublic void invalidateDrawable(Drawable who)
Drawable.Callback
invalidateDrawable in interface Drawable.Callbackwho - The drawable that is requesting the update.
public void scheduleDrawable(Drawable who,
Runnable what,
long when)
Drawable.CallbackHandler.postAtTime(Runnable, Object, long) with
the parameters (what, who, when) to perform the
scheduling.
scheduleDrawable in interface Drawable.Callbackwho - The drawable being scheduled.what - The action to execute.when - The time (in milliseconds) to run. The timebase is
SystemClock.uptimeMillis()
public void unscheduleDrawable(Drawable who,
Runnable what)
Drawable.CallbackDrawable.Callback.scheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable, long). An implementation can
generally simply call
Handler.removeCallbacks(Runnable, Object) with
the parameters (what, who) to unschedule the drawable.
unscheduleDrawable in interface Drawable.Callbackwho - The drawable being unscheduled.what - The action being unscheduled.public int getChangingConfigurations()
DrawableDrawable.setChangingConfigurations(int) or 0 by default. Subclasses
may extend this to or in the changing configurations of any other
drawables they hold.
getChangingConfigurations in class DrawableConfiguration.Configurationpublic boolean getPadding(Rect padding)
Drawable
getPadding in class Drawable
public boolean setVisible(boolean visible,
boolean restart)
Drawable
setVisible in class Drawablevisible - Set to true if visible, false if not.restart - You can supply true here to force the drawable to behave
as if it has just become visible, even if it had last
been set visible. Used for example to force animations
to restart.
public void setAlpha(int alpha)
Drawable
setAlpha in class Drawablepublic void setColorFilter(ColorFilter cf)
Drawable
setColorFilter in class Drawablepublic int getOpacity()
DrawablePixelFormat:
PixelFormat.UNKNOWN,
PixelFormat.TRANSLUCENT,
PixelFormat.TRANSPARENT, or
PixelFormat.OPAQUE.
Generally a Drawable should be as conservative as possible with the
value it returns. For example, if it contains multiple child drawables
and only shows one of them at a time, if only one of the children is
TRANSLUCENT and the others are OPAQUE then TRANSLUCENT should be
returned. You can use the method Drawable.resolveOpacity(int, int) to perform a
standard reduction of two opacities to the appropriate single output.
Note that the returned value does not take into account a
custom alpha or color filter that has been applied by the client through
the Drawable.setAlpha(int) or Drawable.setColorFilter(android.graphics.ColorFilter) methods.
getOpacity in class DrawablePixelFormatpublic boolean isStateful()
Drawable
isStateful in class DrawableDrawable.setState(int[])protected boolean onStateChange(int[] state)
Drawable
onStateChange in class Drawableprotected boolean onLevelChange(int level)
Drawable
onLevelChange in class Drawableprotected void onBoundsChange(Rect bounds)
Drawable
onBoundsChange in class Drawablepublic void draw(Canvas canvas)
Drawable
draw in class Drawablecanvas - The canvas to draw intopublic int getIntrinsicWidth()
Drawable
getIntrinsicWidth in class Drawablepublic int getIntrinsicHeight()
Drawable
getIntrinsicHeight in class Drawablepublic Drawable.ConstantState getConstantState()
getConstantState in class Drawable
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||