0

I have an ImageView that has a picture. When the user does something, I want the picture to change to another resource.

I found this solution: Creating animation on ImageView while changing image resource

But it first fades out the current picture and then it fades in the new one. What I want is that at the same time the first resource fades out, the new picture to fade in.

I was thinking about using 2 ImageViews, one to fade in, another to fade out. But I was wondering if it can be accomplished using a single ImageView.

(I don't want necessarily a fade-in fade-out animation... a merge/blend whatever would be ok too)

Thanks!

Community
  • 1
  • 1
Florin Vistig
  • 1,639
  • 2
  • 22
  • 31

1 Answers1

0

Finally used a ViewFlipper to switch between the two "images".

<ViewFlipper 
    android:id="@+id/view_flipper"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <ImageView
        android:id="@+id/background_level"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="centerCrop"
        android:src="@drawable/background_level_1" />

    <ImageView
        android:id="@+id/background_level_flip1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="centerCrop"
        android:src="@drawable/background_level_2" />
</ViewFlipper>
Florin Vistig
  • 1,639
  • 2
  • 22
  • 31