First part of Fixing heads-up notification motion in split shade

This change makes dragging down HUN much better, without all shade breaking during the motion. Also when swiping up HUN now scrims (or other shade elements) are not showing up.

Changes:
- Refactoring logic for calculating transition distance in getMaxPanelHeight to getMaxPanelTransitionDistance and substituting it where appropriate. The most important part is setExpandedHeight which uses that value to calculate expansion fraction. With usual splitShadeTransitionDistance that fraction for HUN would over 1 and almost everything is visible immediately when starting to drag HUN up or down. That’s why when HUN is visible we want to ensure transition distance is bigger and dragging starts at around 0.4 of expansion when no elements are visible.

- HeadsUpTouchHelper was calculating panel scrim min fraction using maxPanelHeight which for split shade returned distance smaller than starting height and panel scrim min fraction was over 1. The fix is to move panel scrim min calculation to NPVC and make it dependent on scrimTransitionDistance. It must be different from getMaxPanelTransitionDistance because scrim expansion fraction is calculated based on scrimTransitionDistance in ScrimShadeTransitionController and resulting fraction would be bigger than minScrimFraction

There are still several bugs with HUN but it’s already looking better now and I’ll file separate bugs for other issues.

Test: NotificationPanelViewControllerTest
Test: swipe up HUN and observer shade elements stay invisible
Fixes: 232349737
Fixes: 234940017
Change-Id: Ie36a9fe8627f0f49168d30db1931aac723e15929
7 files changed