I want to set a buttons visibility after the animation is finished.
That\'s what calls the animation:
android.support.v4.app.FragmentTransaction fAni
You need to subclass Fragment and override onCreateAnimator, then you can load those animations from XML and attach listeners to them.
E.g.
public class MyFragment extends Fragment
{
@Override
public Animator onCreateAnimator(int transit, boolean enter, int nextAnim)
{
final int animatorId = (enter) ? R.anim.in_anim : R.anim.out_anim;
final Animator anim = AnimatorInflater.loadAnimator(getActivity(), animatorId);
anim.addListener(new AnimatorListenerAdapter()
{
@Override
public void onAnimationStart(Animator animation)
{
...
}
@Override
public void onAnimationEnd(Animator animation)
{
...
}
});
return anim;
}