public final void startDrag(View.DragShadowBuilder dragShadowBuilder) { Point shadowSize = new Point(); Point shadowTouchPoint = new Point(); dragShadowBuilder.onProvideShadowMetrics(shadowSize, shadowTouchPoint); itemView.startDrag( null, dragShadowBuilder, new DragInfo(getItemId(), shadowSize, shadowTouchPoint, adapter.getLastTouchPoint()), 0); adapter.notifyItemChanged(getAdapterPosition()); }
public final void startDrag() { PointF touchPoint = adapter.getLastTouchPoint(); int x = (int) (touchPoint.x - itemView.getX()); int y = (int) (touchPoint.y - itemView.getY()); startDrag(getShadowBuilder(itemView, new Point(x, y))); }