Class LottieImageAsset


  • public class LottieImageAsset
    extends Object
    Data class describing an image asset embedded in a Lottie json file.
    • Constructor Detail

      • LottieImageAsset

        public LottieImageAsset​(int width,
                                int height,
                                String id,
                                String fileName,
                                String dirName)
    • Method Detail

      • getWidth

        public int getWidth()
      • getHeight

        public int getHeight()
      • getId

        public String getId()
        The reference id in the json file.
      • getFileName

        public String getFileName()
      • getDirName

        public String getDirName()
      • getBitmap

        @Nullable
        public Bitmap getBitmap()
        Returns the bitmap that has been stored for this image asset if one was explicitly set.
      • setBitmap

        public void setBitmap​(@Nullable
                              Bitmap bitmap)
        Permanently sets the bitmap on this LottieImageAsset. This will: 1) Overwrite any existing Bitmaps. 2) Apply to *all* animations that use this LottieComposition. If you only want to replace the bitmap for this animation, use dynamic properties with LottieProperty.IMAGE.
      • hasBitmap

        public boolean hasBitmap()
        Returns whether this asset has an embedded Bitmap or whether the fileName is a base64 encoded bitmap.