mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 10:48:19 +00:00
Let TaskbarDragView scale up before switching to system drag view
Test: Long press taskbar icons, ensure they aniamte the scale up Fixes: 182981908 Change-Id: I573fe66c93ebf995b3f56f2c003dee987687b6a7
This commit is contained in:
@@ -117,6 +117,24 @@ public class TaskbarDragController extends DragController<TaskbarActivityContext
|
||||
dragLayerY += dragRect.top;
|
||||
|
||||
DragOptions dragOptions = new DragOptions();
|
||||
dragOptions.preDragCondition = new DragOptions.PreDragCondition() {
|
||||
private DragView mDragView;
|
||||
|
||||
@Override
|
||||
public boolean shouldStartDrag(double distanceDragged) {
|
||||
return mDragView != null && mDragView.isAnimationFinished();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreDragStart(DropTarget.DragObject dragObject) {
|
||||
mDragView = dragObject.dragView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreDragEnd(DropTarget.DragObject dragObject, boolean dragStarted) {
|
||||
mDragView = null;
|
||||
}
|
||||
};
|
||||
// TODO: open popup/pre-drag
|
||||
// PopupContainerWithArrow popupContainer = PopupContainerWithArrow.showForIcon(view);
|
||||
// if (popupContainer != null) {
|
||||
@@ -155,6 +173,7 @@ public class TaskbarDragController extends DragController<TaskbarActivityContext
|
||||
|
||||
mDragObject = new DropTarget.DragObject(mActivity.getApplicationContext());
|
||||
mDragObject.originalView = originalView;
|
||||
mDragObject.deferDragViewCleanupPostAnimation = false;
|
||||
|
||||
mIsInPreDrag = mOptions.preDragCondition != null
|
||||
&& !mOptions.preDragCondition.shouldStartDrag(0);
|
||||
|
||||
Reference in New Issue
Block a user