Création d'un diaporama en Fondu des images les unes dans les autres et se transforme

Je suis en train de créer une image de diaporama qui est similaire à cette

J'ai trouvé ce tutoriel qui me montre comment faire des images fondu dans l'autre, ce qui fonctionne vraiment bien, mais je ne peux pas trouver des exemples, comment faire le mouvement/mise à l'échelle dans le même temps, aussi je vais essayer de l'adapter.

J'ai ajouté une animation d'échelle et placez-le long de avec l'alpha de l'animation dans un animationset mais je ne peux pas le faire fonctionner correctement, c'est seulement faire de l'animation sur chaque autre image, puis lorsque le zoom commence le zoom se fait d'une façon, des commutateurs et puis zoome dans l'autre sens.

Je suis relativement nouveau pour Android n'ai pas fait toutes les animations avant et éprouve de la difficulté à comprendre la façon dont l'exemple est le travail. Donc j'ai de la difficulté à modifier.

Quelqu'un peut-il m'aider à me sortir de ce que je fais de mal? Je commence à tirer mes cheveux!

Mon code java est:

  public class TopListActivity extends Activity {
ImageView slide_0;
ImageView slide_1;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.test2);
slide_0 = (ImageView) findViewById(R.id.slide_1);
slide_1 = (ImageView) findViewById(R.id.slide_2);
}
private static class AnimationTimer extends TimerTask implements
AnimationListener {
TopListActivity topList;
Vector<BitmapDrawable> images;
int count = 0;
public AnimationTimer(TopListActivity _topList) {
this.topList = _topList;
this.images = new Vector<BitmapDrawable>();
Resources resources = topList.getResources();
images.add((BitmapDrawable) resources.getDrawable(R.drawable.one));
images.add((BitmapDrawable) resources.getDrawable(R.drawable.two));
images.add((BitmapDrawable) resources.getDrawable(R.drawable.three));
images.add((BitmapDrawable) resources.getDrawable(R.drawable.four));
images.add((BitmapDrawable) resources.getDrawable(R.drawable.five));
images.add((BitmapDrawable) resources.getDrawable(R.drawable.six));
if (this.images.size() > 0) {
this.topList.slide_0.setBackgroundDrawable(this.images.get(0));
if (this.images.size() > 1) {
this.topList.slide_1.setBackgroundDrawable(this.images
.get(1));
}
}
this.count = 1;
}
public void launch() {
if (this.images.size() >= 2) {
(new Timer(false)).schedule(this, 100);
}
}
@Override
public void run() {
this.doit();
this.cancel();
}
private void doit() {
if ((this.count % 2) == 0) {
AnimationSet set = new AnimationSet(false);
AlphaAnimation animation = new AlphaAnimation(1.0f, 0.0f);
animation.setStartOffset(5000);
animation.setDuration(3000);
animation.setFillAfter(true);
ScaleAnimation zoom = new ScaleAnimation(1, 1.20f, 1, 1.20f);
zoom.setStartOffset(0);
zoom.setDuration(8000);
zoom.setFillAfter(true);
set.addAnimation(animation);
set.addAnimation(zoom);
set.setAnimationListener(this);
this.topList.slide_1.startAnimation(set);
} else {
AnimationSet set = new AnimationSet(false);
AlphaAnimation animation = new AlphaAnimation(0.0f, 1.0f);
animation.setStartOffset(5000);
animation.setDuration(3000);
animation.setFillAfter(true);
ScaleAnimation zoom = new ScaleAnimation(1.20f, 1, 1.20f, 1);
zoom.setStartOffset(0);
zoom.setDuration(8000);
zoom.setFillAfter(true);
set.addAnimation(animation);
set.addAnimation(zoom);
set.setAnimationListener(this);
this.topList.slide_1.startAnimation(set);
}
}
public void onAnimationEnd(Animation animation) {
if ((this.count % 2) == 0) {
this.topList.slide_1.setBackgroundDrawable(this.images
.get((this.count + 1) % (this.images.size())));
} else {
this.topList.slide_0.setBackgroundDrawable(this.images
.get((this.count + 1) % (this.images.size())));
}
this.count++;
this.doit();
}
public void onAnimationRepeat(Animation animation) {
}
public void onAnimationStart(Animation animation) {
}
}
@Override
public void onResume() {
super.onResume();
(new AnimationTimer(this)).launch();
}
}

et ma mise en page est:

    <FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/slide_1"
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:id="@+id/slide_2"
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</FrameLayout>
avez-vous comprendre cela?
Nan.. je travaille encore sur elle!

OriginalL'auteur Bex | 2011-07-07