Move the drag thing into its own window that goes around on top of everything else.
This commit is contained in:
1 parent
1772142611
commit
00acb123c5
17 files changed
+838
-679
No files matched your search
@@ -30,8 +30,9 @@ import android.graphics.Canvas;
|
||||
public class AllAppsGridView extends GridView implements AdapterView.OnItemClickListener,
|
||||
AdapterView.OnItemLongClickListener, DragSource {
|
||||
|
||||
private DragController mDragger;
|
||||
private DragController mDragController;
|
||||
private Launcher mLauncher;
|
||||
private boolean mDraw = true;
|
||||
|
||||
public AllAppsGridView(Context context) {
|
||||
super(context);
|
||||
@@ -64,20 +65,33 @@ public class AllAppsGridView extends GridView implements AdapterView.OnItemClick
|
||||
ApplicationInfo app = (ApplicationInfo) parent.getItemAtPosition(position);
|
||||
app = new ApplicationInfo(app);
|
||||
|
||||
mDragger.startDrag(view, this, app, DragController.DRAG_ACTION_COPY);
|
||||
mLauncher.closeAllApplications();
|
||||
|
||||
mDragController.startDrag(view, this, app, DragController.DRAG_ACTION_COPY);
|
||||
mLauncher.showWorkspace();
|
||||
mDraw = false;
|
||||
invalidate();
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setDragger(DragController dragger) {
|
||||
mDragger = dragger;
|
||||
@Override
|
||||
protected void dispatchDraw(Canvas canvas) {
|
||||
if (mDraw) {
|
||||
super.dispatchDraw(canvas);
|
||||
}
|
||||
}
|
||||
|
||||
public void setDragController(DragController dragController) {
|
||||
mDragController = dragController;
|
||||
}
|
||||
|
||||
public void onDropCompleted(View target, boolean success) {
|
||||
mLauncher.closeAllAppsDialog(false);
|
||||
}
|
||||
|
||||
void setLauncher(Launcher launcher) {
|
||||
mLauncher = launcher;
|
||||
}
|
||||
|
||||
void onPrepareDialog() {
|
||||
mDraw = true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user