Package com.airbnb.lottie
Class LottieImageAsset
- java.lang.Object
-
- com.airbnb.lottie.LottieImageAsset
-
public class LottieImageAsset extends Object
Data class describing an image asset embedded in a Lottie json file.
-
-
Constructor Summary
Constructors Constructor Description LottieImageAsset(int width, int height, String id, String fileName, String dirName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BitmapgetBitmap()Returns the bitmap that has been stored for this image asset if one was explicitly set.StringgetDirName()StringgetFileName()intgetHeight()StringgetId()The reference id in the json file.intgetWidth()booleanhasBitmap()Returns whether this asset has an embedded Bitmap or whether the fileName is a base64 encoded bitmap.voidsetBitmap(Bitmap bitmap)Permanently sets the bitmap on this LottieImageAsset.
-
-
-
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 withLottieProperty.IMAGE.
-
hasBitmap
public boolean hasBitmap()
Returns whether this asset has an embedded Bitmap or whether the fileName is a base64 encoded bitmap.
-
-