Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f5fde9d authored by lyn's avatar lyn Committed by Lyn Han
Browse files

Fix gap in shade from custom outline

This bug happened when a new notification animated in, where
- ActivatableNotificationView.mTargetPoint was null (from bugreport).
- ActivatableNotificationView.performAddAnimation()
  calls updateAppearRect() with ClipSide.BOTTOM

Key parts of this animation:
1. Y position: descend from above.
2. Height: unsquish from zero to full height.

Problem: double translation
- ActivatableNotificationView.updateAppearRect
  set outline Y with mAppearAnimationTranslation
  IN ADDITION TO dispatchDraw
  translating Canvas Y by mAppearAnimationTranslation
- Since notif contents are drawn in the Canvas window
  no part of it shows through the clipped window above the Canvas
  so we see a gap where the view should be

Solution: remove duplicate position logic
- ActivatableNotificationView.updateAppearRect() now
sets mOutlineRect using local (0,0 based) coordinates
to _only_ animate height

Fixes: 400978214
Test: Add hun/shade/ls notifs: no repro, no regressions, screenrecords in bug
Test: in ag/33977271 (with refactors and logs) to simplify cherry pick
Flag: EXEMPT bug fix

Change-Id: I28380fad37e1b2155a61adb8c76a72f04630c42e
parent de353672
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -612,8 +612,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
                        /* bottom= */ fullHeight
                );
            } else if (clipSide == BOTTOM) {
                setOutlineRect(0, mAppearAnimationTranslation, getWidth(),
                        height + mAppearAnimationTranslation);
                setOutlineRect(0, 0, getWidth(), height);
            }
        }
    }