title: Android: How to expand and shrink a view diagonally?
body: <p>I am trying to animate a view which expands and shrinks back to the initial size. I tried using animation set to add two animations so that the second animation will start after the first animation but was not able to get it working. </p>
  
  <pre><code>AnimationSet expandAndShrink = new AnimationSet(true);
  ScaleAnimation expand = new ScaleAnimation(
       1f, 1.5f, 
       1f, 1.5f,
       Animation.RELATIVE_TO_PARENT, 0,
       Animation.RELATIVE_TO_PARENT, 0);
  
  ScaleAnimation shrink = new ScaleAnimation(
       1.5f, 1f, 
       1.5f, 1f,
       Animation.RELATIVE_TO_PARENT, 1f,
       Animation.RELATIVE_TO_PARENT, 1f);
  
  expandAndShrink.addAnimation(expand);
  expandAndShrink.addAnimation(shrink)
  expandAndShrink.setFillAfter(true);
  expandAndShrink.setDuration(1000);
  expandAndShrink.setInterpolator(new AccelerateInterpolator(1.0f));
  
  view.bringToFront();
  view.startAnimation(expandAndShrink);
  </code></pre>
  
  <p>I really appreciate any help to get it working. Thanks in advance</p>