Shake Animation To Any View In Android

[Solved] Shake Animation To Any View In Android | Swift - Code Explorer | yomemimo.com
Question : shake animation in android

Answered by : sourav-maurya

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"> <rotate android:duration="70" android:fromDegrees="-5" android:interpolator="@android:anim/linear_interpolator" android:pivotX="50%" android:pivotY="50%" android:repeatCount="5" android:repeatMode="reverse" android:toDegrees="5" /> <translate android:duration="70" android:fromXDelta="-10" android:interpolator="@android:anim/linear_interpolator" android:repeatCount="5" android:repeatMode="reverse" android:toXDelta="10" />
</set>
//Then this code in java file
if (TextUtils.isEmpty(phone.getText()) || phone.getText().length() < 10) { //shake animation phone.startAnimation(AnimationUtils.loadAnimation(getActivity(), R.anim.shake)); }

Source : https://stackoverflow.com/questions/9448732/shaking-wobble-view-animation-in-android | Last Update : Wed, 25 May 22

Question : shake animation android

Answered by : exuberant-elk-u7m4xgq4668w

<?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="infinite" android:repeatMode="reverse" android:toDegrees="5" />

Source : https://stackoverflow.com/questions/9448732/shaking-wobble-view-animation-in-android | Last Update : Thu, 22 Oct 20

Answers related to shake animation to any view in android

Code Explorer Popular Question For Swift