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

The following are Jave code examples for showing how to use setOnDragListener() 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 StickerApplyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    StickerApplyViewHolder stickerApplyViewHolder = null;
    View view = null;
    if (viewType == TYPE_IMAGE) {
        view = LayoutInflater.from(parent.getContext()).inflate(R.layout.layout_type_image, parent, false);
        stickerApplyViewHolder = new ImageStickerApplyViewHolder(view);
    } else if (viewType == TYPE_TEXT) {
        view = LayoutInflater.from(parent.getContext()).inflate(R.layout.layout_type_text, parent, false);
        stickerApplyViewHolder = new TextStickerApplyViewHolder(view);
    }
    view.setOnClickListener(onClickListener);
    view.setOnLongClickListener(onLongClickListener);
    view.setOnDragListener(onDragListener);

    return stickerApplyViewHolder;
}
 
Example 2
Project: Blockly   File: FlyoutController.java   Source Code and License Vote up 5 votes
/**
 * @param trashIcon The view for toggling the trash.
 */
public void setTrashIcon(View trashIcon) {
    if (trashIcon == null) {
        return;
    }
    // The trash icon is always a drop target.
    trashIcon.setOnDragListener(new OnDragToTrashListener(mController));
    if (mTrashUi != null && mTrashIsCloseable) {
        // But we only need a click listener if the trash can be closed.
        trashIcon.setOnClickListener(mTrashClickListener);
    }
}
 
Example 3
Project: egma-shapi   File: DragHelper.java   Source Code and License Vote up 5 votes
/**
 * Register a drag listener.
 *
 * @param area           drop area
 * @param listener       listener
 * @param droppableClass class which can be droppable.
 */
public void register(View area, DragListener listener, List<Class<?>> droppableClass) {
    listener.reset();
    for (Class<?> droppable : droppableClass) {
        listener.addClassName(droppable.getName());
    }
    area.setOnDragListener(listener.getInternalDragListener());
}
 
Example 4
Project: PaoMovie   File: HoDragVideo.java   Source Code and License Vote up 4 votes
private void bindDrapListener(View v) {
	v.setOnTouchListener(mOnTouchListener);
	v.setOnDragListener(mOnDragListener);
}