Update/correct Drag and Drop docs.

am: c5109b3f6e

Change-Id: I6b64deb63cfdf6a2afac41cb819fb163b76f8849
This commit is contained in:
Vadim Tryshev
2016-09-23 23:33:42 +00:00
committed by android-build-merger
2 changed files with 38 additions and 23 deletions

View File

@@ -153,12 +153,16 @@ public class DragEvent implements Parcelable {
* if it can accept a drop. The onDragEvent() or onDrag() methods usually inspect the metadata
* from {@link #getClipDescription()} to determine if they can accept the data contained in
* this drag. For an operation that doesn't represent data transfer, these methods may
* perform other actions to determine whether or not the View should accept the drag.
* perform other actions to determine whether or not the View should accept the data.
* If the View wants to indicate that it is a valid drop target, it can also react by
* changing its appearance.
* <p>
* A View only receives further drag events if it returns {@code true} in response to
* ACTION_DRAG_STARTED.
* Views added or becoming visible for the first time during a drag operation receive this
* event when they are added or becoming visible.
* </p>
* <p>
* A View only receives further drag events if it returns {@code true} in response to
* ACTION_DRAG_STARTED.
* </p>
* @see #ACTION_DRAG_ENDED
* @see #getX()
@@ -177,9 +181,10 @@ public class DragEvent implements Parcelable {
* </p>
* <p>
* The system stops sending ACTION_DRAG_LOCATION events to a View once the user moves the
* drag shadow out of the View object's bounding box. If the user moves the drag shadow back
* into the View object's bounding box, the View receives an ACTION_DRAG_ENTERED again before
* receiving any more ACTION_DRAG_LOCATION events.
* drag shadow out of the View object's bounding box or into a descendant view that can accept
* the data. If the user moves the drag shadow back into the View object's bounding box or out
* of a descendant view that can accept the data, the View receives an ACTION_DRAG_ENTERED again
* before receiving any more ACTION_DRAG_LOCATION events.
* </p>
* @see #ACTION_DRAG_ENTERED
* @see #getX()
@@ -189,7 +194,8 @@ public class DragEvent implements Parcelable {
/**
* Action constant returned by {@link #getAction()}: Signals to a View that the user
* has released the drag shadow, and the drag point is within the bounding box of the View.
* has released the drag shadow, and the drag point is within the bounding box of the View and
* not within a descendant view that can accept the data.
* The View should retrieve the data from the DragEvent by calling {@link #getClipData()}.
* The methods {@link #getX()} and {@link #getY()} return the X and Y position of the drop point
* within the View object's bounding box.
@@ -212,8 +218,10 @@ public class DragEvent implements Parcelable {
* operation has concluded. A View that changed its appearance during the operation should
* return to its usual drawing state in response to this event.
* <p>
* All views that received an ACTION_DRAG_STARTED event will receive the
* ACTION_DRAG_ENDED event even if they are not currently visible when the drag ends.
* All views with listeners that returned boolean <code>true</code> for the ACTION_DRAG_STARTED
* event will receive the ACTION_DRAG_ENDED event even if they are not currently visible when
* the drag ends. Views removed during the drag operation won't receive the ACTION_DRAG_ENDED
* event.
* </p>
* <p>
* The View object can call {@link #getResult()} to see the result of the operation.
@@ -234,9 +242,10 @@ public class DragEvent implements Parcelable {
* drop target.
* </p>
* The system stops sending ACTION_DRAG_LOCATION events to a View once the user moves the
* drag shadow out of the View object's bounding box. If the user moves the drag shadow back
* into the View object's bounding box, the View receives an ACTION_DRAG_ENTERED again before
* receiving any more ACTION_DRAG_LOCATION events.
* drag shadow out of the View object's bounding box or into a descendant view that can accept
* the data. If the user moves the drag shadow back into the View object's bounding box or out
* of a descendant view that can accept the data, the View receives an ACTION_DRAG_ENTERED again
* before receiving any more ACTION_DRAG_LOCATION events.
* </p>
* @see #ACTION_DRAG_ENTERED
* @see #ACTION_DRAG_LOCATION
@@ -245,7 +254,8 @@ public class DragEvent implements Parcelable {
/**
* Action constant returned by {@link #getAction()}: Signals that the user has moved the
* drag shadow outside the bounding box of the View.
* drag shadow out of the bounding box of the View or into a descendant view that can accept
* the data.
* The View can react by changing its appearance in a way that tells the user that
* View is no longer the immediate drop target.
* <p>