本文整理了Java中android.widget.ImageView.startDrag()
方法的一些代码示例,展示了ImageView.startDrag()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.startDrag()
方法的具体详情如下:
包路径:android.widget.ImageView
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!