API CHANGE: startDrag() now takes "int flags" instead of "boolean localOnly"

startDrag() that crosses application boundaries will remain @hide until we get
more of the surrounding behaviors nailed down.

Drag-and-drop demo updated to only show app-local drag operations pro tem.

Change-Id: I9cdcd132c1aae45bc472e70293b7187b4cba9bca
This commit is contained in:
Christopher Tate
2011-01-10 20:45:20 -08:00
parent d8126c7d89
commit 134fada434
4 changed files with 2 additions and 22 deletions

View File

@@ -39,8 +39,6 @@ public class DragAndDropDemo extends Activity {
dot.setReportView(text);
dot = (DraggableDot) findViewById(R.id.drag_dot_3);
dot.setReportView(text);
dot = (DraggableDot) findViewById(R.id.drag_dot_4);
dot.setReportView(text);
mResultText = (TextView) findViewById(R.id.drag_result_text);
mResultText.setOnDragListener(new View.OnDragListener() {

View File

@@ -48,7 +48,6 @@ public class DraggableDot extends View {
int mRadius;
int mAnrType;
boolean mLocalOnly;
CharSequence mLegend;
static final int ANR_NONE = 0;
@@ -123,21 +122,17 @@ public class DraggableDot extends View {
case R.styleable.DraggableDot_anr: {
mAnrType = a.getInt(attr, 0);
} break;
case R.styleable.DraggableDot_localOnly: {
mLocalOnly = a.getBoolean(attr, false);
} break;
}
}
Log.i(TAG, "DraggableDot @ " + this + " : radius=" + mRadius + " legend='" + mLegend
+ "' anr=" + mAnrType + " local=" + mLocalOnly);
+ "' anr=" + mAnrType);
setOnLongClickListener(new View.OnLongClickListener() {
public boolean onLongClick(View v) {
ClipData data = ClipData.newPlainText("dot", null, "Dot : " + v.toString());
v.startDrag(data, new ANRShadowBuilder(v, mAnrType == ANR_SHADOW),
mLocalOnly, (Object)v);
(Object)v, 0);
return true;
}
});