INNER CODE UNIT · Java

startDrag

cymcsg/UltimateRecyclerView · UltimateRecyclerView/ultimaterecyclerview/src/main/java/com/marshalchen/ultimaterecyclerview/DragDropTouchListener.java:131

    public void startDrag() {
        View viewUnder = recyclerView.findChildViewUnder(downX, downY);
        if (viewUnder == null) return;
        dragging = true;

        mobileViewCurrentPos = recyclerView.getChildPosition(viewUnder);

        int[] viewRawCoords = getViewRawCoords(viewUnder);
        mobileView = copyViewAsImage(viewUnder);
        mobileView.setX(viewRawCoords[0]);
        mobileView.setY(viewRawCoords[1]);
        mobileViewStartY = viewRawCoords[1];

        ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        activity.addContentView(mobileView, lp);
        mobileView.bringToFront();
        viewUnder.setVisibility(View.INVISIBLE);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…