Java Code Examples for android.view.View.startDrag()

The following are Jave code examples for showing how to use startDrag() of the android.view.View class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: SmingZZick_App   File: StickerApplyAdapter.java   Source Code and License Vote up 7 votes
@Override
public boolean onLongClick(View v) {
    ClipData.Item item = new ClipData.Item("" + v.getTag());
    ClipData dragData = new ClipData("" + v.getTag(), new String[] {ClipDescription.MIMETYPE_TEXT_PLAIN},item);

    View.DragShadowBuilder myShadow = new MyDragShadowBuilder(v);

    showDragBuide();
    v.startDrag(dragData,  // the data to be dragged
            myShadow,  // the drag shadow builder
            null,      // no need to use local data
            0          // flags (not currently used, set to 0)
    );
    v.setAlpha(0.2f);
    return true;
}
 
Example 2
Project: Demos   File: DragFillBlankView.java   Source Code and License Vote up 6 votes
/**
 * 开始拖拽
 *
 * @param v 当前对象
 */
private void startDrag(View v) {
    // 选项内容
    String optionContent = ((Button) v).getText().toString();
    // 记录当前答案选项的位置
    optionPosition = getOptionPosition(optionContent);
    // 开始拖拽后在列表中隐藏答案选项
    v.setVisibility(INVISIBLE);

    ClipData.Item item = new ClipData.Item(optionContent);
    ClipData data = new ClipData(null, new String[]{ClipDescription.MIMETYPE_TEXT_PLAIN}, item);
    v.startDrag(data, new DragShadowBuilder(v), null, 0);
}
 
Example 3
Project: JavaIsFun   File: LacoDeRepeticao7.java   Source Code and License Vote up 6 votes
@Override
public boolean onLongClick(View v) {
    ClipData data = ClipData.newPlainText("simple_text", "text");


    View.DragShadowBuilder sb = new View.DragShadowBuilder(v);

    v.startDrag(data, sb, v, 0);

    v.setVisibility(View.INVISIBLE);




    return (true);
}
 
Example 4
Project: JavaIsFun   File: Vetores9.java   Source Code and License Vote up 5 votes
@Override
public boolean onLongClick(View v) {
    ClipData data = ClipData.newPlainText("simple_text", "text");


    View.DragShadowBuilder sb = new View.DragShadowBuilder(v);

    v.startDrag(data, sb, v, 0);

    v.setVisibility(View.INVISIBLE);




    return (true);
}
 
Example 5
Project: JavaIsFun   File: Vetores8.java   Source Code and License Vote up 5 votes
@Override
public boolean onLongClick(View v) {
    ClipData data = ClipData.newPlainText("simple_text", "text");


    View.DragShadowBuilder sb = new View.DragShadowBuilder(v);

    v.startDrag(data, sb, v, 0);

    v.setVisibility(View.INVISIBLE);




    return (true);
}
 
Example 6
Project: JavaIsFun   File: Calculos8.java   Source Code and License Vote up 5 votes
@Override
public boolean onLongClick(View v) {
    ClipData data = ClipData.newPlainText("simple_text", "text");


    View.DragShadowBuilder sb = new View.DragShadowBuilder(v);

    v.startDrag(data, sb, v, 0);

    v.setVisibility(View.INVISIBLE);




    return (true);
}
 
Example 7
Project: JavaIsFun   File: Calculos7.java   Source Code and License Vote up 5 votes
@Override
public boolean onLongClick(View v) {
    ClipData data = ClipData.newPlainText("simple_text", "text");


    View.DragShadowBuilder sb = new View.DragShadowBuilder(v);

    v.startDrag(data, sb, v, 0);

    v.setVisibility(View.INVISIBLE);




    return (true);
}
 
Example 8
Project: JavaIsFun   File: Calculos6.java   Source Code and License Vote up 5 votes
@Override
public boolean onLongClick(View v) {
    ClipData data = ClipData.newPlainText("simple_text", "text");


    View.DragShadowBuilder sb = new View.DragShadowBuilder(v);

    v.startDrag(data, sb, v, 0);

    v.setVisibility(View.INVISIBLE);




    return (true);
}
 
Example 9
Project: JavaIsFun   File: LacoDeRepeticao8.java   Source Code and License Vote up 5 votes
@Override
public boolean onLongClick(View v) {
    ClipData data = ClipData.newPlainText("simple_text", "text");


    View.DragShadowBuilder sb = new View.DragShadowBuilder(v);

    v.startDrag(data, sb, v, 0);

    v.setVisibility(View.INVISIBLE);




    return (true);
}
 
Example 10
Project: JavaIsFun   File: Calculos9.java   Source Code and License Vote up 5 votes
@Override
public boolean onLongClick(View v) {
    ClipData data = ClipData.newPlainText("simple_text", "text");


    View.DragShadowBuilder sb = new View.DragShadowBuilder(v);

    v.startDrag(data, sb, v, 0);

    v.setVisibility(View.INVISIBLE);




    return (true);
}
 
Example 11
Project: JavaIsFun   File: LacoDeRepeticao6.java   Source Code and License Vote up 5 votes
@Override
public boolean onLongClick(View v) {
    ClipData data = ClipData.newPlainText("simple_text", "text");


    View.DragShadowBuilder sb = new View.DragShadowBuilder(v);

    v.startDrag(data, sb, v, 0);

    v.setVisibility(View.INVISIBLE);




    return (true);
}
 
Example 12
Project: JavaIsFun   File: LacoDeRepeticao9.java   Source Code and License Vote up 5 votes
@Override
public boolean onLongClick(View v) {
    ClipData data = ClipData.newPlainText("simple_text", "text");


    View.DragShadowBuilder sb = new View.DragShadowBuilder(v);

    v.startDrag(data, sb, v, 0);

    v.setVisibility(View.INVISIBLE);




    return (true);
}
 
Example 13
Project: JavaIsFun   File: Matrizes6.java   Source Code and License Vote up 4 votes
@Override
public boolean onLongClick(View v) {
    ClipData data = ClipData.newPlainText("simple_text", "text");


    View.DragShadowBuilder sb = new View.DragShadowBuilder(v);

    v.startDrag(data, sb, v, 0);

    v.setVisibility(View.INVISIBLE);


    return (true);
}
 
Example 14
Project: egma-shapi   File: DragStarterPreNougatImpl.java   Source Code and License Vote up 3 votes
/**
 * Used to start a drag on the given view.
 *
 * @param source   view from which the drag motion is started.
 * @param clipData data linked to the drag motion.
 * @param shadow   shadow displayed during the drag.
 * @param token    token.
 * @param i        flags.
 */
public static void startDrag(View source, ClipData clipData, View.DragShadowBuilder shadow, int token, int i) {
    source.startDrag(clipData, shadow, token, i);
}