-
public class LottieCompositionAfter Effects/Bodymovin composition model. This is the serialized model from which the animation will be created. It is designed to be stateless, cacheable, and shareable.
To create one, use LottieCompositionFactory.
It can be used with a com.airbnb.lottie.LottieAnimationView or com.airbnb.lottie.LottieDrawable.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classLottieComposition.FactoryThis will be removed in the next version of Lottie. LottieCompositionFactory has improvedAPI names, failure handlers, and will return in-progress tasks so you will never parse the sameanimation twice in parallel.
-
Field Summary
Fields Modifier and Type Field Description private final PerformanceTrackerperformanceTrackerprivate Map<String, List<Layer>>precompsprivate Map<String, LottieImageAsset>imagesprivate Map<String, Font>fontsprivate List<Marker>markersprivate SparseArrayCompat<FontCharacter>charactersprivate List<Layer>layersprivate Rectboundsprivate floatstartFrameprivate floatendFrameprivate floatframeRateprivate booleanhasDashPatternprivate intmaskAndMatteCountprivate intunscaledWidthprivate intunscaledHeight
-
Method Summary
Modifier and Type Method Description PerformanceTrackergetPerformanceTracker()List<Layer>getPrecomps(String id)Map<String, LottieImageAsset>getImages()Returns a map of image asset id to LottieImageAsset. Map<String, Font>getFonts()List<Marker>getMarkers()SparseArrayCompat<FontCharacter>getCharacters()List<Layer>getLayers()RectgetBounds()floatgetStartFrame()floatgetEndFrame()floatgetFrameRate()voidsetHasDashPattern(boolean hasDashPattern)intgetMaskAndMatteCount()Used to determine if an animation can be drawn with hardware acceleration. intgetUnscaledWidth()intgetUnscaledHeight()voidinit(Rect bounds, float startFrame, float endFrame, float frameRate, List<Layer> layers, LongSparseArray<Layer> layerMap, Map<String, List<Layer>> precomps, Map<String, LottieImageAsset> images, float imagesDpScale, SparseArrayCompat<FontCharacter> characters, Map<String, Font> fonts, List<Marker> markers, int unscaledWidth, int unscaledHeight)voidaddWarning(String warning)voidincrementMatteOrMaskCount(int amount)booleanhasDashPattern()Used to determine if an animation can be drawn with hardware acceleration. voidsetPerformanceTrackingEnabled(boolean enabled)LayerlayerModelForId(long id)floatgetDuration()floatgetFrameForProgress(float progress)floatgetProgressForFrame(float frame)MarkergetMarker(String markerName)booleanhasImages()floatgetDurationFrames()StringtoString()-
-
Method Detail
-
getPerformanceTracker
PerformanceTracker getPerformanceTracker()
-
getPrecomps
@RestrictTo(value = RestrictTo.Scope.LIBRARY)@Nullable() List<Layer> getPrecomps(String id)
-
getImages
Map<String, LottieImageAsset> getImages()
Returns a map of image asset id to LottieImageAsset. These assets contain image metadata exportedfrom After Effects or other design tool. The resulting Bitmaps can be set directly on the image asset sothey can be loaded once and reused across compositions.If the context dp scale has changed since the last time images were retrieved, images will be rescaled.
-
getMarkers
List<Marker> getMarkers()
-
getCharacters
SparseArrayCompat<FontCharacter> getCharacters()
-
getStartFrame
float getStartFrame()
-
getEndFrame
float getEndFrame()
-
getFrameRate
float getFrameRate()
-
setHasDashPattern
@RestrictTo(value = RestrictTo.Scope.LIBRARY) void setHasDashPattern(boolean hasDashPattern)
-
getMaskAndMatteCount
@RestrictTo(value = RestrictTo.Scope.LIBRARY) int getMaskAndMatteCount()
Used to determine if an animation can be drawn with hardware acceleration.
-
getUnscaledWidth
int getUnscaledWidth()
-
getUnscaledHeight
int getUnscaledHeight()
-
init
@RestrictTo(value = RestrictTo.Scope.LIBRARY) void init(Rect bounds, float startFrame, float endFrame, float frameRate, List<Layer> layers, LongSparseArray<Layer> layerMap, Map<String, List<Layer>> precomps, Map<String, LottieImageAsset> images, float imagesDpScale, SparseArrayCompat<FontCharacter> characters, Map<String, Font> fonts, List<Marker> markers, int unscaledWidth, int unscaledHeight)
-
addWarning
@RestrictTo(value = RestrictTo.Scope.LIBRARY) void addWarning(String warning)
-
incrementMatteOrMaskCount
@RestrictTo(value = RestrictTo.Scope.LIBRARY) void incrementMatteOrMaskCount(int amount)
-
hasDashPattern
@RestrictTo(value = RestrictTo.Scope.LIBRARY) boolean hasDashPattern()
Used to determine if an animation can be drawn with hardware acceleration.
-
setPerformanceTrackingEnabled
void setPerformanceTrackingEnabled(boolean enabled)
-
layerModelForId
@RestrictTo(value = RestrictTo.Scope.LIBRARY) Layer layerModelForId(long id)
-
getDuration
float getDuration()
-
getFrameForProgress
float getFrameForProgress(float progress)
-
getProgressForFrame
float getProgressForFrame(float frame)
-
hasImages
boolean hasImages()
-
getDurationFrames
float getDurationFrames()
-
-
-
-