Shift column of Gridview up and down on touch on that column

Viewed 1289

I have a 3x3 grid view. Imagine like below.

1 2 3
4 5 6
7 8 9

NOW WHAT I WANT TO ACHIEVE

I want the column of grid view to shift upwards and downwards on touch.

Consider, the first column of a grid view. That is

1
4
7

Now, If I touch anywhere on this column, either on 1 or on 4 or on 7 and swipe in any one direction like upside or downside. Then I want to shift the column by 1 or 2 places.

Let me clear that

If I swipe towards upside by touch on 7. It should result like this

1
4 2 3
7 5 6 
  8 9

Or, If I touch the second column and move it in below direction then it will look like something below

1   3
4 2 6
7 5 9
  8

And If I move the column for 2 grid cells then it will look like

1   3
4   6
7 2 9
  5
  8

For every column, I should able to shift the column by one or two cell depending on how much I scroll the column.

One more thing If I scroll the column little and If it's not exactly fitting any grid cell to the desired position then It should automatically fit the grid cell that is close to fit the position.

I have search too many questions here on stack overflow and query a google lot. But I am not getting what I exactly want.

If I did not explain well then tell me. I will try to explain more. Any idea, any hint or any trick would be appreciable.

EDIT

If I move the column more than 3 grids then on releasing the touch, the column will shift to two elements only. Just like this

1   3
4   6
7 2 9
  5
  8
3 Answers
Related