This is my xml file inside then anim folder. When I run the app then an error in parsing is shown.
shake.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
< translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:fromXDelta="0%"
android:interpolator="@anim/cycle_7"
android:toXDelta="5%" />
</set>
cycle_7.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
< cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
android:cycles="7" />
</set>
IT People Always Welcome Here you find full code that you are looking for.
<translate xmlns:android="http://schemas.android.com/apk/res/android" android:fromXDelta="0%" android:toXDelta="5%" android:duration="1000" android:interpolator="@anim/cycle_7" />
<cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android" android:cycles="7" />
private void showError() {
Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake);
mEditText.startAnimation(shake);
}
<
and translate
if you have copied code. Check it out.<set>
is not required as i have run demo with my above code its working fine.Thank you. May this will helpful you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With