I'm currently making an android application for the game battleship. I have made model classes for my ships in the form of a viewgroup with multiple textviews in this viewgroup (4 for battleship, 2 for submarine and so on)
My field consists of a TableLayout with multiple (10x10) textviews with a background of water.
I am now trying to implement a drag and drop where this viewgroup could be dropped into multiple textviews, currently only the textview my mouse is on contains the viewgroup (or at least it takes the same background as the viewgroup i'm dropping)
Is there any way to drop my viewgroup, or something else where i can insert multiple textviews or other type of views, into multiple views on my field
update: my fields are now relativelayouts so my ship is actually being put on them rather than the background being recoloured, but if i put my ship, which is 4 times the size of one of the fields on my board, it just puts it on one field and moves the rest of the fields 3 places to the right (so let's say the view of my ship is 40px and my field is 10px, the first 10px of my ship is locked on a relativelayout (or field) and the other 30px of my ship is pushing the field apart, so there is a 30px black space between the column where i put my ship and where the next column is)
EDIT: I'm currently developping on android api level 14 if this helps in any way
I solved the problem by using some logic with offsets from the first parent view (LinearLayout), I drop my first part in the target layout then check if there is an existing dropable field at the offset (1 or 10 depending on the direction i'm dropping, horizontal or vertical) * the index of the next view in my array (i put my views/textfields in an array to group the parts together), if there is no dropable field at the offset i cancel the drop and remove the first view (or any other view that has been placed already) back to the startlayout my dropable layouts have gotten id's from 0 to 99 so that's how i made it work if this helps anyone else that might want to use this way of working, though i don't recommend it, there have to be better ways to do this, but I was way too far in my process to start over.