本文整理匯總了Java中android.view.View.setOnDragListener方法的典型用法代碼示例。如果您正苦於以下問題:Java View.setOnDragListener方法的具體用法?Java View.setOnDragListener怎麽用?Java View.setOnDragListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.view.View
的用法示例。
在下文中一共展示了View.setOnDragListener方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreateViewHolder
import android.view.View; //導入方法依賴的package包/類
@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;
}
示例2: setTrashIcon
import android.view.View; //導入方法依賴的package包/類
/**
* @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);
}
}
示例3: register
import android.view.View; //導入方法依賴的package包/類
/**
* 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());
}
示例4: bindDrapListener
import android.view.View; //導入方法依賴的package包/類
private void bindDrapListener(View v) {
v.setOnTouchListener(mOnTouchListener);
v.setOnDragListener(mOnDragListener);
}