Loading core/java/android/view/DragEvent.java +6 −5 Original line number Diff line number Diff line Loading @@ -160,6 +160,8 @@ public class DragEvent implements Parcelable { * ACTION_DRAG_STARTED. * </p> * @see #ACTION_DRAG_ENDED * @see #getX() * @see #getY() */ public static final int ACTION_DRAG_STARTED = 1; Loading Loading @@ -323,17 +325,16 @@ public class DragEvent implements Parcelable { /** * Gets the X coordinate of the drag point. The value is only valid if the event action is * {@link #ACTION_DRAG_LOCATION} or {@link #ACTION_DROP}. * @return The current drag point's Y coordinate * {@link #ACTION_DRAG_STARTED}, {@link #ACTION_DRAG_LOCATION} or {@link #ACTION_DROP}. * @return The current drag point's X coordinate */ public float getX() { return mX; } /** * Gets the Y coordinate of the drag point. The value is valid if the * event action is {@link #ACTION_DRAG_ENTERED}, {@link #ACTION_DRAG_LOCATION}, * {@link #ACTION_DROP}, or {@link #ACTION_DRAG_EXITED}. * Gets the Y coordinate of the drag point. The value is only valid if the event action is * {@link #ACTION_DRAG_STARTED}, {@link #ACTION_DRAG_LOCATION} or {@link #ACTION_DROP}. * @return The current drag point's Y coordinate */ public float getY() { Loading core/java/android/view/ViewGroup.java +12 −0 Original line number Diff line number Diff line Loading @@ -1579,7 +1579,19 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager Log.d(View.VIEW_LOG_TAG, "Sending drag-started to view: " + child); } final float tx = mCurrentDragStartEvent.mX; final float ty = mCurrentDragStartEvent.mY; final float[] point = getTempPoint(); point[0] = tx; point[1] = ty; transformPointToViewLocal(point, child); mCurrentDragStartEvent.mX = point[0]; mCurrentDragStartEvent.mY = point[1]; final boolean canAccept = child.dispatchDragEvent(mCurrentDragStartEvent); mCurrentDragStartEvent.mX = tx; mCurrentDragStartEvent.mY = ty; if (canAccept) { mChildrenInterestedInDrag.add(child); if (!child.canAcceptDrag()) { Loading Loading
core/java/android/view/DragEvent.java +6 −5 Original line number Diff line number Diff line Loading @@ -160,6 +160,8 @@ public class DragEvent implements Parcelable { * ACTION_DRAG_STARTED. * </p> * @see #ACTION_DRAG_ENDED * @see #getX() * @see #getY() */ public static final int ACTION_DRAG_STARTED = 1; Loading Loading @@ -323,17 +325,16 @@ public class DragEvent implements Parcelable { /** * Gets the X coordinate of the drag point. The value is only valid if the event action is * {@link #ACTION_DRAG_LOCATION} or {@link #ACTION_DROP}. * @return The current drag point's Y coordinate * {@link #ACTION_DRAG_STARTED}, {@link #ACTION_DRAG_LOCATION} or {@link #ACTION_DROP}. * @return The current drag point's X coordinate */ public float getX() { return mX; } /** * Gets the Y coordinate of the drag point. The value is valid if the * event action is {@link #ACTION_DRAG_ENTERED}, {@link #ACTION_DRAG_LOCATION}, * {@link #ACTION_DROP}, or {@link #ACTION_DRAG_EXITED}. * Gets the Y coordinate of the drag point. The value is only valid if the event action is * {@link #ACTION_DRAG_STARTED}, {@link #ACTION_DRAG_LOCATION} or {@link #ACTION_DROP}. * @return The current drag point's Y coordinate */ public float getY() { Loading
core/java/android/view/ViewGroup.java +12 −0 Original line number Diff line number Diff line Loading @@ -1579,7 +1579,19 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager Log.d(View.VIEW_LOG_TAG, "Sending drag-started to view: " + child); } final float tx = mCurrentDragStartEvent.mX; final float ty = mCurrentDragStartEvent.mY; final float[] point = getTempPoint(); point[0] = tx; point[1] = ty; transformPointToViewLocal(point, child); mCurrentDragStartEvent.mX = point[0]; mCurrentDragStartEvent.mY = point[1]; final boolean canAccept = child.dispatchDragEvent(mCurrentDragStartEvent); mCurrentDragStartEvent.mX = tx; mCurrentDragStartEvent.mY = ty; if (canAccept) { mChildrenInterestedInDrag.add(child); if (!child.canAcceptDrag()) { Loading