public class AnimationScaleListDrawable extends DrawableContainer implements Animatable
This class implements Animatable since ProgressBar can pick this up similarly as an AnimatedVectorDrawable.
It can be defined in an XML file with the <AnimationScaleListDrawable>
element.
DrawableContainer.DrawableContainerState
Drawable.Callback, Drawable.ConstantState
Constructor and Description |
---|
AnimationScaleListDrawable() |
Modifier and Type | Method and Description |
---|---|
void |
applyTheme(Resources.Theme theme)
Applies the specified theme to this Drawable and its children.
|
void |
clearMutated()
Clears the mutated state, allowing this drawable to be cached and
mutated again.
|
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.
|
Drawable |
mutate()
Make this drawable mutable.
|
protected boolean |
onStateChange(int[] stateSet)
Set the current drawable according to the animation scale.
|
protected void |
setConstantState(DrawableContainer.DrawableContainerState state) |
void |
start()
Starts the drawable's animation.
|
void |
stop()
Stops the drawable's animation.
|
canApplyTheme, draw, getAlpha, getChangingConfigurations, getConstantState, getCurrent, getCurrentIndex, getHotspotBounds, getIntrinsicHeight, getIntrinsicWidth, getMinimumHeight, getMinimumWidth, getOpacity, getOpticalInsets, getOutline, getPadding, invalidateDrawable, isAutoMirrored, isStateful, jumpToCurrentState, onBoundsChange, onLayoutDirectionChanged, onLevelChange, scheduleDrawable, selectDrawable, setAlpha, setAutoMirrored, setColorFilter, setCurrentIndex, setDither, setEnterFadeDuration, setExitFadeDuration, setHotspot, setHotspotBounds, setTintList, setTintMode, setVisible, unscheduleDrawable, updateDensity
clearColorFilter, copyBounds, copyBounds, createFromPath, createFromResourceStream, createFromResourceStream, createFromStream, createFromXml, createFromXml, createFromXmlInner, createFromXmlInner, getBounds, getCallback, getColorFilter, getDirtyBounds, getLayoutDirection, getLevel, getState, getTransparentRegion, inflate, invalidateSelf, isFilterBitmap, isProjected, isVisible, obtainAttributes, parseTintMode, resolveOpacity, scheduleSelf, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setFilterBitmap, setLayoutDirection, setLevel, setState, setTint, setXfermode, unscheduleSelf
protected boolean onStateChange(int[] stateSet)
onStateChange
in class DrawableContainer
public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Resources.Theme theme) throws XmlPullParserException, IOException
Drawable
inflate
in class Drawable
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 Drawable mutate()
Drawable
mutate
in class DrawableContainer
Drawable.ConstantState
,
Drawable.getConstantState()
public void clearMutated()
Drawable
This is hidden because only framework drawables can be cached, so custom drawables don't need to support constant state, mutate(), or clearMutated().
clearMutated
in class DrawableContainer
public void start()
Animatable
start
in interface Animatable
public void stop()
Animatable
stop
in interface Animatable
public boolean isRunning()
Animatable
isRunning
in interface Animatable
public void applyTheme(Resources.Theme theme)
Drawable
applyTheme
in class DrawableContainer
theme
- the theme to applyprotected void setConstantState(DrawableContainer.DrawableContainerState state)
setConstantState
in class DrawableContainer