Bug fix: QSB sometimes gets stuck to transparent.

At some places, we were calling removeAllListeners before calling cancel
 on an animation. AnimationListeners are also used to track states, and
 removing listeners before canceling will prevent onAnimationEnd to be
 called, thus preventing state cleanup.
 PinchAnimationManager was causing ZeroAlphaAnimatorListener to be removing
 from Qsb alpha animation, making the MultiStateAlphaController think there
 is a zeroAlpha animation running.

> Removing all instances of removeAllListeners
> Updating various affected listeners to handle onAnimatinoCancel
> Fixing WorkspaceStateTransitionAnimation, which was animation QSB alpha
  on page scroll index

Bug: 31910152
Change-Id: Ie7f31b67d4c502badcdd41f7b04867d1f35f5d27
This commit is contained in:
Sunny Goyal
2016-11-24 06:46:50 +05:30
parent feba90fe80
commit 1c581c6d61
5 changed files with 35 additions and 22 deletions

View File

@@ -356,7 +356,8 @@ public class WorkspaceStateTransitionAnimation {
cl.setShortcutAndWidgetAlpha(finalAlpha);
}
if (Workspace.isQsbContainerPage(i)) {
if (Workspace.isQsbContainerPage(i) &&
states.stateIsNormal && mWorkspaceFadeInAdjacentScreens) {
if (animated) {
Animator anim = mWorkspace.mQsbAlphaController
.animateAlphaAtIndex(finalAlpha, Workspace.QSB_ALPHA_INDEX_PAGE_SCROLL);
@@ -372,8 +373,6 @@ public class WorkspaceStateTransitionAnimation {
final ViewGroup overviewPanel = mLauncher.getOverviewPanel();
final View qsbContainer = mLauncher.getQsbContainer();
Animator qsbAlphaAnimation = mWorkspace.mQsbAlphaController
.animateAlphaAtIndex(finalQsbAlpha, Workspace.QSB_ALPHA_INDEX_STATE_CHANGE);
@@ -395,7 +394,7 @@ public class WorkspaceStateTransitionAnimation {
// For animation optimization, we may need to provide the Launcher transition
// with a set of views on which to force build and manage layers in certain scenarios.
layerViews.addView(overviewPanel);
layerViews.addView(qsbContainer);
layerViews.addView(mLauncher.getQsbContainer());
layerViews.addView(mLauncher.getHotseat());
layerViews.addView(mWorkspace.getPageIndicator());