Je crée une animation dans laquelle je veux effacer mon imageview mais l'animation devrait commencer la décoloration de bas en haut contrairement à la décoloration animation dans laquelle tout imageview disparaît à la fois.Android Fade In/Out animation de bas en haut
public void animateFadeIn() {
Animation in = AnimationUtils.loadAnimation(this,
android.R.anim.fade_in);
motherboard.startAnimation(in);
motherboard.setVisibility(View.VISIBLE);
in.setDuration(1500);
in.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
// TODO Auto-generated method stub
}
@Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
}
@Override
public void onAnimationEnd(Animation animation) {
// TODO Auto-generated method stub
animateFadeOut();
}
});
}
Comment y parvenir.
<?xml version="1.0" encoding="UTF-8"?>
<scale
android:fromYScale="-450"
android:toYScale="450" />
<alpha
android:duration="1500"
android:fromAlpha="0.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:repeatCount="infinite"
android:toAlpha="1.0" />
suivre ce lien peut vous aider à http://www.androidhive.info/2013/06/android-working-with-xml-animations/ –
coller votre animation. fichiers xml –
@NileshRathod Je suis simplement en utilisant xml d'animation Android par défaut. ** android.R.anim.fade_in ** et ** android.R.anim.fade_out ** –