mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-18 02:08:20 +00:00
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:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user