Class LottieComposition


  • public class LottieComposition
    extends Object
    After 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 LottieAnimationView or LottieDrawable.

    • Constructor Detail

      • LottieComposition

        public LottieComposition()
    • Method Detail

      • addWarning

        public void addWarning​(String warning)
      • setHasDashPattern

        public void setHasDashPattern​(boolean hasDashPattern)
      • incrementMatteOrMaskCount

        public void incrementMatteOrMaskCount​(int amount)
      • hasDashPattern

        public boolean hasDashPattern()
        Used to determine if an animation can be drawn with hardware acceleration.
      • getMaskAndMatteCount

        public int getMaskAndMatteCount()
        Used to determine if an animation can be drawn with hardware acceleration.
      • setPerformanceTrackingEnabled

        public void setPerformanceTrackingEnabled​(boolean enabled)
      • layerModelForId

        public Layer layerModelForId​(long id)
      • getBounds

        public Rect getBounds()
      • getDuration

        public float getDuration()
      • getStartFrame

        public float getStartFrame()
      • getEndFrame

        public float getEndFrame()
      • getFrameForProgress

        public float getFrameForProgress​(float progress)
      • getProgressForFrame

        public float getProgressForFrame​(float frame)
      • getFrameRate

        public float getFrameRate()
      • getCharacters

        public androidx.collection.SparseArrayCompat<FontCharacter> getCharacters()
      • getMarker

        @Nullable
        public Marker getMarker​(String markerName)
      • hasImages

        public boolean hasImages()
      • getImages

        public Map<String,​LottieImageAsset> getImages()
        Returns a map of image asset id to LottieImageAsset. These assets contain image metadata exported from After Effects or other design tool. The resulting Bitmaps can be set directly on the image asset so they can be loaded once and reused across compositions.
      • getDurationFrames

        public float getDurationFrames()