Merge "Using newer object animators for click feedback animation. (3384873)" into honeycomb
diff --git a/res/anim/paged_view_click_feedback.xml b/res/anim/paged_view_click_feedback.xml
index d1e6e23..eb7ecef 100644
--- a/res/anim/paged_view_click_feedback.xml
+++ b/res/anim/paged_view_click_feedback.xml
@@ -14,10 +14,11 @@
      limitations under the License.
 -->
 
-<alpha xmlns:android="http://schemas.android.com/apk/res/android"
-    android:fromAlpha="1.0"
-    android:toAlpha="0.5"
-    android:duration="75"
-    android:fillAfter="true"
+<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
+    android:valueFrom="1.0"
+    android:valueTo="0.5"
+    android:valueType="floatType"
+    android:duration="100"
+    android:propertyName="alpha"
     android:repeatCount="1"
-    android:repeatMode="reverse" />
+    android:repeatMode="reverse"/>
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index d99921f..c9044b4 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -18,6 +18,10 @@
 
 import java.util.ArrayList;
 
+import android.animation.Animator;
+import android.animation.AnimatorInflater;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.ObjectAnimator;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.graphics.Canvas;
@@ -32,9 +36,6 @@
 import android.view.ViewConfiguration;
 import android.view.ViewGroup;
 import android.view.ViewParent;
-import android.view.animation.Animation;
-import android.view.animation.Animation.AnimationListener;
-import android.view.animation.AnimationUtils;
 import android.view.animation.Interpolator;
 import android.widget.Checkable;
 import android.widget.Scroller;
@@ -809,19 +810,15 @@
 
     protected void animateClickFeedback(View v, final Runnable r) {
         // animate the view slightly to show click feedback running some logic after it is "pressed"
-        Animation anim = AnimationUtils.loadAnimation(getContext(), 
-                R.anim.paged_view_click_feedback);
-        anim.setAnimationListener(new AnimationListener() {
-            @Override
-            public void onAnimationStart(Animation animation) {}
-            @Override
-            public void onAnimationRepeat(Animation animation) {
+        ObjectAnimator anim = (ObjectAnimator) AnimatorInflater.
+                loadAnimator(mContext, R.anim.paged_view_click_feedback);
+        anim.setTarget(v);
+        anim.addListener(new AnimatorListenerAdapter() {
+            public void onAnimationRepeat(Animator animation) {
                 r.run();
             }
-            @Override
-            public void onAnimationEnd(Animation animation) {}
         });
-        v.startAnimation(anim);
+        anim.start();
     }
 
     /*