title: Android - TranslateAnimate one view to another view
body: <p>I want to include a simple animation in my app where a <strike>view</strike> widget moves to another <strike>view</strike> widget.</p>
  
  <p>The code I have written is:</p>
  
  <pre><code>TranslateAnimation animate = new TranslateAnimation(view1.getTranslationX(), view1.getTranslationY(), view2.getTranslationX(), view2.getTranlationY());
  animate.setDuration(500);
  view1.startAnimation(animate);
  </code></pre>
  
  <p>The problem is that <code>view1</code> is a custom view inherited from <code>ViewSwitcher</code> whereas <code>view2</code> is a <code>Button</code>. getTranslation() gives no such method exception for both.</p>
  
  <p>How can I get the view's position on screen and is this the right way to do the animation ?</p>
  
  <p><b>Note:</b> The <code>ViewSwitcher</code> is part of a <code>ListView</code> item so it also needs to cross over its <code>ListView</code> boundary to get to the <code>Button</code>(just in case that makes a difference).</p>