Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Zoom Animation in android

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 445
    Comment on it

    Zooming Animation in android

    Here I am writing a code for zoom animation.
    Here I have add this animation on mic button. You can add it according to your requirements.
    First of all implements Animation.AnimationListener listener.
    Then in your activity do this

      Animation animZoomIn;
    animZoomIn = AnimationUtils.loadAnimation(this, R.anim.zoom_in);
            animZoomIn.setAnimationListener(this);
    
    

    You have to specify your animation in an xml. This is the zoom_in.xml in anim folder in res file.

    <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="1.5"
        android:repeatCount="infinite"
        android:repeatMode="restart"
        android:toYScale="1.5" >
    </scale>
    

    click of an image or any event, you can start animation like this.

      micImage.startAnimation(animZoomIn);
    

    When you want to close animation for this image you just have to call

    micImage.clearAnimation();
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           

You must be logged in to access this page

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:

You must be logged in to access this page

Reset Password
Fill out the form below and reset your password:

You must be logged in to access this page