You can if you override onCreateAnimation() (or onCreateAnimator() if you use 3.0 + snippets ... both allow listeners) inside your custom snippet to provide animation rather than using custom animation methods FragmentTransaction
@Override public Animation onCreateAnimation (int transit, boolean enter, int nextAnim) { Animation anim; if (enter) { anim = AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_in); } else { anim = AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_out); } anim.setAnimationListener(new AnimationListener() { public void onAnimationEnd(Animation animation) { } public void onAnimationRepeat(Animation animation) { } public void onAnimationStart(Animation animation) { } }); return anim; }
source share