PiP: Update menu state AFTER animation is done for show/hide/resize.
When hiding the menu, there is a brief moment where the menu hide
animation is running, but the menu is already set as hidden in
mMenuState. In that case, other menu operations, such as resizing it,
would no-op, since it assumes the menu is not visible to the user
anymore. We will update the menu at end of the animation so that before
the animation finishes, we will respect that the menu is still in its
previous state. This will break apart the callback into two parts -
onMenuStateChanging, and onMenuStateChangeFinish.
Additionally, PipAnimationController used to only control animating the
PiP leash, but not the menu. This CL also adds a handler callback to
allow menu controller to apply the transaction.
Bug: 185513811
Bug: 186424689
Test: Tap once (show menu), pinch resize - menu resizes & fade along
with the resize
Test: Resize to smallest size, tap once (so that it grows bigger), and
then tap outside region - see that the menu no longer lags behind on
fading out.
Change-Id: I4432961aff074f4569d5d6d61b0e917511e2cbad
7 files changed