• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.dialer.app.list;
18 
19 /**
20  * Classes that want to receive callbacks in response to drag events should implement this
21  * interface.
22  */
23 public interface OnDragDropListener {
24 
25   /**
26    * Called when a drag is started.
27    *
28    * @param x X-coordinate of the drag event
29    * @param y Y-coordinate of the drag event
30    * @param view The contact tile which the drag was started on
31    */
onDragStarted(int x, int y, PhoneFavoriteSquareTileView view)32   void onDragStarted(int x, int y, PhoneFavoriteSquareTileView view);
33 
34   /**
35    * Called when a drag is in progress and the user moves the dragged contact to a location.
36    *
37    * @param x X-coordinate of the drag event
38    * @param y Y-coordinate of the drag event
39    * @param view Contact tile in the ListView which is currently being displaced by the dragged
40    *     contact
41    */
onDragHovered(int x, int y, PhoneFavoriteSquareTileView view)42   void onDragHovered(int x, int y, PhoneFavoriteSquareTileView view);
43 
44   /**
45    * Called when a drag is completed (whether by dropping it somewhere or simply by dragging the
46    * contact off the screen)
47    *
48    * @param x X-coordinate of the drag event
49    * @param y Y-coordinate of the drag event
50    */
onDragFinished(int x, int y)51   void onDragFinished(int x, int y);
52 
53   /**
54    * Called when a contact has been dropped on the remove view, indicating that the user wants to
55    * remove this contact.
56    */
onDroppedOnRemove()57   void onDroppedOnRemove();
58 }
59