Simple interpolation animation exemple

Je suis en train de mettre en œuvre le "hyperespace" interpolation d'animation décrit à http://developer.android.com/guide/topics/resources/animation-resource.html (Animation, Ressources), - toutefois, il ne semble pas fonctionner comme à l'écrit. Quand je lance l'application, je viens d'obtenir une vue vierge ci-dessous l'application de la barre de titre. Ce que je fais mal?

Par l'exemple, voici mon code. J'ai créé res/anim/hyperspace_jump.xml:

<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:shareInterpolator="false">
    <scale
        android:interpolator="@android:anim/accelerate_decelerate_interpolator"
        android:fromXScale="1.0" 
        android:toXScale="1.4" 
        android:fromYScale="1.0" 
        android:toYScale="0.6" 
        android:pivotX="50%"
        android:pivotY="50%"
        android:fillAfter="false"
        android:duration="700" />
    <set
        android:interpolator="@android:anim/accelerate_interpolator"
        android:startOffset="700">
        <scale
            android:fromXScale="1.4" 
            android:toXScale="0.0"
            android:fromYScale="0.6"
            android:toYScale="0.0" 
            android:pivotX="50%" 
            android:pivotY="50%" 
            android:duration="400" />
        <rotate
            android:fromDegrees="0" 
            android:toDegrees="-45"
            android:toYScale="0.0" 
            android:pivotX="50%" 
            android:pivotY="50%"
            android:duration="400" />
    </set>
</set>

J'ai également créé un layout/main.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
<ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></ImageView>

</LinearLayout>

Enfin, j'ai une activité:

package com.tomoreilly.geology;

import android.app.Activity;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

public class MainActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        ImageView image = (ImageView) findViewById(R.id.ImageView01);
        Animation hyperspaceJump = 
            AnimationUtils.loadAnimation(this, R.anim.hyperspace_jump);
        image.startAnimation(hyperspaceJump);
    }
}

Mais je ne vois pas d'animation quand je lance l'application. Ai-je raté un détail qui n'est pas couvert dans l'Animation "Ressources" exemple?

Grâce,
Tom

InformationsquelleAutor Tomasso | 2010-11-11