예제 #1
0
    public bool OnDrag(View view, DragEvent dragEvent)
    {
      if (dragEvent.GetLocalState() is MoveDragData)
      {
        if (((MoveDragData)dragEvent.GetLocalState()).dragHandler != this)
        {
          // Not this object
          return false;
        }
      }
      else
      {
        if (Successor is View.IOnDragListener)
        {
          return (Successor as View.IOnDragListener).OnDrag(view, dragEvent);
        }
      }

      bool result = true;

      switch (dragEvent.GetAction())
      {
        case DragEvent.ACTION_DRAG_STARTED:
          view.SetAlpha(0.3f);
          //view.SetVisibility(View.INVISIBLE);
          inDrag = true;
          break;
        case DragEvent.ACTION_DRAG_ENDED:
          view.SetAlpha(1.00f);
          //view.SetVisibility(View.VISIBLE);
          inDrag = false;
          break;
        case DragEvent.ACTION_DRAG_EXITED:
          inDrag = false;
          break;
        case DragEvent.ACTION_DROP:
          break;
        case DragEvent.ACTION_DRAG_LOCATION:
          break;
        default:
          break;
      }

      return result;
    }