1. First we understand the concept of the GridView dragging:
(1) Get the item that we clicked on the GridView according to the X, y coordinates of the finger press.
(2) Finger Press when using handler and runnable to implement a timer, if the timing time is 1000 milliseconds, in 1000 milliseconds, if the finger lifted the removal timer, Not lifted and the finger clicked in the area where the GridView item is located, it means we've pressed the GridView item.
(3) If we press and hold item, hide item, and then use WindowManager to add an item's mirror to the screen to replace the item that was just hidden.
(4) When we move the finger on the screen, update the position of the item image, and then get the position to move to the GridView based on the coordinates of the x, Y, which we moved.
(5) to the GridView item too much time, may a screen display is not finished, we finger drag item mirror below the screen, to trigger the GridView want to scroll, similarly, when we finger drag item mirror above the screen, Triggers the GridView scroll down.
(6) GridView Exchange data, refresh the interface, remove the image of item.
2.
Android Advanced UI Design Note 02: The GridView can be dragged to swap item locations