@@ -0,0 +1,2439 @@
+package io.doist.recyclerviewext.dragdrop;%0A%0Aimport android.content.ClipData;%0Aimport android.os.SystemClock;%0Aimport android.view.DragEvent;%0Aimport android.view.MotionEvent;%0Aimport android.view.View;%0A%0Aimport androidx.recyclerview.widget.RecyclerView;%0A%0A/**%0A * %7B@link View.OnDragListener%7D for %7B@link RecyclerView%7D that maps calls to a %7B@link RecyclerView.OnItemTouchListener%7D.%0A *%0A * %7B@link RecyclerView.OnItemTouchListener%7D will typically be %7B@link DragDropHelper%7D, so that it tracks drag events%0A * started via the system APIs (e.g. %7B@link View#startDragAndDrop(ClipData, View.DragShadowBuilder, Object, int)%7D.%0A */%0Apublic class DragDropTouchDragListener implements View.OnDragListener %7B%0A    private RecyclerView.OnItemTouchListener onItemTouchListener;%0A    private boolean intercept;%0A    private long startTime;%0A%0A    public DragDropTouchDragListener(RecyclerView.OnItemTouchListener onItemTouchListener) %7B%0A        this.onItemTouchListener = onItemTouchListener;%0A    %7D%0A%0A    @Override%0A    public boolean onDrag(View view, DragEvent event) %7B%0A        switch (event.getAction()) %7B%0A            case DragEvent.ACTION_DRAG_STARTED:%0A                intercept = false;%0A                startTime = SystemClock.uptimeMillis();%0A                dispatchTouchEvent(view, MotionEvent.ACTION_DOWN, event.getX(), event.getY());%0A                // Return true to receive further events.%0A                return true;%0A%0A            case DragEvent.ACTION_DRAG_LOCATION:%0A                dispatchTouchEvent(view, MotionEvent.ACTION_MOVE, event.getX(), event.getY());%0A                return false;%0A%0A            case DragEvent.ACTION_DRAG_ENDED:%0A                dispatchTouchEvent(view, MotionEvent.ACTION_UP, event.getX(), event.getY());%0A                return false;%0A%0A            default:%0A                return false;%0A        %7D%0A    %7D%0A%0A    private void dispatchTouchEvent(View view, int action, float x, float y) %7B%0A        if (!(view instanceof RecyclerView)) %7B%0A            throw new IllegalStateException(%22DragDropTouchDragListener must be set on a RecyclerView%22);%0A        %7D%0A        MotionEvent motionEvent = MotionEvent.obtain(startTime, SystemClock.uptimeMillis(), action, x, y, 0);%0A        if (this.intercept) %7B%0A            onItemTouchListener.onTouchEvent((RecyclerView) view, motionEvent);%0A        %7D else %7B%0A            this.intercept = onItemTouchListener.onInterceptTouchEvent((RecyclerView) view, motionEvent);%0A        %7D%0A        motionEvent.recycle();%0A    %7D%0A%7D%0A

Add DragDropTouchDragListener