use of android.content.ClipData in project cw-omnibus by commonsguy.
the class RowController method onLongClick.
@Override
public boolean onLongClick(View v) {
ClipData clip = ClipData.newRawUri(title.getText(), videoUri);
View.DragShadowBuilder shadow = new View.DragShadowBuilder(thumbnail);
itemView.startDrag(clip, shadow, Boolean.TRUE, 0);
return (true);
}
use of android.content.ClipData in project cw-omnibus by commonsguy.
the class MainActivity method onLongClick.
@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);
}
use of android.content.ClipData in project cw-omnibus by commonsguy.
the class RowController method onLongClick.
@Override
public boolean onLongClick(View v) {
ClipData clip = ClipData.newRawUri(title.getText(), videoUri);
View.DragShadowBuilder shadow = new View.DragShadowBuilder(thumbnail);
itemView.startDrag(clip, shadow, null, 0);
return (true);
}
use of android.content.ClipData in project AndroidUtilCode by Blankj.
the class ClipboardUtils method getIntent.
/**
* 获取剪贴板的意图
*
* @return 剪贴板的意图
*/
public static Intent getIntent() {
ClipboardManager clipboard = (ClipboardManager) Utils.getContext().getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = clipboard.getPrimaryClip();
if (clip != null && clip.getItemCount() > 0) {
return clip.getItemAt(0).getIntent();
}
return null;
}
use of android.content.ClipData in project CustomActivityOnCrash by Ereza.
the class DefaultErrorActivity method copyErrorToClipboard.
private void copyErrorToClipboard() {
String errorInformation = CustomActivityOnCrash.getAllErrorDetailsFromIntent(DefaultErrorActivity.this, getIntent());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText(getString(R.string.customactivityoncrash_error_activity_error_details_clipboard_label), errorInformation);
clipboard.setPrimaryClip(clip);
} else {
//noinspection deprecation
android.text.ClipboardManager clipboard = (android.text.ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
clipboard.setText(errorInformation);
}
}
Aggregations