mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Some drag and drop code refactor:
1) Adding DragOptions to easily extend drap functionality 2) Changing onDragStarted signature to send more information 3) Updating states for dropTargetButton based on drag event directly 4) Removing folder item based on onDragStarted and not startDrag Change-Id: I65b684e092ddc081d086bfe2c8c1973ed170eaeb
This commit is contained in:
@@ -27,6 +27,7 @@ import android.view.animation.AccelerateInterpolator;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.android.launcher3.dragndrop.DragController;
|
||||
import com.android.launcher3.dragndrop.DragOptions;
|
||||
|
||||
/*
|
||||
* The top bar containing various drop targets: Delete/App Info/Uninstall.
|
||||
@@ -120,17 +121,11 @@ public class DropTargetBar extends LinearLayout implements DragController.DragLi
|
||||
}
|
||||
}
|
||||
|
||||
public void enableAccessibleDrag(boolean enable) {
|
||||
mDeleteDropTarget.enableAccessibleDrag(enable);
|
||||
mAppInfoDropTarget.enableAccessibleDrag(enable);
|
||||
mUninstallDropTarget.enableAccessibleDrag(enable);
|
||||
}
|
||||
|
||||
/*
|
||||
* DragController.DragListener implementation
|
||||
*/
|
||||
@Override
|
||||
public void onDragStart(DragSource source, ItemInfo info, int dragAction) {
|
||||
public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) {
|
||||
animateToVisibility(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user