FragmentTransition custom animation onAnimationEnd callback

I have a FragmentTransaction which doesn't perform really fluid on older devices, so I want to enable hardware layers here.



This is the transaction code:



FragmentTransaction transaction = manager.beginTransaction();
transaction.setCustomAnimations(android.R.animator.fade_in, android.R.animator.fade_out);
transaction.add(R.id.container, new OverlayFragment(), Utilities.OVERLAY);
transaction.commitAllowingStateLoss();


Normally I would do this in the onAnimationEnd() of AnimatorListenerAdapter but I cannot set this on a resource objectAnimator.



What is the best way to set and reset the hardware layer of the views?