Search in sources :

Example 36 with ClipData

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);
}
Also used : ClipData(android.content.ClipData) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View)

Example 37 with ClipData

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);
}
Also used : ClipData(android.content.ClipData) ImageView(android.widget.ImageView) View(android.view.View)

Example 38 with ClipData

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);
}
Also used : ClipData(android.content.ClipData) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View)

Example 39 with ClipData

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;
}
Also used : ClipboardManager(android.content.ClipboardManager) ClipData(android.content.ClipData)

Example 40 with ClipData

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);
    }
}
Also used : ClipboardManager(android.content.ClipboardManager) ClipData(android.content.ClipData)

Aggregations

ClipData (android.content.ClipData)193 ClipboardManager (android.content.ClipboardManager)81 Intent (android.content.Intent)48 Uri (android.net.Uri)41 Paint (android.graphics.Paint)24 MenuItem (android.view.MenuItem)20 View (android.view.View)16 ArrayList (java.util.ArrayList)15 TextView (android.widget.TextView)12 PendingIntent (android.app.PendingIntent)11 Bundle (android.os.Bundle)11 RemoteException (android.os.RemoteException)11 ContentResolver (android.content.ContentResolver)10 Nullable (android.support.annotation.Nullable)10 TextPaint (android.text.TextPaint)10 ImageView (android.widget.ImageView)10 DocumentInfo (com.android.documentsui.model.DocumentInfo)10 Item (android.content.ClipData.Item)9 Editable (android.text.Editable)9 DialogInterface (android.content.DialogInterface)8