public class AnimatedRotateDrawable extends DrawableWrapper implements Animatable
Drawable.Callback, Drawable.ConstantState
Constructor and Description |
---|
AnimatedRotateDrawable()
Creates a new animated rotating drawable with no wrapped drawable.
|
Modifier and Type | Method and Description |
---|---|
void |
applyTheme(Resources.Theme t)
Applies the specified theme to this Drawable and its children.
|
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).
|
void |
inflate(Resources r,
XmlPullParser parser,
AttributeSet attrs,
Resources.Theme theme)
Inflate this Drawable from an XML resource optionally styled by a theme.
|
boolean |
isRunning()
Indicates whether the animation is running.
|
void |
setFramesCount(int framesCount) |
void |
setFramesDuration(int framesDuration) |
boolean |
setVisible(boolean visible,
boolean restart)
Set whether this Drawable is visible.
|
void |
start()
Starts the rotation animation.
|
void |
stop()
Stops the rotation animation.
|
canApplyTheme, clearMutated, getAlpha, getChangingConfigurations, getConstantState, getDrawable, getHotspotBounds, getIntrinsicHeight, getIntrinsicWidth, getOpacity, getOpticalInsets, getOutline, getPadding, invalidateDrawable, isStateful, mutate, onBoundsChange, onLayoutDirectionChanged, onLevelChange, onStateChange, scheduleDrawable, setAlpha, setColorFilter, setDrawable, setHotspot, setHotspotBounds, setTintList, setTintMode, unscheduleDrawable
clearColorFilter, copyBounds, copyBounds, createFromPath, createFromResourceStream, createFromResourceStream, createFromStream, createFromXml, createFromXml, createFromXmlInner, createFromXmlInner, getBounds, getCallback, getColorFilter, getCurrent, getDirtyBounds, getLayoutDirection, getLevel, getMinimumHeight, getMinimumWidth, getState, getTransparentRegion, inflate, invalidateSelf, isAutoMirrored, isFilterBitmap, isProjected, isVisible, jumpToCurrentState, obtainAttributes, parseTintMode, resolveOpacity, scheduleSelf, setAutoMirrored, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setDither, setFilterBitmap, setLayoutDirection, setLevel, setState, setTint, setXfermode, unscheduleSelf
public AnimatedRotateDrawable()
public void draw(Canvas canvas)
Drawable
draw
in class DrawableWrapper
canvas
- The canvas to draw intopublic void start()
The animation will run until stop()
is called. Calling this
method while the animation is already running has no effect.
start
in interface Animatable
stop()
public void stop()
stop
in interface Animatable
start()
public boolean isRunning()
Animatable
isRunning
in interface Animatable
public boolean setVisible(boolean visible, boolean restart)
Drawable
setVisible
in class DrawableWrapper
visible
- 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 inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Resources.Theme theme) throws XmlPullParserException, IOException
Drawable
inflate
in class DrawableWrapper
r
- Resources used to resolve attribute valuesparser
- XML parser from which to inflate this Drawableattrs
- Base set of attribute valuestheme
- Theme to apply, may be nullXmlPullParserException
IOException
public void applyTheme(Resources.Theme t)
Drawable
applyTheme
in class DrawableWrapper
t
- the theme to applypublic void setFramesCount(int framesCount)
public void setFramesDuration(int framesDuration)