summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2015-07-27 19:18:34 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-07-27 19:18:34 +0000
commit935b4444160ca816a769faf509a2d6789e5e6651 (patch)
tree32cb84b2fe8c7f46ddb155aa4bc4d47e2bec5c2b
parent3eb14e0383b15a379bd224cabdebe4e5d7366279 (diff)
parent58d1995c904f12dfb00185af3dabfe267d50568a (diff)
downloadpackages_apps_Settings-935b4444160ca816a769faf509a2d6789e5e6651.zip
packages_apps_Settings-935b4444160ca816a769faf509a2d6789e5e6651.tar.gz
packages_apps_Settings-935b4444160ca816a769faf509a2d6789e5e6651.tar.bz2
am 58d1995c: Merge "Move PIN/Pattern appear animation to RenderThread (2/2)" into mnc-dev
* commit '58d1995c904f12dfb00185af3dabfe267d50568a': Move PIN/Pattern appear animation to RenderThread (2/2)
-rw-r--r--src/com/android/settings/ConfirmLockPattern.java40
1 files changed, 6 insertions, 34 deletions
diff --git a/src/com/android/settings/ConfirmLockPattern.java b/src/com/android/settings/ConfirmLockPattern.java
index d86d63b..da3aeb8 100644
--- a/src/com/android/settings/ConfirmLockPattern.java
+++ b/src/com/android/settings/ConfirmLockPattern.java
@@ -499,40 +499,12 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
final Runnable finishListener) {
if (obj instanceof LockPatternView.CellState) {
final LockPatternView.CellState animatedCell = (LockPatternView.CellState) obj;
- if (appearing) {
- animatedCell.scale = 0.0f;
- animatedCell.alpha = 1.0f;
- }
- animatedCell.translateY = appearing ? translationY : 0;
- ValueAnimator animator = ValueAnimator.ofFloat(animatedCell.translateY,
- appearing ? 0 : translationY);
- animator.setInterpolator(interpolator);
- animator.setDuration(duration);
- animator.setStartDelay(delay);
- animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
- @Override
- public void onAnimationUpdate(ValueAnimator animation) {
- float animatedFraction = animation.getAnimatedFraction();
- if (appearing) {
- animatedCell.scale = animatedFraction;
- } else {
- animatedCell.alpha = 1 - animatedFraction;
- }
- animatedCell.translateY = (float) animation.getAnimatedValue();
- mLockPatternView.invalidate();
- }
- });
- if (finishListener != null) {
- animator.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- finishListener.run();
- }
- });
- }
-
- animator.start();
- mLockPatternView.invalidate();
+ mLockPatternView.startCellStateAnimation(animatedCell,
+ 1f, appearing ? 1f : 0f, /* alpha */
+ appearing ? translationY : 0f, /* startTranslation */
+ appearing ? 0f : translationY, /* endTranslation */
+ appearing ? 0f : 1f, 1f /* scale */,
+ delay, duration, interpolator, finishListener);
} else {
mAppearAnimationUtils.createAnimation((View) obj, delay, duration, translationY,
appearing, interpolator, finishListener);