OSDN Git Service

Merge "Corrected code snippet for reveal effect" into mnc-docs
authorAndrew Solovay <asolovay@google.com>
Tue, 12 Jan 2016 18:46:05 +0000 (18:46 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Tue, 12 Jan 2016 18:46:05 +0000 (18:46 +0000)
docs/html/training/material/animations.jd

index 3375af6..a29354f 100644 (file)
@@ -85,7 +85,7 @@ int cx = myView.getWidth() / 2;
 int cy = myView.getHeight() / 2;
 
 // get the final radius for the clipping circle
-int finalRadius = Math.max(myView.getWidth(), myView.getHeight());
+float finalRadius = (float) Math.hypot(cx, cy);
 
 // create the animator for this view (the start radius is zero)
 Animator anim =
@@ -107,7 +107,7 @@ int cx = myView.getWidth() / 2;
 int cy = myView.getHeight() / 2;
 
 // get the initial radius for the clipping circle
-int initialRadius = myView.getWidth();
+float initialRadius = (float) Math.hypot(cx, cy);
 
 // create the animation (the final radius is zero)
 Animator anim =