title: Fade animation blinks - Android
body: <p>I'm trying to set up 2 layouts - I want one layout to slide up, and when it's finished another layout should fade in.</p>
  
  <p>I've managed to get it working, but at the end of the two animation and first layout blinks once.
  How can I solve it?</p>
  
  <p>Here's the code(first layout is named titleLay and the second one is called registerLayout)-</p>
  
  <pre><code>final TranslateAnimation slide = new TranslateAnimation(0, 0, 0,-100 ); 
  slide.setDuration(500); 
  slide.setFillAfter(true); 
  slide.setAnimationListener(new AnimationListener() {
  
  @Override
  public void onAnimationStart(Animation animation) {
  
  
  }
  
  @Override
  public void onAnimationRepeat(Animation animation) {
  
  }
  
  @Override
  public void onAnimationEnd(Animation animation) {
      RelativeLayout registerLayout  = (RelativeLayout) findViewById(R.id.registerLay);
      Animation fadeInAnimation = AnimationUtils.loadAnimation(con, R.anim.fade_in_anim);
      registerLayout.startAnimation(fadeInAnimation);
      registerLayout.setVisibility(View.VISIBLE);
  }
  });
  
  titleLay.startAnimation(slide);
  </code></pre>
  
  <p>And that's the XML code of the <code>R.anim.fade_in_anim</code>-</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
   &lt;set xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;alpha android:fromAlpha="0.0" android:toAlpha="1.0" 
       android:interpolator="@android:anim/accelerate_interpolator" 
      android:duration="500"/&gt;
  &lt;/set&gt;
  </code></pre>
  
  <p>Edit: If I use other types of animations(fade out, slide etc...) it works fine, without flicking.</p>
  
  <p>Thanks!</p>