Simplifying the drop animation code

> Removing some unused parameters

Bug: 190524398
Test: Manual
Change-Id: Iea0c2e7a9d30a10fd7443ea57992c59ea60badf8
This commit is contained in:
Sunny Goyal
2021-06-08 12:57:40 -07:00
parent 0622a1e470
commit 1721ccf385
6 changed files with 105 additions and 167 deletions

View File

@@ -17,6 +17,7 @@
package com.android.launcher3;
import static androidx.annotation.VisibleForTesting.PROTECTED;
import static com.android.launcher3.LauncherAnimUtils.SPRING_LOADED_EXIT_DELAY;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
import static com.android.launcher3.LauncherState.ALL_APPS;
@@ -2684,9 +2685,6 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
public void animateWidgetDrop(ItemInfo info, CellLayout cellLayout, final DragView dragView,
final Runnable onCompleteRunnable, int animationType, final View finalView,
boolean external) {
Rect from = new Rect();
mLauncher.getDragLayer().getViewRectRelativeToSelf(dragView, from);
int[] finalPos = new int[2];
float scaleXY[] = new float[2];
boolean scalePreview = !(info instanceof PendingAddShortcutInfo);
@@ -2730,8 +2728,8 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
}
}
};
dragLayer.animateViewIntoPosition(dragView, from.left, from.top, finalPos[0],
finalPos[1], 1, 1, 1, scaleXY[0], scaleXY[1], onComplete, endStyle,
dragLayer.animateViewIntoPosition(dragView, finalPos[0],
finalPos[1], 1, scaleXY[0], scaleXY[1], onComplete, endStyle,
duration, this);
}
}