Fixing page background not displayed when dragging from all apps

> Adding empty page synchronously, instead of waiting for a frame
> Changing launcher state from widgets screen in the same frame, similar to all apps
> Removing DragEnforcer, and moving that logic in side the workspace, disabled by a flag
> Using first page to get page bounds in drag layer, as last page may not have been measured

Change-Id: I172ba4e5ce44648ac55402d49994542c6e10f101
This commit is contained in:
Sunny Goyal
2015-05-26 18:56:52 -07:00
parent 5cc7af12f1
commit 58376925f9
7 changed files with 53 additions and 76 deletions

View File

@@ -16,10 +16,8 @@
package com.android.launcher3;
import android.content.Context;
import android.graphics.PointF;
import android.graphics.Rect;
import android.util.Log;
/**
* Interface defining an object that can receive a drag.
@@ -93,43 +91,6 @@ public interface DropTarget {
}
}
public static class DragEnforcer implements DragController.DragListener {
int dragParity = 0;
public DragEnforcer(Context context) {
Launcher launcher = (Launcher) context;
launcher.getDragController().addDragListener(this);
}
void onDragEnter() {
dragParity++;
if (dragParity != 1) {
Log.e(TAG, "onDragEnter: Drag contract violated: " + dragParity);
}
}
void onDragExit() {
dragParity--;
if (dragParity != 0) {
Log.e(TAG, "onDragExit: Drag contract violated: " + dragParity);
}
}
@Override
public void onDragStart(DragSource source, Object info, int dragAction) {
if (dragParity != 0) {
Log.e(TAG, "onDragEnter: Drag contract violated: " + dragParity);
}
}
@Override
public void onDragEnd() {
if (dragParity != 0) {
Log.e(TAG, "onDragExit: Drag contract violated: " + dragParity);
}
}
}
/**
* Used to temporarily disable certain drop targets
*