mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 19:38:21 +00:00
Add new app close implementation.
- We remove the fling completely - We set damping to 1 for x/y springs so there is no bounciness, and updated the stiffness and bounds to tighten up the path to the final location. - During the animation, we translate all launcher content down - When the x/y springs, and rect animator all finish, we use a spring to bounce the launcher content back up - Added AppCloseConfig so that the entire animation can be defined in one location, with getter methods so that all the involved parties of the animation can access the current value. - The animations are all defined linearly, and then interpolated over using a 3 point curve. Building behind feature flag as we tune the values. Bug: 173107751 Test: manual, visual Change-Id: I83ad0fa2c4234cf30004240d43e191354595adc8
This commit is contained in:
@@ -119,7 +119,7 @@ public class WorkspaceStateTransitionAnimation {
|
||||
propertySetter.setFloat(mWorkspace, SCALE_PROPERTY, mNewScale, scaleInterpolator);
|
||||
}
|
||||
|
||||
setPivotToScaleWithWorkspace(hotseat);
|
||||
mWorkspace.setPivotToScaleWithSelf(hotseat);
|
||||
float hotseatScale = hotseatScaleAndTranslation.scale;
|
||||
if (shouldSpring) {
|
||||
PendingAnimation pa = (PendingAnimation) propertySetter;
|
||||
@@ -156,18 +156,6 @@ public class WorkspaceStateTransitionAnimation {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the given view's pivot point to match the workspace's, so that it scales together. Since
|
||||
* both this view and workspace can move, transform the point manually instead of using
|
||||
* dragLayer.getDescendantCoordRelativeToSelf and related methods.
|
||||
*/
|
||||
private void setPivotToScaleWithWorkspace(View sibling) {
|
||||
sibling.setPivotY(mWorkspace.getPivotY() + mWorkspace.getTop()
|
||||
- sibling.getTop() - sibling.getTranslationY());
|
||||
sibling.setPivotX(mWorkspace.getPivotX() + mWorkspace.getLeft()
|
||||
- sibling.getLeft() - sibling.getTranslationX());
|
||||
}
|
||||
|
||||
public void setScrim(PropertySetter propertySetter, LauncherState state,
|
||||
StateAnimationConfig config) {
|
||||
Scrim workspaceDragScrim = mLauncher.getDragLayer().getWorkspaceDragScrim();
|
||||
|
||||
Reference in New Issue
Block a user