@Test public void testOnResult() { ImageView imageView = new ImageView(RuntimeEnvironment.application); ImageViewTarget target = new ImageViewTarget(imageView); target.placeHolder(new ColorDrawable(Color.BLUE)); target.onPreparingLoad(); target.onResult(Bitmap.createBitmap(200, 200, Bitmap.Config.ARGB_8888), Mirage.Source.EXTERNAL, new MirageRequest()); imageView = new ImageView(RuntimeEnvironment.application); target = new ImageViewTarget(imageView); target.placeHolder(new ColorDrawable(Color.BLUE)); target.fade(); target.onPreparingLoad(); target.onResult(Bitmap.createBitmap(200, 200, Bitmap.Config.ARGB_8888), Mirage.Source.EXTERNAL, new MirageRequest()); }
@Override protected void onResult(ImageView view, Drawable drawable, Mirage.Source source, MirageRequest request) { if (animation() != null) { if (!animation().animate(view, drawable, source)) { view.setImageDrawable(drawable); } } else { view.setImageDrawable(drawable); } }
ImageViewTarget extends ViewTarget<ImageView> { @Override protected void onResult(ImageView view, Drawable drawable, Mirage.Source source, MirageRequest request) { if (animation() != null) { if (!animation().animate(view, drawable, source)) { view.setImageDrawable(drawable); } } else { view.setImageDrawable(drawable); } } }
ImageViewTarget extends ViewTarget<ImageView> { @Override protected void onResult(ImageView view, Drawable drawable, Mirage.Source source, MirageRequest request) { if (animation() != null) { if (!animation().animate(view, drawable, source)) { view.setImageDrawable(drawable); } } else { view.setImageDrawable(drawable); } } ImageViewTarget(ImageView imageView);  ImageViewTarget(MirageRequest request, ImageView imageView); }
ImageViewTarget extends ViewTarget<ImageView> { @Override protected void onResult(ImageView view, Drawable drawable, Mirage.Source source, MirageRequest request) { if (animation() != null) { if (!animation().animate(view, drawable, source)) { view.setImageDrawable(drawable); } } else { view.setImageDrawable(drawable); } } ImageViewTarget(ImageView imageView);  ImageViewTarget(MirageRequest request, ImageView imageView); @Override ViewTarget<ImageView> fade(); }
ImageViewTarget extends ViewTarget<ImageView> { @Override protected void onResult(ImageView view, Drawable drawable, Mirage.Source source, MirageRequest request) { if (animation() != null) { if (!animation().animate(view, drawable, source)) { view.setImageDrawable(drawable); } } else { view.setImageDrawable(drawable); } } ImageViewTarget(ImageView imageView);  ImageViewTarget(MirageRequest request, ImageView imageView); @Override ViewTarget<ImageView> fade();  }