title: Android translate animation instantly requires full height while animating
body: <p>So imagine you have a parent relative layout with height set to <code>wrap_content</code>. Inside this layout is another layout which is hidden by default. This is how I reveal it:</p>
  
  <pre><code>view.startAnimation(AnimationUtils.loadAnimation(context, R.anim.translate_in));
  view.setVisibility(View.VISIBLE);  
  </code></pre>
  
  <p>Here is the corresponding anim file. It basically moves the view from the bottom to the top.</p>
  
  <pre><code> &lt;translate
      android:duration="250"
      android:fromXDelta="0"
      android:fromYDelta="100%p"
      android:toXDelta="0"
      android:toYDelta="0"
      android:fillAfter="true"/&gt;
  </code></pre>
  
  <p>I expect the parent view to change its height according to the animation of the child view. However when the animation starts the parent view instantly shifts up while the child view is still animating. It feels like the setVisibility is called before the animation has finished.</p>
  
  <p>So to solve this I would scale the height of the child from 0 to 100%, however I do not want a scale but a translate effect.</p>
  
  <p>Any ideas how to approach this problem?</p>
  
  <p>The layout is simple:</p>
  
  <pre><code>&lt;RelativeLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:backgroundColor="@color/grey"&gt;
  
      &lt;TextView/&gt;
  
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:backgroundColor="@color/white"
          android:visibility="GONE"&gt;
  
          &lt;TextView/&gt;
  
       &lt;/RelativeLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>