Class AnimatedImageDrawable
java.lang.Object
icyllis.modernui.graphics.drawable.Drawable
icyllis.modernui.graphics.drawable.AnimatedImageDrawable
- All Implemented Interfaces:
Animatable,Animatable2
Drawable for drawing animated images (like GIF).
The framework handles decoding subsequent frames in another thread and updating when necessary. The drawable will only animate while it is being displayed.
-
Nested Class Summary
Nested classes/interfaces inherited from class icyllis.modernui.graphics.drawable.Drawable
Drawable.Callback, Drawable.ConstantStateNested classes/interfaces inherited from interface icyllis.modernui.graphics.drawable.Animatable2
Animatable2.AnimationCallback -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves all existing animation callbacks.voidDraw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha).static ExecutorbooleanIndicates whether the animation is running.voidAdds a callback to listen to the animation events.voidstart()Starts the drawable's animation.voidstop()Stops the drawable's animation.booleanRemoves the specified animation callback.Methods inherited from class icyllis.modernui.graphics.drawable.Drawable
applyTheme, canApplyTheme, clearMutated, copyBounds, copyBounds, getAlpha, getBounds, getCallback, getChangingConfigurations, getColorFilter, getConstantState, getCurrent, getDirtyBounds, getHotspotBounds, getIntrinsicHeight, getIntrinsicWidth, getLayoutDirection, getLevel, getMinimumHeight, getMinimumWidth, getOutline, getPadding, getState, hasFocusStateSpecified, invalidateSelf, isAutoMirrored, isStateful, isVisible, jumpToCurrentState, mutate, onBoundsChange, onLayoutDirectionChanged, onLevelChange, onStateChange, scaleFromDensity, scaleFromDensity, scheduleSelf, setAlpha, setAutoMirrored, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setHotspot, setHotspotBounds, setLayoutDirection, setLevel, setState, setTint, setTintBlendMode, setTintList, setVisible, unscheduleSelf
-
Constructor Details
-
AnimatedImageDrawable
public AnimatedImageDrawable()
-
-
Method Details
-
getAnimatedImageExecutor
-
start
public void start()Description copied from interface:AnimatableStarts the drawable's animation.- Specified by:
startin interfaceAnimatable
-
stop
public void stop()Description copied from interface:AnimatableStops the drawable's animation.- Specified by:
stopin interfaceAnimatable
-
isRunning
public boolean isRunning()Description copied from interface:AnimatableIndicates whether the animation is running.- Specified by:
isRunningin interfaceAnimatable- Returns:
- True if the animation is running, false otherwise.
-
registerAnimationCallback
Description copied from interface:Animatable2Adds a callback to listen to the animation events.- Specified by:
registerAnimationCallbackin interfaceAnimatable2- Parameters:
callback- Callback to add.
-
unregisterAnimationCallback
Description copied from interface:Animatable2Removes the specified animation callback.- Specified by:
unregisterAnimationCallbackin interfaceAnimatable2- Parameters:
callback- Callback to remove.- Returns:
falseif callback didn't exist in the call back list, ortrueif callback has been removed successfully.
-
clearAnimationCallbacks
public void clearAnimationCallbacks()Description copied from interface:Animatable2Removes all existing animation callbacks.- Specified by:
clearAnimationCallbacksin interfaceAnimatable2
-
draw
Description copied from class:DrawableDraw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha).
-