title: Android 2.3: Animating a View?
body: <p>How can you change the coordinates of a view while its animating?  For instance, if I'm doing a translation of a View on the screen from left to right, I want the View to push everything to the right of it as its moving?</p>
  
  <pre><code>public Animation expandHiddenPanel(final View v, final boolean expand) {
      panelExpanded = expand;
      v.measure(MeasureSpec.makeMeasureSpec(200, MeasureSpec.AT_MOST), 
                MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
  
      final int initialWidth = v.getMeasuredWidth();
      Log.i("test", "initialWidth = " + initialWidth);
  
      v.getLayoutParams().width = 0;
      v.setVisibility(View.VISIBLE);
  
      Animation a = new Animation() {
          @Override
          protected void applyTransformation(float interpolatedTime, Transformation t) {
              int newWidth;
  
              if (expand) {
                  newWidth = (int)(initialWidth * interpolatedTime);
                  Log.i("test", "new Width = " + newWidth);
              }
              else {
                  newWidth = (int)(initialWidth * (1 - interpolatedTime));
                  Log.i("test", "new Width = " + newWidth);
              }
  
              v.getLayoutParams().width = newWidth;
              v.requestLayout();
          }
  
          @Override
          public boolean willChangeBounds() {
              return true;
          }
      };
  
      a.setInterpolator(new AccelerateInterpolator());
      a.setDuration(2500);
      a.setFillAfter(true);
      v.startAnimation(a);
  
      return a;
  }
  </code></pre>