Пример #1
0
 void onDropAborted(View child) {
   if (child != null) {
     ((LayoutParams) child.getLayoutParams()).isDragging = false;
     invalidate();
   }
   mDragRect.setEmpty();
 }
Пример #2
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();
   }
 }
Пример #3
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();
 }