Add null check before playing recents scale down anim

When swiping up to overview from an app, we scale down RecentsView in
launcher, synchronized with the app window. In rare cases, however,
there may not be any TaskViews in launcher, so we should just ignore
the launcher component in this case. For example, this happens in
LockTask mode.

Bug: 110703110
Change-Id: Ib6f836581a3e12babf4e26e272b77bb529f86fd4
This commit is contained in:
Tony Wickham
2018-07-18 15:51:43 -07:00
parent 00fec0d53b
commit 7cc878b5ae

View File

@@ -294,6 +294,9 @@ public interface ActivityControlHelper<T extends BaseDraggingActivity> {
private void playScaleDownAnim(AnimatorSet anim, Launcher launcher) {
RecentsView recentsView = launcher.getOverviewPanel();
TaskView v = recentsView.getTaskViewAt(recentsView.getCurrentPage());
if (v == null) {
return;
}
ClipAnimationHelper clipHelper = new ClipAnimationHelper();
clipHelper.fromTaskThumbnailView(v.getThumbnail(), (RecentsView) v.getParent(), null);
if (!clipHelper.getSourceRect().isEmpty() && !clipHelper.getTargetRect().isEmpty()) {