| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
package android.testing; |
| 16 |
|
| 17 |
import android.annotation.DrawableRes; |
| 18 |
import android.annotation.Nullable; |
| 19 |
import android.content.Context; |
| 20 |
import android.util.AttributeSet; |
| 21 |
import android.widget.ImageView; |
| 22 |
|
| 23 |
public class TestableImageView extends ImageView { |
| 24 |
|
| 25 |
private int mLastResId = -1; |
| 26 |
|
| 27 |
public TestableImageView(Context context, @Nullable AttributeSet attrs) { |
| 28 |
super(context, attrs); |
| 29 |
} |
| 30 |
|
| 31 |
@Override |
| 32 |
public void setImageResource(@DrawableRes int resId) { |
| 33 |
mLastResId = resId; |
| 34 |
super.setImageResource(resId); |
| 35 |
} |
| 36 |
|
| 37 |
public int getLastImageResource() { |
| 38 |
return mLastResId; |
| 39 |
} |
| 40 |
} |