Je veux créer une sorte d'imageGallery avec deux animations différentes. Lorsque vous cliquez sur l'image actuellement visible, une "OK-Image" doit apparaître (1 seconde, non répétée), une fois l'animation terminée, l'image suivante doit être affichéeAndroid AnimationListener ne se fait pas frapper
Chaque image a une animation infinie et répétée (vue normale, vue zoomée)
so ..
- Étape 1: Infinite animation d'une image (normal => zoom => normale ..)
- Étape 2: Cliquez sur
- Étape 3 : Afficher "OK-Image" (fondu en 1 sec)
- Étape 1 ...
Le problème est que l'animation Listener du OK-animation est touché, le Animationlistener de l'animation infinie ne ..
@Override
public void onCreate(Bundle savedInstanceState) {
fadeInOKAnimation = AnimationUtils.loadAnimation(this, R.anim.fadeinonce);
fadePermanentAnimation = AnimationUtils.loadAnimation(this, R.anim.fadeininfinite);
fadeInOKAnimation.setAnimationListener(fadeInOKAnimationListener);
fadePermanentAnimation.setAnimationListener(fadePermanentAnimationListener);
}
AnimationListener fadeInOKAnimationListener = new Animation.AnimationListener() {
public void onAnimationEnd(Animation animation)
{
ThreadHelper.sleep(500);
imgMessung.clearAnimation();
int currentImageId = currentStateImage.getNormalImage();
imgMessung.clearAnimation();
imgMessung.setImageResource(currentImageId);
imgMessung.startAnimation(fadePermanentAnimation);
}
public void onAnimationRepeat(Animation animation) { }
public void onAnimationStart(Animation animation) { }
};
AnimationListener fadePermanentAnimationListener = new Animation.AnimationListener() {
public void onAnimationEnd(Animation animation) { }
public void onAnimationRepeat(Animation animation) {
StateImage currentStateImage = messung.GetCurrentImage();
if(currentImageState == ImageState.Normal)
{
int currentImageId = Integer.parseInt(currentStateImage.getNormalImage());
imgMessung.setImageResource(currentImageId);
}
else
{
int currentImageId = Integer.parseInt(currentStateImage.getZoomedImage());
imgMessung.setImageResource(currentImageId);
}
}
public void onAnimationStart(Animation animation) { }
};
J'utilise déjà onAnimationRepeat pour l'animation fadePermanentAnimationListener .. mais cela ne me touche pas – Roland85