-
- All Implemented Interfaces:
-
android.graphics.drawable.Animatable,androidx.vectordrawable.graphics.drawable.Animatable2Compat
public final class MovieDrawable extends Drawable implements Animatable2Compat
A Drawable that supports rendering Movies (i.e. GIFs).
NOTE: Prefer using AnimatedImageDecoder and AnimatedImageDrawable on API 28 and above.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classMovieDrawable.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Bitmap.Configconfigprivate final Scalescale
-
Constructor Summary
Constructors Constructor Description MovieDrawable(Movie movie, Bitmap.Config config, Scale scale)MovieDrawable(Movie movie, Bitmap.Config config)MovieDrawable(Movie movie)
-
Method Summary
Modifier and Type Method Description final Bitmap.ConfiggetConfig()final ScalegetScale()Unitdraw(Canvas canvas)final UnitsetRepeatCount(Integer repeatCount)Set the number of times to repeat the animation. final IntegergetRepeatCount()Get the number of times the animation will repeat. final UnitsetAnimatedTransformation(AnimatedTransformation animatedTransformation)Set the AnimatedTransformation to apply when drawing. final AnimatedTransformationgetAnimatedTransformation()Get the AnimatedTransformation. UnitsetAlpha(Integer alpha)IntegergetOpacity()UnitsetColorFilter(ColorFilter colorFilter)IntegergetIntrinsicWidth()IntegergetIntrinsicHeight()BooleanisRunning()Unitstart()Unitstop()UnitregisterAnimationCallback(Animatable2Compat.AnimationCallback callback)BooleanunregisterAnimationCallback(Animatable2Compat.AnimationCallback callback)<ERROR CLASS>clearAnimationCallbacks()-
Methods inherited from class coil3.gif.MovieDrawable
applyTheme, canApplyTheme, clearColorFilter, copyBounds, copyBounds, getAlpha, getBounds, getCallback, getChangingConfigurations, getColorFilter, getConstantState, getCurrent, getDirtyBounds, getHotspotBounds, getLayoutDirection, getLevel, getMinimumHeight, getMinimumWidth, getOpticalInsets, getOutline, getPadding, getState, getTransparentRegion, hasFocusStateSpecified, inflate, inflate, invalidateSelf, isAutoMirrored, isFilterBitmap, isProjected, isStateful, isVisible, jumpToCurrentState, mutate, onBoundsChange, onLayoutDirectionChanged, onLevelChange, onStateChange, scheduleSelf, setAutoMirrored, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setDither, setFilterBitmap, setHotspot, setHotspotBounds, setLayoutDirection, setLevel, setState, setTint, setTintBlendMode, setTintList, setTintMode, setVisible, unscheduleSelf -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
MovieDrawable
MovieDrawable(Movie movie, Bitmap.Config config, Scale scale)
-
MovieDrawable
MovieDrawable(Movie movie, Bitmap.Config config)
-
MovieDrawable
MovieDrawable(Movie movie)
-
-
Method Detail
-
getConfig
final Bitmap.Config getConfig()
-
getScale
final Scale getScale()
-
setRepeatCount
final Unit setRepeatCount(Integer repeatCount)
Set the number of times to repeat the animation.
If the animation is already running, any iterations that have already occurred will count towards the new count.
NOTE: This method matches the behavior of AnimatedImageDrawable.setRepeatCount. i.e. setting repeatCount to 2 will result in the animation playing 3 times. Setting repeatCount to 0 will result in the animation playing once.
Default: REPEAT_INFINITE
-
getRepeatCount
final Integer getRepeatCount()
Get the number of times the animation will repeat.
-
setAnimatedTransformation
final Unit setAnimatedTransformation(AnimatedTransformation animatedTransformation)
Set the AnimatedTransformation to apply when drawing.
-
getAnimatedTransformation
final AnimatedTransformation getAnimatedTransformation()
Get the AnimatedTransformation.
-
getOpacity
Integer getOpacity()
-
setColorFilter
Unit setColorFilter(ColorFilter colorFilter)
-
getIntrinsicWidth
Integer getIntrinsicWidth()
-
getIntrinsicHeight
Integer getIntrinsicHeight()
-
registerAnimationCallback
Unit registerAnimationCallback(Animatable2Compat.AnimationCallback callback)
-
unregisterAnimationCallback
Boolean unregisterAnimationCallback(Animatable2Compat.AnimationCallback callback)
-
clearAnimationCallbacks
<ERROR CLASS> clearAnimationCallbacks()
-
-
-
-