Class AnimatedImageProvider

com.yandex.runtime.image

public abstract class AnimatedImageProvider

Provides the animated image data.

Methods

AnimatedImageProvider fromAnimatedImage(final AnimatedImage image)

Returns an animated image provider.

AnimatedImageProvider fromAsset(final Context context, final String assetName)

Returns an animated image provider based on a given asset (from the assets/ directory).

AnimatedImageProvider fromByteArray(final byte[] image)

Returns an animated image provider based on the given data.

AnimatedImageProvider fromFile(final String fileName)

Returns an animated image provider based on an image file from the internal storage.

AnimatedImageProvider fromResource(final Context context, final int resourceId)

Returns an animated image provider based on a given resource.

abstract String getId()

Returns the unique identifier for the image.

abstract Object getImage()

Returns an animated image data buffer.

Method Detail

fromAnimatedImage

public static AnimatedImageProvider fromAnimatedImage (final AnimatedImage image)

Returns an animated image provider.

fromAsset

public static AnimatedImageProvider fromAsset (final Context context, final String assetName)

Returns an animated image provider based on a given asset (from the assets/ directory).

Supports only APNG format.

fromByteArray

public static AnimatedImageProvider fromByteArray (final byte[] image)

Returns an animated image provider based on the given data.

Supports only APNG format.

fromFile

public static AnimatedImageProvider fromFile (final String fileName)

Returns an animated image provider based on an image file from the internal storage.

Supports only APNG format.

fromResource

public static AnimatedImageProvider fromResource (final Context context, final int resourceId)

Returns an animated image provider based on a given resource.

Supports only APNG format.

getId

public abstract String getId ()

Returns the unique identifier for the image.

Providers can be cached based on it.

getImage

public abstract Object getImage ()

Returns an animated image data buffer.