diff --git a/core/java/android/view/ViewAnimationUtils.java b/core/java/android/view/ViewAnimationUtils.java index d44df3133ff9b..4c75935d6e23b 100644 --- a/core/java/android/view/ViewAnimationUtils.java +++ b/core/java/android/view/ViewAnimationUtils.java @@ -43,8 +43,10 @@ public final class ViewAnimationUtils { * on thread responsiveness. * * @param view The View will be clipped to the animating circle. - * @param centerX The x coordinate of the center of the animating circle. - * @param centerY The y coordinate of the center of the animating circle. + * @param centerX The x coordinate of the center of the animating circle, relative to + * view. + * @param centerY The y coordinate of the center of the animating circle, relative to + * view. * @param startRadius The starting radius of the animating circle. * @param endRadius The ending radius of the animating circle. */ diff --git a/docs/html/training/material/animations.jd b/docs/html/training/material/animations.jd index 86e91a795e888..6f263dba57d12 100644 --- a/docs/html/training/material/animations.jd +++ b/docs/html/training/material/animations.jd @@ -81,8 +81,8 @@ reveal or hide a view.

View myView = findViewById(R.id.my_view); // get the center for the clipping circle -int cx = (myView.getLeft() + myView.getRight()) / 2; -int cy = (myView.getTop() + myView.getBottom()) / 2; +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()); @@ -103,8 +103,8 @@ anim.start(); final View myView = findViewById(R.id.my_view); // get the center for the clipping circle -int cx = (myView.getLeft() + myView.getRight()) / 2; -int cy = (myView.getTop() + myView.getBottom()) / 2; +int cx = myView.getWidth() / 2; +int cy = myView.getHeight() / 2; // get the initial radius for the clipping circle int initialRadius = myView.getWidth();