-
- All Implemented Interfaces:
-
android.graphics.drawable.Animatable,androidx.vectordrawable.graphics.drawable.Animatable2Compat
public final class GifDrawable extends Drawable implements Animatable2Compat
A drawable that can be used to display a static or animated GIF.
Usage:
val inputStream:InputStream = (...) val gifDrawable = GifDrawable.from(inputStream)By default, the drawable will respect the loop count of the decoded GIF. You can force your loop count by doing
gifDrawable.loopCount = LoopCount.INFINITE
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classGifDrawable.Companion
-
Field Summary
Fields Modifier and Type Field Description private LoopCountloopCount
-
Constructor Summary
Constructors Constructor Description GifDrawable(GifDescriptor gifDescriptor)
-
Method Summary
Modifier and Type Method Description final LoopCountgetLoopCount()final UnitsetLoopCount(LoopCount loopCount)final UnitsetRepeatCount(Integer repeatCount)final IntegergetRepeatCount()final IntegerbackgroundColor()IntegergetIntrinsicWidth()IntegergetIntrinsicHeight()Unitdraw(Canvas canvas)UnitsetAlpha(Integer alpha)UnitsetColorFilter(ColorFilter colorFilter)IntegergetOpacity()Unitstart()Unitstop()BooleanisRunning()UnitregisterAnimationCallback(Animatable2Compat.AnimationCallback callback)BooleanunregisterAnimationCallback(Animatable2Compat.AnimationCallback callback)UnitclearAnimationCallbacks()Drawable.ConstantStategetConstantState()UnitsetBounds(Integer left, Integer top, Integer right, Integer bottom)-
Methods inherited from class app.redwarp.gif.android.GifDrawable
applyTheme, canApplyTheme, clearColorFilter, copyBounds, copyBounds, getAlpha, getBounds, getCallback, getChangingConfigurations, getColorFilter, getCurrent, getDirtyBounds, getHotspotBounds, getLayoutDirection, getLevel, getMinimumHeight, getMinimumWidth, getOpticalInsets, getOutline, getPadding, getState, getTransparentRegion, inflate, inflate, invalidateSelf, isAutoMirrored, isFilterBitmap, isProjected, isStateful, isVisible, jumpToCurrentState, mutate, onBoundsChange, onLayoutDirectionChanged, onLevelChange, onStateChange, scheduleSelf, setAutoMirrored, 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
-
-
Method Detail
-
getLoopCount
final LoopCount getLoopCount()
-
setLoopCount
final Unit setLoopCount(LoopCount loopCount)
-
setRepeatCount
@Deprecated(message = Use the loopCount property) final Unit setRepeatCount(Integer repeatCount)
-
getRepeatCount
@Deprecated(message = Use the loopCount property) final Integer getRepeatCount()
-
backgroundColor
final Integer backgroundColor()
-
getIntrinsicWidth
Integer getIntrinsicWidth()
-
getIntrinsicHeight
Integer getIntrinsicHeight()
-
setColorFilter
Unit setColorFilter(ColorFilter colorFilter)
-
getOpacity
Integer getOpacity()
-
registerAnimationCallback
Unit registerAnimationCallback(Animatable2Compat.AnimationCallback callback)
-
unregisterAnimationCallback
Boolean unregisterAnimationCallback(Animatable2Compat.AnimationCallback callback)
-
clearAnimationCallbacks
Unit clearAnimationCallbacks()
-
getConstantState
Drawable.ConstantState getConstantState()
-
-
-
-