diff options
author | Ricardo Cervera <rcervera@google.com> | 2014-10-29 13:26:39 -0700 |
---|---|---|
committer | Ricardo Cervera <rcervera@google.com> | 2014-10-29 13:43:57 -0700 |
commit | 5f79d17a6bd77ed9ee4f7346bb7f7c13bef3df33 (patch) | |
tree | 6508512e70cbab64f0068b41726ceb9b9565446f | |
parent | 0fa6edced7496b898d31ff7dab7255a1e0dffa9b (diff) | |
download | frameworks_base-5f79d17a6bd77ed9ee4f7346bb7f7c13bef3df33.zip frameworks_base-5f79d17a6bd77ed9ee4f7346bb7f7c13bef3df33.tar.gz frameworks_base-5f79d17a6bd77ed9ee4f7346bb7f7c13bef3df33.tar.bz2 |
docs: Fix the circularReveal example.
Change-Id: Iac7cab08c179f7f5318ba0e5ed6bad1dd2b29b4e
-rw-r--r-- | docs/html/training/material/animations.jd | 8 |
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> |