0

I have used the code here to animate changing image of an ImageView. But it converts the first image to a white screen and then fade the white screen into the final image (no matter if I use background for ImageView or not). the same effect is appeared when using slide_out_right and slide_in_left.

Question:

How can I directly go from current Image to a new Image using a custom Animation?

  • I know that it is possible when using ImageSwitcher but I wanne do it in an ImageView
  • TransitionDrawable is not the solution because it is applicable only for fade. I wanna use translate or any custom animation.

thanks for any help

Edit:

I think I got the answere, but I am not sure if it an efficient solution:

the white screen is because I am animating the whole ImageView. when it goes out the display what appeared is the Layout background which is white.

To solve the problem, I used two ImageViews and copy the current Image to one and the new image to the another one. animation_in is applied to the imageview containing new image and animation_out to the other one.

Community
  • 1
  • 1
Behy
  • 483
  • 7
  • 23
  • Could you check the link at http://stackoverflow.com/a/5151774/1349601 and see if this helps you create the effect that you are looking for – g90 Dec 11 '15 at 15:32
  • It is not what exactly I am search for. Please check my Edit, it works, although I am not sure if it a good solution is. – Behy Dec 11 '15 at 15:43

0 Answers0