Skip to content
Commit 8c5a4918 authored by Lyn Han's avatar Lyn Han
Browse files

Fix HUN pinning

1) Fix IF we pin ----------

To pin HUNs, in StackScrollAlgorithm#updateHeadsUpStates, we need
mustStayOnScreen=True, but it is False
headsUpIsVisible=False, but it is True

How this happened:
Incoming HUNs have viewState.yTranslation=0 initially.

SSA#updateChild sets `headsUpIsVisible=True` based on
viewState.yTranslation=0 __before__ viewState.yTranslation is set
to mCurrentYPosition of AlgorithmState, marking the incoming HUN
as pinned and seen (when in fact it was scrolled above the screen)

Downstream in ExpandableNotificationRow,
setHeadsUpIsVisible sets mustStayOnScreen=False.
which skips pinning on the next iteration of
StackScrollAlgorithm#updateHeadsUpStates.


2) Fix WHERE we pin ----------

In S, we introduced fullscreen notification scrolling that covers quick quick settings, such that the qqs offset (visually, the bottom of the status bar when shade is open) is where notifications get clipped as they scroll up. Use this as the highest pin point instead of topPadding.


3) Implement pinned HUN CORNER ROUNDNESS animation ----------
   during expanded_qs <=> qqs/notifs transition.

When quick settings is expanded fullscreen, incoming HUNs are pinned to the bottom (y = top of nav bar - collapsed height) with ROUND bottom corners. When the user swipes up to show notifications again, if the pinned HUN is not the last notification in its section, animate its bottom corners from round to not_round.


4) Add tests and comments for the above, and for existing clampHunToTop implementation.


Fixes: 192566080
Test: StackScrollAlgorithmTest

Test: in test app, send delayed HUN with max priority
      => pin new/updated HUN to qqs offset when notifications are
         scrolled fullscreen; scroll to top, collapsed HUN transitions
         to full height as stack becomes unscrolled
      => show HUN first in unscrolled/slightly scrolled stack
      => pin HUN to bottom in expanded (fullscreen) quick settings,
         go back to qqs/notifications; corners unround smoothly
         if needed
      => pulse/lockscreen/normal HUN, swipe down from HUN to open
         shade; no regressions

Change-Id: Id51736be124f93ec524c2e74a5c879cd9489efc3
parent 9bf63618
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment