Where is @anim/fragment_fade_enter included in?

Viewed 974
1 Answers

The @anim/fragment_ resources were always a private implementation detail of the various FragmentTransaction.TRANSIT_ fields (i.e., TRANSIT_FRAGMENT_FADE) used in the FragmentTransaction.setTransition() API.

As per the Fragment 1.3.0 release notes:

  • TRANSIT_ animation changes: The fragment default effects, TRANSIT_FRAGMENT_OPEN, TRANSIT_FRAGMENT_CLOSE, and TRANSIT_FRAGMENT_FADE, now use Animator instead of Animation. The resources used to build these animators are now private.

So if you are using Fragments by themselves, you should use the setTransition() API, rather than manually using any of those private animators.

If you are using the Navigation Component, the navigation-ui dependency does offer public animators as of the Navigation 2.3.1 release. You'd use those with:

  • @animator/nav_default_enter_anim
  • @animator/nav_default_exit_anim
  • @animator/nav_default_pop_enter_anim
  • @animator/nav_default_pop_exit_anim

As of this time, those are also fade animations.

Related