Author Topic: Drag drop from one scrollView to another.  (Read 1810 times)

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Drag drop from one scrollView to another.
« on: April 25, 2014, 01:30:46 AM »
I have 2 scrollViews.

A: vertical scrolling, Grid: horizontal.
1 2 3
4 5 6
7 8 9

B: horizontal scrolling, Grid: horizontal.

1 2 3 4 5

This is on mobile, A is directly above B and no spaces left and right of both scrollViews.

I need to drag from A to B and vice versa.  When dragging from A to B, the item is being dropped but only to A.   

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Drag drop from one scrollView to another.
« Reply #1 on: April 25, 2014, 09:16:40 AM »
If item is being dropped only to the first list, then you didn't set it up quite right. Look closer at how the two drag lists are set up in the drag & drop example. The only thing different in yours is you changed one scroll view to scroll horizontally, implying you also need to change the drag restriction to be vertical instead of horizontal or you won't be able to start dragging items.

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: Drag drop from one scrollView to another.
« Reply #2 on: April 25, 2014, 10:20:04 AM »
I did a test with Example 11- Drag& Drop.

1. I made the same configuration that I needed and found that when the bottom scrollView B  is empty, then dropping an item from ScrollView A doesn't work.  It only works when the drop intersects an already existing item in B.




ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Drag drop from one scrollView to another.
« Reply #3 on: April 25, 2014, 10:26:29 AM »
Is there a collider where you're dropping the item?

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: Drag drop from one scrollView to another.
« Reply #4 on: April 25, 2014, 10:35:04 AM »
I just took the existing example, reconfigured the Left and Right scrollView to my setup A and B. 

1.  I dragged everything from B to A. 
2.  with B empty, I tried adding items from A into B.


Edit:  Solved.  The collider is the problem,  in B when I made it into a Horizontal Scrollview, I forgot to resize the  Container-Right to match the same configuration.
« Last Edit: April 25, 2014, 10:50:57 AM by wallabie »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Drag drop from one scrollView to another.
« Reply #5 on: April 25, 2014, 10:50:30 AM »
Is this something to do with your configuration? Does it work fine if you don't reconfigure anything? How can I reproduce it?

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: Drag drop from one scrollView to another.
« Reply #6 on: April 25, 2014, 10:52:31 AM »
Thanks, on your clue I found the problem with my configuration.