private LayoutAnimationController fadeIn(){
Animation fadeIn = AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_in);
AnimationSet set=new AnimationSet(true);
fadeIn.setDuration(155);
set.addAnimation(fadeIn);
set.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
mLayout.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationEnd(Animation animation) {}
@Override
public void onAnimationRepeat(Animation animation) {}
});
return new LayoutAnimationController(set);
}
private LayoutAnimationController fadeOut(){
AnimationSet set=new AnimationSet(true);
Animation fadeOut = AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_out);
fadeOut.setDuration(255);
set.addAnimation(fadeOut);
set.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) { }
@Override
public void onAnimationEnd(Animation animation) {
mLayout.setVisibility(View.GONE);
}
@Override
public void onAnimationRepeat(Animation animation) {}
});
return new LayoutAnimationController(set);
}
The problem occurs in fadeIn , when you try to run onAnimationStart(Animation animation) mLayout.setVisibility(View.VISIBLE); }
Layout is not displayed!
Would anyone know the right way to do this? Home From now on, greetings!