本文整理了Java中android.support.v7.widget.helper.ItemTouchHelper.startDrag()
方法的一些代码示例,展示了ItemTouchHelper.startDrag()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ItemTouchHelper.startDrag()
方法的具体详情如下:
包路径:android.support.v7.widget.helper.ItemTouchHelper
类名称:ItemTouchHelper
方法名:startDrag
暂无
代码示例来源:origin: TeamNewPipe/NewPipe
@Override
public void onStartDrag(PlayQueueItemHolder viewHolder) {
if (itemTouchHelper != null) itemTouchHelper.startDrag(viewHolder);
}
};
代码示例来源:origin: TeamNewPipe/NewPipe
@Override
public void onStartDrag(PlayQueueItemHolder viewHolder) {
if (itemTouchHelper != null) itemTouchHelper.startDrag(viewHolder);
}
};
代码示例来源:origin: TeamNewPipe/NewPipe
@Override
public void drag(LocalItem selectedItem, RecyclerView.ViewHolder viewHolder) {
if (itemTouchHelper != null) itemTouchHelper.startDrag(viewHolder);
}
});
代码示例来源:origin: Rukey7/MvpApp
@Override
public void onStartDrag(RecyclerView.ViewHolder viewHolder) {
itemTouchHelper.startDrag(viewHolder);
}
});
代码示例来源:origin: TeamNewPipe/NewPipe
@SuppressLint("ClickableViewAccessibility")
private View.OnTouchListener getOnTouchListener(final RecyclerView.ViewHolder item) {
return (view, motionEvent) -> {
if (motionEvent.getActionMasked() == MotionEvent.ACTION_DOWN) {
if (itemTouchHelper != null && getItemCount() > 1) {
itemTouchHelper.startDrag(item);
return true;
}
}
return false;
};
}
}
代码示例来源:origin: north2016/T-MVP
@Override
public void onBindViewHolder(final ItemViewHolder holder, int position) {
holder.textView.setText(mItems.get(position));
holder.handleView.setOnTouchListener((v, event) -> {
if (MotionEventCompat.getActionMasked(event) == MotionEvent.ACTION_DOWN)
mItemTouchHelper.startDrag(holder);
return false;
});
}
代码示例来源:origin: iMeiji/Toutiao
mItemTouchHelper.startDrag(myHolder);
return true;
});
case MotionEvent.ACTION_MOVE:
if (System.currentTimeMillis() - startTime > SPACE_TIME) {
mItemTouchHelper.startDrag(myHolder);
代码示例来源:origin: DaxiaK/MyDiary
@Override
public void onStartDrag(RecyclerView.ViewHolder viewHolder) {
touchHelper.startDrag(viewHolder);
}
}
代码示例来源:origin: HoneyNeutrons/RecyclerViewUndoSwipe
@Override
public void onStartDrag(RecyclerView.ViewHolder viewHolder) {
mItemTouchHelper.startDrag(viewHolder);
}
代码示例来源:origin: chaychan/TouTiao
@Override
public void onStarDrag(BaseViewHolder baseViewHolder) {
//开始拖动
KLog.i("开始拖动");
mHelper.startDrag(baseViewHolder);
}
代码示例来源:origin: hiteshsahu/ECommerce-App-Android
@Override
public void onStartDrag(RecyclerView.ViewHolder viewHolder) {
mItemTouchHelper.startDrag(viewHolder);
}
代码示例来源:origin: GitLqr/MaterialDesignDemo
@Override
public void onStartDrags(RecyclerView.ViewHolder viewHolder) {
mItemTouchHelper.startDrag(viewHolder);
}
}
代码示例来源:origin: daliyan/MyKeep
/**
* 开始拖动
*
* @param viewHolder
*/
@Override
public void onStartDrag(RecyclerView.ViewHolder viewHolder,int position) {
mItemTouchHelper.startDrag(viewHolder);
mCurrentSelectItem = position;
}
}
代码示例来源:origin: z-chu/LabelSelection
@Override
public void onStarDrag(RecyclerView.ViewHolder viewHolder) {
mHelper.startDrag(viewHolder);
}
代码示例来源:origin: xiaoxiangyeyuHeaven/HeavenlyModule
@Override
public boolean onLongClick(View v) {
if (mItemTouchHelper != null && itemDragEnabled) {
mItemTouchHelper.startDrag((RecyclerView.ViewHolder) v.getTag(R.id.BaseQuickAdapter_viewholder_support));
}
return true;
}
};
代码示例来源:origin: kuyue/WeChatPublishImagesDrag
@Override
public void onItemLongClick(RecyclerView.ViewHolder vh) {
//如果item不是最后一个,则执行拖拽
if (vh.getLayoutPosition() != dragImages.size() - 1) {
itemTouchHelper.startDrag(vh);
}
}
});
代码示例来源:origin: HpWens/WRecyclerView
@Override
public boolean onTouch(View v, MotionEvent event) {
if (MotionEventCompat.getActionMasked(event) == MotionEvent.ACTION_DOWN
&& !mDragOnLongPress) {
if (mItemTouchHelper != null && itemDragEnabled) {
mItemTouchHelper.startDrag((RecyclerView.ViewHolder) v.getTag(R.id.BaseQuickAdapter_viewholder_support));
}
return true;
} else {
return false;
}
}
};
代码示例来源:origin: fennifith/Status
@Override
public boolean onLongClick(View v) {
v.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
helper.startDrag(holder);
return false;
}
});
代码示例来源:origin: ywwynm/EverythingDone
@Override
public void onTouch(int pos) {
mChecklistTouchHelper.startDrag(
mRvCheckList.findViewHolderForAdapterPosition(pos));
}
});
代码示例来源:origin: Jamlh/Sample
@Override
public void onLongPress(RecyclerView.ViewHolder holder, int position) {
//如果不是最后一个就拖拽
if (holder.getLayoutPosition() != data.size() - 1) {
itemTouchHelper.startDrag(holder);
}
}
});
内容来源于网络,如有侵权,请联系作者删除!