Code example for ScaleAnimation

Methods: setAnimationListener, setDuration, setFillAfter

0
    } 
 
    // 2b 
    public void scaleOut() { 
      Log.i("animation", "scaling out ...");
      ScaleAnimation animation = new ScaleAnimation(1.0f, 0.0f, 1.0f, 0.0f);
      animation.setFillAfter(true);
      animation.setDuration(5000);
      animation.setAnimationListener(new ScaleOutEndListener());
      animView.startAnimation(animation); 
    } 
 
    private class ScaleOutEndListener implements AnimationListener {
        public void onAnimationEnd(Animation animation) {
          scaleIn(); 
        } 
        public void onAnimationRepeat(Animation animation) { }
        public void onAnimationStart(Animation animation) { }
    } 
 
    // 3b