0

Is it possible to change a ImageView's ImageResource and make the change fade / blend from the old and new ImageResource and if so how ?

To be a bit more clear I do not want the image to fade in, because using the below example code would make the original image dissapear, and the new image fade in. I want the new image to blend in over the old one:

ImageView v = // ... the ImageView that needs to be have a new image
Animation anim = new AlphaAnimation(0.0f, 1.0f);
v.setImageResource(new_imageResource);
anim.setDuration(1000);
anim.setFillAfter(true);
anim.setInterpolator(new LinearInterpolator());   
v.startAnimation(anim);
Daniel Jørgensen
  • 1,183
  • 2
  • 19
  • 42
  • Have you investigated [Porter-Duff Mode](https://stackoverflow.com/q/8280027/295004) – Morrison Chang Sep 10 '20 at 00:15
  • @MorrisonChang - Nope but it looks like its the thing I'm looking for. It didn't really come to mind to search for PorterDuff. I do however not see how i should use this with two drawable images and how it should animate between the two images. Should they be converted to bitmaps? – Daniel Jørgensen Sep 10 '20 at 08:48

0 Answers0