Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Vibrate Animation to ImageView

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.35k
    Comment on it

    To give imageview / button vibrate animation, need to follow these steps.


    1. create xml file "vibrate_anim.xml" in anim folder
    <!--?xml version="1.0" encoding="utf-8"?-->
    
    <rotate xmlns:android="http://schemas.android.com/apk/res/android" 
    android:duration="100"
    android:fromdegrees="-5" 
    android:pivotx="50%" 
    android:pivoty="50%" 
    android:repeatcount="5"
    android:repeatmode="reverse" 
    
    </rotate>android:toDegrees="5" />
    


    2.Onclick of Button/Image, give animation to it.

    Animation vibrateAnimation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.vibrate_anim);
                myImage.startAnimation(shake);


    Hope, it will help you.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

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