am 28514f8f: Merge "API CHANGE: startDrag() now takes "int flags" instead of "boolean localOnly"" into honeycomb
* commit '28514f8f9cdac95799d5654a30fe36ef05443dd3': API CHANGE: startDrag() now takes "int flags" instead of "boolean localOnly"
This commit is contained in:
@@ -121,7 +121,7 @@ interface IWindowSession {
|
||||
* the drag to the OS and passes that as the return value. A return value of
|
||||
* null indicates failure.
|
||||
*/
|
||||
IBinder prepareDrag(IWindow window, boolean localOnly,
|
||||
IBinder prepareDrag(IWindow window, int flags,
|
||||
int thumbnailWidth, int thumbnailHeight, out Surface outSurface);
|
||||
|
||||
/**
|
||||
|
||||
@@ -2137,6 +2137,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
|
||||
*/
|
||||
boolean mCanAcceptDrop;
|
||||
|
||||
/**
|
||||
* Flag indicating that a drag can cross window boundaries
|
||||
* @hide
|
||||
*/
|
||||
public static final int DRAG_FLAG_GLOBAL = 1;
|
||||
|
||||
/**
|
||||
* Position of the vertical scroll bar.
|
||||
*/
|
||||
@@ -10633,22 +10639,21 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
|
||||
*
|
||||
* @param data !!! TODO
|
||||
* @param shadowBuilder !!! TODO
|
||||
* @param myWindowOnly When {@code true}, indicates that the drag operation should be
|
||||
* restricted to the calling application. In this case only the calling application
|
||||
* will see any DragEvents related to this drag operation.
|
||||
* @param myLocalState An arbitrary object that will be passed as part of every DragEvent
|
||||
* delivered to the calling application during the course of the current drag operation.
|
||||
* This object is private to the application that called startDrag(), and is not
|
||||
* visible to other applications. It provides a lightweight way for the application to
|
||||
* propagate information from the initiator to the recipient of a drag within its own
|
||||
* application; for example, to help disambiguate between 'copy' and 'move' semantics.
|
||||
* @param flags Flags affecting the drag operation. At present no flags are defined;
|
||||
* pass 0 for this parameter.
|
||||
* @return {@code true} if the drag operation was initiated successfully; {@code false} if
|
||||
* an error prevented the drag from taking place.
|
||||
*/
|
||||
public final boolean startDrag(ClipData data, DragShadowBuilder shadowBuilder,
|
||||
boolean myWindowOnly, Object myLocalState) {
|
||||
Object myLocalState, int flags) {
|
||||
if (ViewDebug.DEBUG_DRAG) {
|
||||
Log.d(VIEW_LOG_TAG, "startDrag: data=" + data + " local=" + myWindowOnly);
|
||||
Log.d(VIEW_LOG_TAG, "startDrag: data=" + data + " flags=" + flags);
|
||||
}
|
||||
boolean okay = false;
|
||||
|
||||
@@ -10668,7 +10673,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
|
||||
Surface surface = new Surface();
|
||||
try {
|
||||
IBinder token = mAttachInfo.mSession.prepareDrag(mAttachInfo.mWindow,
|
||||
myWindowOnly, shadowSize.x, shadowSize.y, surface);
|
||||
flags, shadowSize.x, shadowSize.y, surface);
|
||||
if (ViewDebug.DEBUG_DRAG) Log.d(VIEW_LOG_TAG, "prepareDrag returned token=" + token
|
||||
+ " surface=" + surface);
|
||||
if (token != null) {
|
||||
|
||||
@@ -8104,7 +8104,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
||||
CharSequence selectedText = mTransformed.subSequence(start, end);
|
||||
ClipData data = ClipData.newPlainText(null, null, selectedText);
|
||||
DragLocalState localState = new DragLocalState(this, start, end);
|
||||
startDrag(data, getTextThumbnailBuilder(selectedText), false, localState);
|
||||
startDrag(data, getTextThumbnailBuilder(selectedText), localState, 0);
|
||||
stopSelectionActionMode();
|
||||
} else {
|
||||
updateSelectedRegion();
|
||||
|
||||
Reference in New Issue
Block a user