Merge "Using newer object animators for click feedback animation. (3384873)" into honeycomb
This commit is contained in:
@@ -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"/>
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user