mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-18 02:08:20 +00:00
Removing drag and drop parity exceptions
Change-Id: I065c9376ebeedc6b11d1ac5805e0326bd7dd8f26
This commit is contained in:
@@ -19,6 +19,7 @@ package com.android.launcher2;
|
||||
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.
|
||||
@@ -26,6 +27,8 @@ import android.graphics.Rect;
|
||||
*/
|
||||
public interface DropTarget {
|
||||
|
||||
public static final String TAG = "DropTarget";
|
||||
|
||||
class DragObject {
|
||||
public int x = -1;
|
||||
public int y = -1;
|
||||
@@ -75,28 +78,28 @@ public interface DropTarget {
|
||||
void onDragEnter() {
|
||||
dragParity++;
|
||||
if (dragParity != 1) {
|
||||
throw new RuntimeException("onDragEnter: Drag contract violated: " + dragParity);
|
||||
Log.e(TAG, "onDragEnter: Drag contract violated: " + dragParity);
|
||||
}
|
||||
}
|
||||
|
||||
void onDragExit() {
|
||||
dragParity--;
|
||||
if (dragParity != 0) {
|
||||
throw new RuntimeException("onDragExit: Drag contract violated: " + dragParity);
|
||||
Log.e(TAG, "onDragExit: Drag contract violated: " + dragParity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDragStart(DragSource source, Object info, int dragAction) {
|
||||
if (dragParity != 0) {
|
||||
throw new RuntimeException("onDragEnter: Drag contract violated: " + dragParity);
|
||||
Log.e(TAG, "onDragEnter: Drag contract violated: " + dragParity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDragEnd() {
|
||||
if (dragParity != 0) {
|
||||
throw new RuntimeException("onDragExit: Drag contract violated: " + dragParity);
|
||||
Log.e(TAG, "onDragExit: Drag contract violated: " + dragParity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user