title: Loading fragment didn't fade in or fade out
body: <p>I have a <a href="https://stackoverflow.com/questions/26300674/android-fragment-overlay-another-fragment-with-semi-transparent">fragment</a> that I want it to be fade in when it is added and fade out when it is removed. The way I do it at the moment is as following: (though, it doesn't have any animation effects)</p>
  
  <p>Fadein when added:</p>
  
  <pre><code>FragmentManager manager =getFragmentManager();
  manager.beginTransaction().setCustomAnimations(R.anim.fadein, R.anim.fadeout)
                  .add(R.id.loading_fragment_container, loadingFragment, "loadingFragment").commit();
  </code></pre>
  
  <p>Fade out when removed:</p>
  
  <pre><code>manager.beginTransaction().setCustomAnimations(R.anim.fadeout, R.anim.fadein)
              .remove(loadingFragment).commit();
  </code></pre>
  
  <p>fadein.xml</p>
  
  
  
  <pre><code>&lt;objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      android:interpolator="@android:anim/linear_interpolator"
      android:propertyName="alpha"
      android:valueFrom="0.0"
      android:valueTo="1"
      android:duration="1500"
  &lt;/objectAnimator&gt;
  </code></pre>
  
  <p>fadeout.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      android:interpolator="@android:anim/linear_interpolator"
      android:propertyName="alpha"
      android:valueFrom="1"
      android:valueTo="0.0"
      android:duration="1500"
  &lt;/objectAnimator&gt;
  </code></pre>
  
  <p>My fragment class:</p>
  
  <pre><code>public class LoadingFragment extends Fragment {
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          return inflater.inflate(R.layout.fragment_loading_layout, container,false);
      }
  
      //I even tried to add this but still nothing happens
      @Override
      public Animator onCreateAnimator(int transit, boolean enter, int nextAnim) {
          return super.onCreateAnimator(android.R.anim.fade_in, true, android.R.anim.fade_out);
      }
  
      @Override
      public void onActivityCreated(Bundle savedInstanceState) { 
          super.onActivityCreated(savedInstanceState);
          //basically this code just makes the loading image (which is a circle) spinning on its center forever
          //https://stackoverflow.com/questions/3137490/how-to-spin-an-android-icon-on-its-center-point
          ImageView loadingCircle= (ImageView) getActivity().findViewById(R.id.loadingImage);
          Log.d("loadingCircle","loadingCircle: "+loadingCircle);
          RotateAnimation r = new RotateAnimation(0.0f, 10.0f * 360.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
          r.setDuration(10000);
          r.setInterpolator(new LinearInterpolator());
          r.setRepeatCount(Animation.INFINITE);
          r.setRepeatMode(Animation.INFINITE);
          r.setFillEnabled(true);
          r.setFillAfter(true);
          loadingCircle.startAnimation(r);
      }
  }
  </code></pre>