From 706918a2742110c44a13753d9037df3feab5ace3 Mon Sep 17 00:00:00 2001 From: rachelzhang Date: Mon, 25 Aug 2014 11:01:55 -0700 Subject: Fix alarm lockscreen crash Bug: 17247630 Change-Id: I425e30601a4f19dfdc51f7afb919c9f8eb05b034 --- src/com/android/deskclock/alarms/AlarmActivity.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/com/android/deskclock/alarms/AlarmActivity.java b/src/com/android/deskclock/alarms/AlarmActivity.java index ed1732a9f..24ef7a749 100644 --- a/src/com/android/deskclock/alarms/AlarmActivity.java +++ b/src/com/android/deskclock/alarms/AlarmActivity.java @@ -73,7 +73,7 @@ public class AlarmActivity extends Activity { private static final float SCALE_SLOPE = 0.3f; private static final int RIPPLE_DELAY_MS = 500; - private static final int FINISH_ACTIVITY_DELAY_MS = 2500; + private static final int FINISH_ACTIVITY_DELAY_MS = 2000; private View mCenterButton; private View mContentView; @@ -453,8 +453,7 @@ public class AlarmActivity extends Activity { final View revealView = new View(this); revealView.setBottom(displayRect.bottom); revealView.setLeft(displayRect.left); - // TODO: remove this -1 hack after reveal animation optimization bug fix - revealView.setRight(displayRect.right - 1); + revealView.setRight(displayRect.right); revealView.setBackgroundColor(revealColor); final int[] clearLocation = new int[2]; @@ -470,10 +469,9 @@ public class AlarmActivity extends Activity { final float revealRadius = (float) Math.max(Math.sqrt(x1_2 + y_2), Math.sqrt(x2_2 + y_2)); final ViewGroupOverlay groupOverlay = (ViewGroupOverlay) mContentView.getOverlay(); - final ValueAnimator revealAnimator = (ValueAnimator) - ViewAnimationUtils.createCircularReveal(revealView, + final Animator revealAnimator = ViewAnimationUtils.createCircularReveal(revealView, revealCenterX, revealCenterY, 0.0f, revealRadius); - revealAnimator.setDuration(DateUtils.SECOND_IN_MILLIS); + revealAnimator.setDuration(DateUtils.SECOND_IN_MILLIS / 2); revealAnimator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animator) { -- cgit v1.2.3 From d71c8a369003de0064b3522e43854a0f09d78720 Mon Sep 17 00:00:00 2001 From: rachelzhang Date: Thu, 28 Aug 2014 12:16:49 -0700 Subject: Attach alarm lockscreen animator view to a parent Bug: 17316762 - Additional checks introduced by ag/534856 now require that the target of ViewAnimationUtils#createCircularReveal has a parent before being invoked. See b/17316066 Change-Id: If0d6cd548f1749cd5a2ba63ea4de8d1c77639e59 --- src/com/android/deskclock/alarms/AlarmActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/deskclock/alarms/AlarmActivity.java b/src/com/android/deskclock/alarms/AlarmActivity.java index 67f310c5c..3b5d741ea 100644 --- a/src/com/android/deskclock/alarms/AlarmActivity.java +++ b/src/com/android/deskclock/alarms/AlarmActivity.java @@ -450,7 +450,9 @@ public class AlarmActivity extends Activity { final Rect displayRect = new Rect(); getWindow().getDecorView().getGlobalVisibleRect(displayRect); + final ViewGroupOverlay groupOverlay = (ViewGroupOverlay) mContentView.getOverlay(); final View revealView = new View(this); + groupOverlay.add(revealView); revealView.setBottom(displayRect.bottom); revealView.setLeft(displayRect.left); revealView.setRight(displayRect.right); @@ -468,7 +470,6 @@ public class AlarmActivity extends Activity { final double y_2 = Math.pow(revealView.getTop() - revealCenterY, 2); final float revealRadius = (float) Math.max(Math.sqrt(x1_2 + y_2), Math.sqrt(x2_2 + y_2)); - final ViewGroupOverlay groupOverlay = (ViewGroupOverlay) mContentView.getOverlay(); final Animator revealAnimator = ViewAnimationUtils.createCircularReveal(revealView, revealCenterX, revealCenterY, 0.0f, revealRadius); revealAnimator.setDuration(DateUtils.SECOND_IN_MILLIS / 2); -- cgit v1.2.3