I want my program to do the following:
In frame there is a button and some image. When button is clicked I want this image move to the left until it will not be visible on frame (be outside of frame) and at the same time next image should come from outside of the frame to the center of it and stops there until the button is clicked again.
Should I inflate some ImageView everytime the button is clicked and change their x coord. though property animation? Or I can make two ImageView on frame and one of them would be transparent while other will be visible? And then change their positions and transparency level (“alpha”) when button is clicked?
Which is the right way to do it?
A
ViewFlippermight do what you want. From the javadoc:Presumably, you can add two
ImageViewinstances as children of theViewFlipperand then animate between them with a slide animation. There are some answers on SO detailing this. Try searching forViewFlipper.