android.widget.ImageView.startDragAndDrop()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(157)

本文整理了Java中android.widget.ImageView.startDragAndDrop()方法的一些代码示例,展示了ImageView.startDragAndDrop()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.startDragAndDrop()方法的具体详情如下:
包路径:android.widget.ImageView
类名称:ImageView
方法名:startDragAndDrop

ImageView.startDragAndDrop介绍

暂无

代码示例

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onLongClick(View view) {
 ClipData clip=buildClip();
 View.DragShadowBuilder shadow=new ThumbDragShadow();
 iv.startDragAndDrop(clip, shadow, null,
  View.DRAG_FLAG_GLOBAL|View.DRAG_FLAG_GLOBAL_URI_READ|
   View.DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION);
 return(true);
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onLongClick(View view) {
 Uri uri=PROVIDER
  .buildUpon()
  .appendEncodedPath(StreamProvider.getUriPrefix(AUTHORITY))
  .appendEncodedPath("assets/FreedomTower-Morning.jpg")
  .build();
 ClipData clip=ClipData.newRawUri(getString(R.string.msg_photo), uri);
 View.DragShadowBuilder shadow=new ThumbDragShadow();
 iv.startDragAndDrop(clip, shadow, Boolean.TRUE,
  View.DRAG_FLAG_GLOBAL|View.DRAG_FLAG_GLOBAL_URI_READ|
   View.DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION);
 return(true);
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onLongClick(View view) {
 Uri uri=PROVIDER
  .buildUpon()
  .appendEncodedPath(StreamProvider.getUriPrefix(AUTHORITY))
  .appendEncodedPath("assets/FreedomTower-Morning.jpg")
  .build();
 ClipData clip=ClipData.newRawUri(getString(R.string.msg_photo), uri);
 View.DragShadowBuilder shadow=new ThumbDragShadow();
 iv.startDragAndDrop(clip, shadow, Boolean.TRUE,
  View.DRAG_FLAG_GLOBAL|View.DRAG_FLAG_GLOBAL_URI_READ|
   View.DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION);
 return(true);
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onLongClick(View view) {
 Uri uri=PROVIDER
  .buildUpon()
  .appendEncodedPath(StreamProvider.getUriPrefix(AUTHORITY))
  .appendEncodedPath("assets/FreedomTower-Morning.jpg")
  .build();
 ClipData clip=ClipData.newRawUri(getString(R.string.msg_photo), uri);
 View.DragShadowBuilder shadow=new ThumbDragShadow();
 if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.N) {
  iv.startDragAndDrop(clip, shadow, Boolean.TRUE, 0);
 }
 else {
  iv.startDrag(clip, shadow, Boolean.TRUE, 0);
 }
 return(true);
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onLongClick(View view) {
 Uri uri=PROVIDER
  .buildUpon()
  .appendEncodedPath(StreamProvider.getUriPrefix(AUTHORITY))
  .appendEncodedPath("assets/FreedomTower-Morning.jpg")
  .build();
 ClipData clip=ClipData.newRawUri(getString(R.string.msg_photo), uri);
 View.DragShadowBuilder shadow=new ThumbDragShadow();
 if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.N) {
  iv.startDragAndDrop(clip, shadow, null,
   View.DRAG_FLAG_GLOBAL | View.DRAG_FLAG_GLOBAL_URI_READ |
    View.DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION);
 }
 else {
  iv.startDrag(clip, shadow, null, 0);
 }
 return(true);
}

相关文章

ImageView类方法