public class FrameSequenceView
extends android.support.v7.widget.AppCompatImageView
This is an ImageView that displays animated images frame-by-frame once setup(FrameSequenceSource) is called.
Note that you MUST call release() in order to release resources and avoid memory leak.
| Constructor and Description |
|---|
FrameSequenceView(android.content.Context context) |
FrameSequenceView(android.content.Context context,
android.util.AttributeSet attrs) |
FrameSequenceView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
onAttachedToWindow() |
protected void |
onDetachedFromWindow() |
void |
pause()
Pause animation playback.
|
void |
play()
Start WebP animation playback.
|
void |
release()
You MUST call this method when @{link
FrameSequenceView is no longer needed in order to release resources and avoid memory leak. |
void |
setOnStartAnimationListener(OnStartAnimationListener onStartAnimationListener)
Subscribe for animation start.
|
void |
setShouldLoadPreview(boolean shouldLoadPreview) |
protected void |
setup(FrameSequenceSource frameSequenceSource)
Set a
FrameSequenceSource object to display by FrameSequenceView. |
void |
setupPreview(android.graphics.drawable.Drawable drawable,
boolean animate)
Set preview manually by calling this method.
|
public FrameSequenceView(android.content.Context context)
public FrameSequenceView(android.content.Context context,
android.util.AttributeSet attrs)
public FrameSequenceView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr)
public void setShouldLoadPreview(boolean shouldLoadPreview)
protected void setup(FrameSequenceSource frameSequenceSource)
FrameSequenceSource object to display by FrameSequenceView.protected void onAttachedToWindow()
protected void onDetachedFromWindow()
public void release()
FrameSequenceView is no longer needed in order to release resources and avoid memory leak.
Note: We are working on automatic resource release encapsulation. This method will be marked as Deprecated when done.
public void setupPreview(android.graphics.drawable.Drawable drawable,
boolean animate)
Note: If setShouldLoadPreview(boolean) is set to true then preview image will be replaced by the one loaded from FrameSequenceSource.loadPoster().
drawable - to use as preview, until FrameSequenceSource.loadFrameSequence() is being loaded.animate - set to true if transition animation needed.public void setOnStartAnimationListener(OnStartAnimationListener onStartAnimationListener)
onStartAnimationListener - public void play()
Will download and play animated FrameSequenceSource.loadFrameSequence(), or play it instantly if it is already downloaded.
public void pause()