Android Animation De Scintillement

J'ai été le chalutage par le biais aussi de nombreux fils sur ce sujet que je peux trouver sur le scintillement qui se pose dans Android 2.2 lorsque vous traitez avec AnimationListeners, mais je n'arrive pas à résoudre mon problème.

Ce que j'ai est un LinearLayout 'liste' que l'utilisateur touche de déplacement vers le bas d'environ 100 pixels, et touche à nouveau pour le déplacer vers le haut. J'ai enfin travailler sur la première partie, sans scintillement (grâce à la suggestion d'appel clearAnimation() sur la vue animée), mais en faisant l'inverse (c'est à dire, le déplacement de la vue arrière vers le haut), il y a un scintillement au début. Je ne peux pas vraiment appeler clearAnimation() dans le onAnimationStart() la méthode que de ne pas les animer!

Bien sûr, toutes les animations fonctionne parfaitement, si j'ai utilisé setFillAfter() sans aucune animation à l'écoute, mais le point de vue de la zone tactile ne bougera pas (parce que la vue elle-même n'a pas "réellement" déplacé).

Toute aide serait grandement appréciée.

this.popoverTab.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
popoverTab.setClickable(false);
popoverTab.setFocusable(false);
if (popoverHidden) {
Log.d(TAG, "About to show popover");
//the popover is currently hidden, show it.
TranslateAnimation animation = new TranslateAnimation(0, 0, 100, 0);
animation.setDuration(700);
animation.setFillBefore(true);
animation.setAnimationListener(new AnimationListener() {
public void onAnimationEnd(Animation animation) {
}
public void onAnimationRepeat(Animation animation) {
}
public void onAnimationStart(Animation animation) {
footer.layout(footer.getLeft(), (footer.getTop() - 100), footer.getRight(), footer.getBottom());
}
});
footer.startAnimation(animation);
} else {
Log.d(TAG, "About to hide popover");
//the popover is showing, hide it.
TranslateAnimation animation = new TranslateAnimation(0, 0, 0, 100);
animation.setDuration(700);
animation.setFillAfter(true);
animation.setAnimationListener(new AnimationListener() {
public void onAnimationEnd(Animation animation) {
footer.clearAnimation();
footer.layout(footer.getLeft(), (footer.getTop() + 100), footer.getRight(), footer.getBottom());
}
public void onAnimationRepeat(Animation animation) {
}
public void onAnimationStart(Animation animation) {
}
});
footer.startAnimation(animation);
}
//invert.
popoverHidden = !popoverHidden;
popoverTab.setClickable(true);
popoverTab.setFocusable(true);
}
});
InformationsquelleAutor JRod | 2012-02-22