Get a slide-up animation to work?
<p>I want to animate a view sliding up and in. My layout:</p>

<pre><code>&lt;RelativeLayout&gt;
    &lt;LinearLayout
        android:id="@+id/foo"
        android:layout_width="fill_parent"
        android:layout_height="40dp"
        android:layout_alignParentBottom="true" /&gt;
&lt;/RelativeLayout&gt;
</code></pre>

<p>The layout "foo" is pinned to the bottom of my activity's layout. I'd like to have it initially hidden. For example, I'd like its top y coordinate to be the bottom pixel of the screen to start.</p>

<p>When I click a button elsewhere in the UI, I'd like foo to slide up, and end when its bottom edge touches the bottom of the screen.</p>

<p>When I click another button, I'd like foo to slide down, back to its original starting position (where its top edge is at the bottom pixel of the screen).</p>

<p>I'm trying to do that with the following animation definitions:</p>

<pre><code>// slide up
&lt;set
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:interpolator="@android:anim/accelerate_interpolator"&gt;
  &lt;translate
    android:fromYDelta="-100%"
    android:toYDelta="0%"
    android:duration="700"
    android:fillBefore="true"
    android:fillAfter="true"&gt;
  &lt;/translate&gt;
&lt;/set&gt;

// slide down
&lt;set
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:interpolator="@android:anim/accelerate_interpolator"&gt;
  &lt;translate
    android:fromYDelta="0%"
    android:toYDelta="-100%"
    android:duration="700"
    android:fillBefore="true"
    android:fillAfter="true"&gt;
  &lt;/translate&gt;
&lt;/set&gt;
</code></pre>

<p>So my understanding - if I apply the slide-up animation, foo should reposition itself at -100% y, since fillBefore is true. It should then animate up to its original position, and stay there afterwards, since fillAfter is true. The slide down animation works similar. </p>

<p>But it's not working, the view seems to jump around. Any ideas how to do this?</p>

<p>Thanks</p>
