title: Zoom in zoom out animation
body: <p>I am testing a zoom in/zoom out animation when an image is clicked. But I didn't get the results I wanted. The image completely zooms in but does not completely zoom out. For better understanding of my problem, see <a href="https://goo.gl/photos/52XwkQGPihzgFXGS7" rel="nofollow">this video</a>.</p>
  
  <p>Here is my code:</p>
  
  <p><strong>zoom_in.XML</strong></p>
  
  <pre><code>&lt;set xmlns:android="http://schemas.android.com/apk/res/android" android:fillAfter="true" &gt;
  &lt;scale
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:duration="1000"
      android:fromXScale="1"
      android:fromYScale="1"
      android:pivotX="50%"
      android:pivotY="50%"
      android:toXScale="3"
      android:toYScale="3" &gt;
  &lt;/scale&gt;
  &lt;/set&gt;
  </code></pre>
  
  <p><strong>zoom_out.xml</strong></p>
  
  <pre><code>&lt;set xmlns:android="http://schemas.android.com/apk/res/android" android:fillAfter="true" &gt;
  &lt;scale
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:duration="1000"
      android:fromXScale="1.0"
      android:fromYScale="1.0"
      android:pivotX="50%"
      android:pivotY="50%"
      android:toXScale="0.5"
      android:toYScale="0.5" &gt;
  &lt;/scale&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>mainactivity</strong></p>
  
  <pre><code>public class MainActivity extends Activity 
   {
  @Override
  protected void onCreate(Bundle savedInstanceState)
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      ImageButton pic = (ImageButton) findViewById(R.id.levelimg);
      pic.setOnClickListener(new OnClickListener(){
          @Override
          public void onClick(View v){
              final Dialog dialog = new Dialog(MainActivity.this);
              dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
              dialog.setContentView(R.layout.dialogpic);
              dialog.getWindow().getAttributes().windowAnimations = R.style.DialogAnimation;
              dialog.show();
          }
      });
  }
    }
  </code></pre>
  
  <p><strong>my dailog animation style</strong></p>
  
  <pre><code>&lt;style name="DialogAnimation"&gt;
      &lt;item name="android:windowEnterAnimation"&gt;@anim/zoom_in&lt;/item&gt;
      &lt;item name="android:windowExitAnimation"&gt;@anim/zoom_out&lt;/item&gt;
      &lt;/style&gt;
  </code></pre>