summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cervera <rcervera@google.com>2014-11-04 17:56:21 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-11-04 17:56:22 +0000
commit61f91724a9375732cd95333921388a3e5a64ac33 (patch)
treefcc4c0a004b28a88de0304e02c0a0519978565cf
parenta827de4e8bcd8d90987387b1acf8d8856104e21c (diff)
parent5f79d17a6bd77ed9ee4f7346bb7f7c13bef3df33 (diff)
downloadframeworks_base-61f91724a9375732cd95333921388a3e5a64ac33.zip
frameworks_base-61f91724a9375732cd95333921388a3e5a64ac33.tar.gz
frameworks_base-61f91724a9375732cd95333921388a3e5a64ac33.tar.bz2
Merge "docs: Fix the circularReveal example." into lmp-docs
-rw-r--r--docs/html/training/material/animations.jd8
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/html/training/material/animations.jd b/docs/html/training/material/animations.jd
index e8291b8..efc0ee3 100644
--- a/docs/html/training/material/animations.jd
+++ b/docs/html/training/material/animations.jd
@@ -84,12 +84,14 @@ int cx = (myView.getLeft() + myView.getRight()) / 2;
int cy = (myView.getTop() + myView.getBottom()) / 2;
// get the final radius for the clipping circle
-int finalRadius = myView.getWidth();
+int finalRadius = Math.max(myView.getWidth(), myView.getHeight());
-// create and start the animator for this view
-// (the start radius is zero)
+// create the animator for this view (the start radius is zero)
Animator anim =
ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius);
+
+// make the view visible and start the animation
+myView.setVisibility(View.VISIBLE);
anim.start();
</pre>