Fix flicker in predictive back to home animation
The predictive back to home animation has a small flicker sometimes with the predictive_back_to_home_polish flag enabled. It is caused by the setLauncherScale call in LauncherBackAnimationController#finishAnimation.
To fix this, we no longer make that call in the case when back is committed, but only when back is cancelled. It's not necessary to make the call in the commit case anyways because the ScalingWorkspaceRevealAnim takes care of the Launcher scale in that case.
The reason for the flicker is that finishAnimation is called BEFORE the ScalingWorkspaceRevealAnim has finished, causing them to interfere. This is expected. We don't want to wait for the ScalingWorkspaceRevealAnim (which has a very soft and slow landing). Instead, we only want to wait for the spring animation that animates the app window into the Launcher icon, which ends earlier.
Bug: 382453424
Test: Manual, i.e. verified that flicker is not reproducible
Flag: com.android.launcher3.predictive_back_to_home_polish
Change-Id: I6bb04cd5b168442f39debb66872c668c5ad58fcd
1 file changed