1 package com.xtremelabs.robolectric.shadows;
2 
3 import android.graphics.drawable.AnimationDrawable;
4 import android.graphics.drawable.Drawable;
5 import com.xtremelabs.robolectric.internal.Implementation;
6 import com.xtremelabs.robolectric.internal.Implements;
7 
8 import java.util.ArrayList;
9 import java.util.List;
10 
11 @Implements(AnimationDrawable.class)
12 public class ShadowAnimationDrawable extends ShadowDrawable {
13 
14     private List<Drawable> frames = new ArrayList<Drawable>();
15     private boolean isStarted;
16 
17     @Implementation
addFrame(Drawable frame, int duration)18     public void addFrame(Drawable frame, int duration) {
19         frames.add(frame);
20     }
21 
22     @Implementation
getNumberOfFrames()23     public int getNumberOfFrames() {
24         return frames.size();
25     }
26 
27     @Implementation
start()28     public void start() {
29         isStarted = true;
30     }
31 
isStarted()32     public boolean isStarted() {
33         return isStarted;
34     }
35 
getFrames()36     public List<Drawable> getFrames() {
37         return frames;
38     }
39 }
40