Wednesday, 8 June 2016

XML : element decelerateinterpolator must be declared error

I tried to create a decelerateInterpolator as in the example from Android Doc to declare a decelerateInterpolator:

EXAMPLE: XML file saved at res/anim/my_overshoot_interpolator.xml:

  <?xml version="1.0" encoding="utf-8"?> <overshootInterpolator xmlns:android="http://schemas.android.com/apk/res/android"      android:tension="7.0"      /> This animation XML will apply the interpolator:    

This animation XML will apply the interpolator:

  <scale xmlns:android="http://schemas.android.com/apk/res/android"      android:interpolator="@anim/my_overshoot_interpolator"      android:fromXScale="1.0"      android:toXScale="3.0"      android:fromYScale="1.0"      android:toYScale="3.0"      android:pivotX="50%"      android:pivotY="50%"      android:duration="700" />    

Mine was like this:

  <?xml version="1.0" encoding="utf-8"?>  <decelerateInterpolator xmlns:android="http://schemas.android.com/apk/res/android"      android:factor="1"  />    

But I got the following error: element decelerateinterpolator must be declared error. The code compiles but I got no effect in the Activity transition below:

  <?xml version="1.0" encoding="utf-8"?>  <set xmlns:android="http://schemas.android.com/apk/res/android">      <translate          android:interpolator="@animator/my_interpolator"          android:fromYDelta="8%"          android:toYDelta="0%"          android:duration="@android:integer/config_shortAnimTime" />  </set>    

What is causing this error?

P.S.: And yes, I did call overridePendingTransition with the transition above

No comments:

Post a Comment