title: Keep animated View at final Animation Position
body: <p>So I'm animating a view using animation:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;set xmlns:android="http://schemas.android.com/apk/res/android"
      android:interpolator="@android:anim/accelerate_interpolator" &gt;
  
      &lt;translate
          android:duration="1000"
          android:fromYDelta="0%"
          android:toYDelta="-75%" /&gt;
  
  &lt;/set&gt;
  </code></pre>
  
  <p>It does visually what I want but I also I want to freeze result of this animation. Like I need somehow to get resulting layout parameters (or something else?) after animation and set it to layout. Assume layout Y-coord is changing from 0 to 100 but I don't really know what was starting coords and what are resulting coords. I need to get resulting coords and set it to the layout cuz if wouldn't do so layout returns back to its initial position after animation but I need to make it stay in new position instead of returning back. Also I need 2.3.x compatible solution.<br>
  <strong>UPDATE 1</strong><br>
  I also tried NineOldAndroids:</p>
  
  <pre><code>ObjectAnimator.ofFloat(rootWrapper, "translationY", -rootWrapper.getHeight()*75/100).start();
  </code></pre>
  
  <p>this animates the view and view stays at animated position - thats exactly what I want to achieve.<br> However all controls stays at their positions virtually. Even thou layout is only visible by 25% of its bottom part and 75% of rest screen looks empty if I tap that empty screen area then button's (which was there b4 animation) onClick triggered. The same happens with xml-animtaions if set</p>
  
  <pre><code>animation.setFillAfter(true); 
  </code></pre>
  
  <p>How to fix that issue? All controls has to move with the view.<br>
  <strong>UPDATE 2</strong><br>
  The code:</p>
  
  <pre><code>    public void showAbout(){
  
          final Animation animShow = AnimationUtils.loadAnimation(this, R.anim.about_in_from_bottom);
          animShow.setFillAfter(true); 
  
          //ObjectAnimator.ofFloat(rootWrapper, "translationY", -rootWrapper.getHeight()*75/100).start();
  
          animShow.setAnimationListener(new AnimationListener() {
  
              @Override
              public void onAnimationStart(Animation animation) {
              }
  
              @Override
              public void onAnimationRepeat(Animation animation) {}
  
              @Override
              public void onAnimationEnd(Animation animation) {
                  LinearLayout.LayoutParams rootlp = (LinearLayout.LayoutParams) rootWrapper.getLayoutParams();
                  Log.i(this,"rootlp: h: "+rootlp.topMargin+ " / w: "+rootlp.bottomMargin);
                  rootlp.topMargin = -rootlp.height*75/100;
                  rootWrapper.setLayoutParams(rootlp);
              }
          });
  
          rootWrapper.startAnimation(animShow);
      }
  </code></pre>
  
  <p>I got the problem - <code>rootlp.height</code> returns 0 cuz its like MATCH_PARENT or like. It wont return the REAL pixels but some value representing some constant! So it looks like I have 2 play with <code>.getViewTreeObserver().addOnGlobalLayoutListener</code>.<br>
  Ok, I got the real height of rootWrapper via getViewTreeObserver(). And now using the formula <code>rootlp.topMargin = -rootlp.height*75/100;</code> I'm getting even more issues.<br> 1) After animation View moves up additionally (due to setting LP).<br>
  2) Controls that animated View contains (buttons which has to move up with the parent View) stays at their positions virtually (they are invisible but clickable)! Visually those controls are moved up with the animated View and I can't reach it (it goes off the screen). But if I tap area where they was before animation corresponding onClick() triggers! What a fun!<br>
  <strong>UPDATE 3</strong><br>
  Finally I had achieved my goal! The problem was with moving View's child containers. I was thinking that if I move some View then all of its child views are also moving. But thats not the case and I was had to move child views manually after animation completes to fix ghost buttons.</p>