Skip to content

Commit

Permalink
From Lawnchair: Fix ghost pop-up (@paphonb)
Browse files Browse the repository at this point in the history
  • Loading branch information
amirzaidi committed Aug 25, 2017
1 parent b9fdeb0 commit c8bbb85
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/com/android/launcher3/folder/Folder.java
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ public void animateOpen() {
float radius = (float) Math.hypot(rx, ry);

Animator reveal = new CircleRevealOutlineProvider((int) getPivotX(),
(int) getPivotY(), 0, radius).createRevealAnimator(this);
(int) getPivotY(), 0, radius).createRevealAnimator(this, false, true);
reveal.setDuration(mMaterialExpandDuration);
reveal.setInterpolator(new LogDecelerateInterpolator(100, 0));

Expand Down
10 changes: 8 additions & 2 deletions src/com/android/launcher3/util/RevealOutlineAnimation.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public ValueAnimator createRevealAnimator(final View revealView) {
}

public ValueAnimator createRevealAnimator(final View revealView, boolean isReversed) {
return createRevealAnimator(revealView, isReversed, false);
}

public ValueAnimator createRevealAnimator(final View revealView, boolean isReversed, final boolean restoreOutline) {
ValueAnimator va =
isReversed ? ValueAnimator.ofFloat(1f, 0f) : ValueAnimator.ofFloat(0f, 1f);
final float elevation = revealView.getElevation();
Expand All @@ -55,8 +59,10 @@ public void onAnimationCancel(Animator animation) {

public void onAnimationEnd(Animator animation) {
if (!mWasCanceled) {
revealView.setOutlineProvider(ViewOutlineProvider.BACKGROUND);
revealView.setClipToOutline(false);
if (restoreOutline) {
revealView.setOutlineProvider(ViewOutlineProvider.BACKGROUND);
revealView.setClipToOutline(false);
}
if (shouldRemoveElevationDuringAnimation()) {
revealView.setTranslationZ(0);
}
Expand Down

0 comments on commit c8bbb85

Please sign in to comment.