-
public class ApngDrawable.Companion
-
-
Field Summary
Fields Modifier and Type Field Description private final IntegerLOOP_FOREVERprivate final IntegerLOOP_INTRINSICpublic final static ApngDrawable.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final ApngDrawabledecode(Resources res, @RawRes() @DrawableRes() Integer id, Integer width, Integer height)Creates ApngDrawable from resource. final ApngDrawabledecode(AssetManager assetManager, String assetName, Integer width, Integer height)Creates ApngDrawable from asset. final ApngDrawabledecode(String filePath, Integer width, Integer height)Creates ApngDrawable from given filePath. final ApngDrawabledecode(File file, Integer width, Integer height)Creates ApngDrawable from given file. final ApngDrawabledecode(InputStream stream, Integer width, Integer height)Creates ApngDrawable from given stream. final BooleanisApng(Resources res, @RawRes() @DrawableRes() Integer id)Determines whether or not the given data is APNG format. final BooleanisApng(AssetManager assetManager, String assetName)Determines whether or not the given data is APNG format. final BooleanisApng(String filePath)Determines whether or not the given data is APNG format. final BooleanisApng(File file)Determines whether or not the given data is APNG format. final BooleanisApng(InputStream stream)Determines whether or not the given data is APNG format. final IntegergetLOOP_FOREVER()The constant value for loopCount that indicates infinite looping. final IntegergetLOOP_INTRINSIC()The constant value for loopCount that indicates the original looping count. -
-
Method Detail
-
decode
@WorkerThread() final ApngDrawable decode(Resources res, @RawRes() @DrawableRes() Integer id, Integer width, Integer height)
Creates ApngDrawable from resource.
- Parameters:
res- The Resources instance to get resource from.id- Raw resource id or drawable resource id.width- An optional width value to specify width size manually.height- An optional height value to specify height size manually.
-
decode
@WorkerThread() final ApngDrawable decode(AssetManager assetManager, String assetName, Integer width, Integer height)
Creates ApngDrawable from asset.
- Parameters:
assetManager- The AssetManager instance to get asset from.assetName- The name of the asset to open.width- An optional width value to specify width size manually.height- An optional height value to specify height size manually.
-
decode
@WorkerThread() final ApngDrawable decode(String filePath, Integer width, Integer height)
Creates ApngDrawable from given filePath.
This is equivalent to the following code:
decode(File(filePath),size)- Parameters:
filePath- The file path to the Animated PNG file.width- An optional width value to specify width size manually.height- An optional height value to specify height size manually.
-
decode
@WorkerThread() final ApngDrawable decode(File file, Integer width, Integer height)
Creates ApngDrawable from given file.
- Parameters:
file- The Animated PNG file.width- An optional width value to specify width size manually.height- An optional height value to specify height size manually.
-
decode
@WorkerThread() final ApngDrawable decode(InputStream stream, Integer width, Integer height)
Creates ApngDrawable from given stream.
- Parameters:
stream- The InputStream to get from.width- An optional width value to specify width size manually.height- An optional height value to specify height size manually.
-
isApng
@WorkerThread() final Boolean isApng(Resources res, @RawRes() @DrawableRes() Integer id)
Determines whether or not the given data is APNG format.
- Parameters:
res- The Resources instance to get resource from.id- Raw resource id or drawable resource id.
-
isApng
@WorkerThread() final Boolean isApng(AssetManager assetManager, String assetName)
Determines whether or not the given data is APNG format.
- Parameters:
assetManager- The AssetManager instance to get asset from.assetName- The name of the asset to open.
-
isApng
@WorkerThread() final Boolean isApng(String filePath)
Determines whether or not the given data is APNG format. This is equivalent to the following code:
isApng(File(filePath))- Parameters:
filePath- The file path to the Animated PNG file.
-
isApng
@WorkerThread() final Boolean isApng(File file)
Determines whether or not the given data is APNG format.
- Parameters:
file- The Animated PNG file.
-
isApng
@WorkerThread() final Boolean isApng(InputStream stream)
Determines whether or not the given data is APNG format.
- Parameters:
stream- The InputStream to get from.
-
getLOOP_FOREVER
final Integer getLOOP_FOREVER()
The constant value for loopCount that indicates infinite looping.
-
getLOOP_INTRINSIC
final Integer getLOOP_INTRINSIC()
The constant value for loopCount that indicates the original looping count.
-
-
-
-