title: TranslateAnimation - Image Disappearing when Animation is started
body: <p>I tried defining the animation in an xml file but it does not offer enough flexibility. Any ideas on how I can get this to work in code.</p>
  
  <p>My image disappears and then reappears when the animation starts. Essentially, when I lift a finger, I would need the image to move back to its original position as a slow slide. this is not happening for some reason.</p>
  
  <p>Java CODE:</p>
  
  <pre><code>chargeButton.setOnTouchListener(new View.OnTouchListener() {
      @Override
      public boolean onTouch(View v, MotionEvent event) {
          int x_cord = (int) event.getRawX();
          int y_cord = (int) event.getRawY();
  
          switch (event.getActionMasked()){
              case MotionEvent.ACTION_DOWN:
                  break;
              case MotionEvent.ACTION_MOVE:
                  chargeButton.setLayoutParams(setPosition(x_cord, false));
                  break;
              case MotionEvent.ACTION_UP:
                  int x_start = x_cord;
                  x_cord = 0;
                  slowMove(x_start, x_cord, false);
  
                  break;
              default:
                  break;
          }
          return true;
      }
  });
  
  
  }
  
  public void slowMove(int x_start, int x_final, boolean pay)
  {
  Animation transAnimation = new TranslateAnimation(x_start, x_final, 0, 0);
  transAnimation.setFillAfter(true);
  transAnimation.setDuration(1000);
  if (pay)
      payButton.startAnimation(transAnimation);
  else
  {
      chargeButton.clearAnimation();
      chargeButton.startAnimation(transAnimation);
  }
  }
  </code></pre>
  
  <p>I would really appreciate any help I can get. </p>