Add atomic recents animation while swiping up

State handlers can now specify atomic and non-atomic components of
their animations to states, which can be specified when creating a
new animation. There is now one atomic animation, when going from
NORMAL to OVERVIEW (and in reverse):
- RecentsViewStateController's animation (scale/alpha) is all atomic
- WorkspaceStateTransitionAnimation has atomic and non-atomic:
  - Hotseat and workspace alpha is atomic, as is workspace scale
  - Everything else (scrim, translation, qsb and drag handle alpha) is
    non-atomic
- All apps progress is non-atomic

Also simplified dragging through overview; no longer pulls against you,
so we use an OvershootInterpolator when flinging instead of our custom
interpolator for the spring effect.

Bug: 76449024
Bug: 78089840
Change-Id: Iafac84d0c2b99ee9cf9dd5b30e2218286713b449
This commit is contained in:
Tony Wickham
2018-04-19 11:39:34 -07:00
parent 639b07178f
commit 6becf7c07d
13 changed files with 241 additions and 147 deletions

View File

@@ -25,6 +25,7 @@ import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.Workspace;
import com.android.launcher3.allapps.DiscoveryBounce;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.quickstep.views.RecentsView;
@@ -47,8 +48,12 @@ public class OverviewState extends LauncherState {
@Override
public float[] getWorkspaceScaleAndTranslation(Launcher launcher) {
// TODO: provide a valid value
return new float[]{1, 0, -launcher.getDeviceProfile().hotseatBarSizePx / 2};
RecentsView recentsView = launcher.getOverviewPanel();
Workspace workspace = launcher.getWorkspace();
recentsView.getTaskSize(sTempRect);
float scale = (float) sTempRect.width() / workspace.getWidth();
float parallaxFactor = 0.4f;
return new float[]{scale, 0, -getDefaultSwipeHeight(launcher) * parallaxFactor};
}
@Override