2 * This is a modified version of a class from the Android Open Source Project.
3 * The original copyright and license information follows.
5 * Copyright (C) 2008 The Android Open Source Project
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
20 package com.blahti.drag;
22 import android.view.View;
25 * Interface defining an object where drag operations originate.
28 public interface DragSource {
31 * This method is called to determine if the DragSource has something to drag.
33 * @return True if there is something to drag
39 * This method is used to tell the DragSource which drag controller it is working with.
41 * @param dragger DragController
44 void setDragController(DragController dragger);
47 * This method is called on the completion of the drag operation so the DragSource knows
48 * whether it succeeded or failed.
50 * @param target View - the view that accepted the dragged object
51 * @param success boolean - true means that the object was dropped successfully
54 void onDropCompleted (View target, boolean success);