FileDocCategorySizeDatePackage
AnimatedImageView.javaAPI DocAndroid 5.1 API2568Thu Mar 12 22:22:42 GMT 2015com.android.systemui.statusbar

AnimatedImageView

public class AnimatedImageView extends android.widget.ImageView

Fields Summary
android.graphics.drawable.AnimationDrawable
mAnim
boolean
mAttached
Constructors Summary
public AnimatedImageView(android.content.Context context)

        super(context);
    
public AnimatedImageView(android.content.Context context, android.util.AttributeSet attrs)

        super(context, attrs);
    
Methods Summary
public voidonAttachedToWindow()

        super.onAttachedToWindow();
        mAttached = true;
        updateAnim();
    
public voidonDetachedFromWindow()

        super.onDetachedFromWindow();
        if (mAnim != null) {
            mAnim.stop();
        }
        mAttached = false;
    
protected voidonVisibilityChanged(android.view.View changedView, int vis)

        super.onVisibilityChanged(changedView, vis);
        if (mAnim != null) {
            if (isShown()) {
                mAnim.start();
            } else {
                mAnim.stop();
            }
        }
    
public voidsetImageDrawable(android.graphics.drawable.Drawable drawable)

        super.setImageDrawable(drawable);
        updateAnim();
    
public voidsetImageResource(int resid)

        super.setImageResource(resid);
        updateAnim();
    
private voidupdateAnim()

        Drawable drawable = getDrawable();
        if (mAttached && mAnim != null) {
            mAnim.stop();
        }
        if (drawable instanceof AnimationDrawable) {
            mAnim = (AnimationDrawable)drawable;
            if (isShown()) {
                mAnim.start();
            }
        } else {
            mAnim = null;
        }