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

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

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

ImageView.startDrag介绍

暂无

代码示例

代码示例来源: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: stackoverflow.com

View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(img);
img.startDrag(data, shadowBuilder, img, 0);
img.setVisibility(View.INVISIBLE);
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类方法