am 27b3721b: Merge "Using newer object animators for click feedback animation. (3384873)" into honeycomb

* commit '27b3721bf904d2a1789938a77d3344b8792a41e2':
  Using newer object animators for click feedback animation. (3384873)
This commit is contained in:
Winson Chung
2011-01-26 22:55:56 -08:00
committed by Android Git Automerger
2 changed files with 17 additions and 19 deletions
+7 -6
View File
@@ -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"/>
+10 -13
View File
@@ -18,6 +18,10 @@ package com.android.launcher2;
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.View;
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 @@ public abstract class PagedView extends ViewGroup {
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();
}
/*