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
    • 2.24k
    Comment on it

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


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


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

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


    Hope, it will help you.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

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