Skip to content

Commit

Permalink
Fix FabTransform circular reveal calculation
Browse files Browse the repository at this point in the history
This isn't really noticable at high speeds from a fab to a dialog, but slowed down you see that the transition from the fab to an activity cuts off after approx. 75% of the animation and just jumps to the non-clipped activity. With this fix the end radius gets calculated correctly. Same for the reversed transition.
  • Loading branch information
wasdennnoch authored Jul 3, 2016
1 parent 77ce671 commit 5fded59
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,14 @@ public Animator createAnimator(final ViewGroup sceneRoot,
view.getWidth() / 2,
view.getHeight() / 2,
startBounds.width() / 2,
(float) Math.hypot(endBounds.width() / 2, endBounds.width() / 2));
(float) Math.hypot(endBounds.width() / 2, endBounds.height() / 2));
circularReveal.setInterpolator(
AnimUtils.getFastOutLinearInInterpolator(sceneRoot.getContext()));
} else {
circularReveal = ViewAnimationUtils.createCircularReveal(view,
view.getWidth() / 2,
view.getHeight() / 2,
(float) Math.hypot(startBounds.width() / 2, startBounds.width() / 2),
(float) Math.hypot(startBounds.width() / 2, startBounds.height() / 2),
endBounds.width() / 2);
circularReveal.setInterpolator(
AnimUtils.getLinearOutSlowInInterpolator(sceneRoot.getContext()));
Expand Down

0 comments on commit 5fded59

Please sign in to comment.