class ImageViewCrossFadeAnimation implements MirageAnimation<ImageView> {

	@Override
	public boolean animate(ImageView imageView, Drawable targetDrawable, Mirage.Source source) {
		if (source == Mirage.Source.MEMORY) return false;
		Drawable currentDrawable = imageView.getDrawable();
		if (currentDrawable == null) {
			currentDrawable = new ColorDrawable(Color.TRANSPARENT);
		}
		Drawable[] fades = new Drawable[2];
		fades[0] = currentDrawable;
		fades[1] = targetDrawable;
		TransitionDrawable transitionDrawable = new TransitionDrawable(fades);
		transitionDrawable.setCrossFadeEnabled(true);
		imageView.setImageDrawable(transitionDrawable);
		transitionDrawable.startTransition(duration);
		return true;
	}

	public  ImageViewCrossFadeAnimation();
	public  ImageViewCrossFadeAnimation(int duration);

}