public class ReEncodingGifResourceEncoder extends java.lang.Object implements ResourceEncoder<GifDrawable>
ResourceEncoder that can write GifDrawable to cache.| Modifier and Type | Field and Description |
|---|---|
static Option<java.lang.Boolean> |
ENCODE_TRANSFORMATION
A boolean option that, if set to
true, causes the fully transformed GIF to be
written to cache. |
| Constructor and Description |
|---|
ReEncodingGifResourceEncoder(android.content.Context context,
BitmapPool bitmapPool) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
encode(Resource<GifDrawable> resource,
java.io.File file,
Options options)
Writes the given data to the given output stream and returns True if the write completed
successfully and should be committed.
|
EncodeStrategy |
getEncodeStrategy(Options options) |
public static final Option<java.lang.Boolean> ENCODE_TRANSFORMATION
true, causes the fully transformed GIF to be
written to cache.
Warning - encoding GIFs is slow and often produces larger and less efficient GIFs than the originals. Re-encoding may be worth it to decrease the size of very large GIFs.
Defaults to false.
public ReEncodingGifResourceEncoder(@NonNull
android.content.Context context,
@NonNull
BitmapPool bitmapPool)
@NonNull public EncodeStrategy getEncodeStrategy(@NonNull Options options)
getEncodeStrategy in interface ResourceEncoder<GifDrawable>public boolean encode(@NonNull
Resource<GifDrawable> resource,
@NonNull
java.io.File file,
@NonNull
Options options)
Encoderencode in interface Encoder<Resource<GifDrawable>>resource - The data to write.file - The File to write the data to.options - The put of options to apply when encoding.