Fix bug where icon is no present during app close animation.

* WindowTransformSwipeHandler closes all AbstractFloatingViews, including
  ListenerView, which results in FloatingIconView getting removed.
* In IconLoadResult.onIconLoaded, we remove the check for isIconLoaded since
  its not needed. This was also causing a race condition since isIconLoaded
  is not set to true until after we tell onIconLoaded to run.
* In BaseDragLayer, we have a delay before checking if the view is open and
  then closing the floating view if true. This caused issues since we reycle
  the view. Now we check if the view is open before running the delay to call
  close.

Bug: 136044361
Change-Id: I7442a589a62c3cdf90b70d146e0ecf3e4300ddf7
This commit is contained in:
Jon Miranda
2019-07-02 14:35:11 -07:00
parent bd0003da99
commit 826cdcd32f
3 changed files with 11 additions and 12 deletions

View File

@@ -574,17 +574,17 @@ public class FloatingIconView extends View implements
if (cancellationSignal.isCanceled()) {
return;
}
if (mIconLoadResult.isIconLoaded) {
setIcon(originalView, mIconLoadResult.drawable, mIconLoadResult.badge,
mIconLoadResult.iconOffset);
}
setIcon(originalView, mIconLoadResult.drawable, mIconLoadResult.badge,
mIconLoadResult.iconOffset);
// Delay swapping views until the icon is loaded to prevent a flash.
setVisibility(VISIBLE);
originalView.setVisibility(INVISIBLE);
};
mLoadIconSignal = cancellationSignal;
}
}
mLoadIconSignal = cancellationSignal;
}
private void setBackgroundDrawableBounds(float scale) {