T - The type of the builder that is a subclass of this class.public abstract class GifDrawableInit<T extends GifDrawableInit<T>> extends Object
| Constructor and Description |
|---|
GifDrawableInit() |
| Modifier and Type | Method and Description |
|---|---|
GifDrawable |
build()
Appropriate constructor wrapper.
|
T |
from(android.content.res.AssetFileDescriptor assetFileDescriptor)
|
T |
from(android.content.res.AssetManager assetManager,
String assetName)
|
T |
from(byte[] bytes)
Wrapper of
GifDrawable.GifDrawable(byte[]) |
T |
from(ByteBuffer byteBuffer)
Wrapper of
GifDrawable.GifDrawable(java.nio.ByteBuffer) |
T |
from(android.content.ContentResolver contentResolver,
android.net.Uri uri)
|
T |
from(File file)
Wrapper of
GifDrawable.GifDrawable(java.io.File) |
T |
from(FileDescriptor fileDescriptor)
|
T |
from(InputStream inputStream)
Wrapper of
GifDrawable.GifDrawable(java.io.InputStream) |
T |
from(android.content.res.Resources resources,
int resourceId)
|
T |
from(String filePath)
Wrapper of
GifDrawable.GifDrawable(java.lang.String) |
ScheduledThreadPoolExecutor |
getExecutor()
Getter for the executor.
|
InputSource |
getInputSource()
Getter for the input source.
|
GifDrawable |
getOldDrawable()
Getter for the old drawable.
|
GifOptions |
getOptions()
Getter for the GIF options.
|
boolean |
isRenderingTriggeredOnDraw() |
T |
options(GifOptions options)
Indicates whether the content of this source is opaque.
|
T |
renderingTriggeredOnDraw(boolean isRenderingTriggeredOnDraw)
Sets whether rendering of the next frame is scheduled after drawing current one (so animation
will be paused if drawing does not happen) or just after rendering frame (no matter if it is
drawn or not).
|
T |
sampleSize(int sampleSize)
Sample size controlling subsampling, see
GifOptions.setInSampleSize(int) for more details. |
protected abstract T |
self()
Used in accordance with `getThis()` pattern.
|
T |
setRenderingTriggeredOnDraw(boolean isRenderingTriggeredOnDraw)
Equivalent to
renderingTriggeredOnDraw(boolean). |
T |
taskExecutor(ScheduledThreadPoolExecutor executor)
Sets or resets executor for rendering tasks.
|
T |
threadPoolSize(int threadPoolSize)
Sets thread pool size for rendering tasks.
|
T |
with(GifDrawable drawable)
Sets drawable to be reused when creating new one.
|
protected abstract T self()
public T sampleSize(int sampleSize)
GifOptions.setInSampleSize(int) for more details.
Note that this call will overwrite sample size set previously by options(GifOptions)sampleSize - the sample sizepublic GifDrawable build() throws IOException
from() calls.IOException - when creation failspublic T with(GifDrawable drawable)
drawable - drawable to be reusedpublic T threadPoolSize(int threadPoolSize)
taskExecutor(java.util.concurrent.ScheduledThreadPoolExecutor)
will be overwritten after setting pool sizethreadPoolSize - size of the poolpublic T taskExecutor(ScheduledThreadPoolExecutor executor)
threadPoolSize(int) will not be taken into account after setting executorexecutor - executor to be used or null for default (each drawable instance has its own executor)public T renderingTriggeredOnDraw(boolean isRenderingTriggeredOnDraw)
Drawable.isVisible() for more information about drawable visibility.
By default this option is enabled. Note that drawing does not happen if view containing
drawable is obscured. Disabling this option will prevent that however battery draining will be
higher.isRenderingTriggeredOnDraw - whether rendering of the next frame is scheduled after drawing (default)
current one or just after it is renderedpublic T setRenderingTriggeredOnDraw(boolean isRenderingTriggeredOnDraw)
renderingTriggeredOnDraw(boolean). This method does not follow naming convention
and is preserved for backwards compatibility only.isRenderingTriggeredOnDraw - whether rendering of the next frame is scheduled after drawing (default)
current one or just after it is rendered@Beta public T options(@Nullable GifOptions options)
GifTextureView.setOpaque(boolean)
for more information.GifTextureView, not by GifDrawable.
Note that this call will overwrite sample size set previously by sampleSize(int)
options - null-ok; options controlling parameters like subsampling and opacitypublic T from(InputStream inputStream)
GifDrawable.GifDrawable(java.io.InputStream)inputStream - data sourcepublic T from(android.content.res.AssetFileDescriptor assetFileDescriptor)
assetFileDescriptor - data sourcepublic T from(FileDescriptor fileDescriptor)
fileDescriptor - data sourcepublic T from(android.content.res.AssetManager assetManager, String assetName)
assetManager - assets sourceassetName - asset file namepublic T from(android.content.ContentResolver contentResolver, android.net.Uri uri)
uri - data sourcecontentResolver - resolver used to query uripublic T from(File file)
GifDrawable.GifDrawable(java.io.File)file - data sourcepublic T from(String filePath)
GifDrawable.GifDrawable(java.lang.String)filePath - data sourcepublic T from(byte[] bytes)
GifDrawable.GifDrawable(byte[])bytes - data sourcepublic T from(ByteBuffer byteBuffer)
GifDrawable.GifDrawable(java.nio.ByteBuffer)byteBuffer - data sourcepublic T from(android.content.res.Resources resources, int resourceId)
resources - Resources to read fromresourceId - resource id (data source)public InputSource getInputSource()
InputSource or null if it wasn't set.public GifDrawable getOldDrawable()
GifDrawable or null if it wasn't set.public ScheduledThreadPoolExecutor getExecutor()
ScheduledThreadPoolExecutor or null if it wasn't set.public boolean isRenderingTriggeredOnDraw()
public GifOptions getOptions()
GifOptions.