void onDropAborted(View child) { if (child != null) { ((LayoutParams) child.getLayoutParams()).isDragging = false; invalidate(); } mDragRect.setEmpty(); }
/** * Drop a child at the specified position * * @param child The child that is being dropped * @param targetXY Destination area to move to */ void onDropChild(View child, int[] targetXY) { if (child != null) { LayoutParams lp = (LayoutParams) child.getLayoutParams(); lp.cellX = targetXY[0]; lp.cellY = targetXY[1]; lp.isDragging = false; lp.dropped = true; mDragRect.setEmpty(); child.requestLayout(); invalidate(); } }
/** * Start dragging the specified child * * @param child The child that is being dragged */ void onDragChild(View child) { LayoutParams lp = (LayoutParams) child.getLayoutParams(); lp.isDragging = true; mDragRect.setEmpty(); }