Ensure only transitioning fragments are made disappearing

Rather than adding all views that have a non-null
Animation to the set of disappearing children, make sure
that all disappearing children have been specifically
adding to the set of transitioning fragment views
via startViewTransition().

Test: tested in sample app attached to bug
BUG: 174839543
Relnote: "Fixed leak and visual artifact when adding
a fragment with an `Animation` to a
`FragmentContainerView` and then interrupting that
addition with a pop operation when using the new
state manager."

Change-Id: I952d8409bb6afb810fc97b52c14e23f55ba5ab17
diff --git a/fragment/fragment/src/main/java/androidx/fragment/app/FragmentContainerView.java b/fragment/fragment/src/main/java/androidx/fragment/app/FragmentContainerView.java
index cd15968..84142fb 100644
--- a/fragment/fragment/src/main/java/androidx/fragment/app/FragmentContainerView.java
+++ b/fragment/fragment/src/main/java/androidx/fragment/app/FragmentContainerView.java
@@ -369,7 +369,7 @@
      * @param v {@link View} that might be added to list of disappearing views
      */
     private void addDisappearingFragmentView(@NonNull View v) {
-        if (v.getAnimation() != null || (mTransitioningFragmentViews != null
+        if (v.getAnimation() != null && (mTransitioningFragmentViews != null
                 && mTransitioningFragmentViews.contains(v))) {
             if (mDisappearingFragmentChildren == null) {
                 mDisappearingFragmentChildren = new ArrayList<>();