Exemplo n.º 1
0
 /**
  * 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();
   }
 }
Exemplo n.º 2
0
 /**
  * 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();
 }