Android Question Simplest way to drag a panel and know if it was dropped on a label

PacoViv

Member
Licensed User
Hello, after several days watching this, I saw many ways to do it, using libraries or classes, like gesture detector, touchimage, pichzoon and move, reflection, gameview... also with no libraries with the touch event but this works to me only applied to activity, no panel... etc.

But I'm getting more confused every time and I'm here asking. What I want is just the user to can drag a panel (with an image) or an imageview and when the user releases the finger to know where the panel is on the screen, concretely if the panel was dropped inside a label placed at the left botton of the main panel.

I have a main panel that uses a layout made in the designer using all the screen:
panel1.Initialize("")
panel1.LoadLayout("caen")
Activity.AddView(panel1, 0, 0, 100%x, 100%y)

A little panel with the image:
pnl1azul.Initialize("")
pnl1azul.SetBackgroundImage(LoadBitmap(File.DirAssets, "image.png"))
Activity.AddView(pnl1azul, 30dip, 70dip, 80dip, 80dip)

And a label in the designer of the main layout (caen):
Lbl1azul.SetLeftAndRight(0%x,30%x)
Lbl1azul.SetTopAndBottom(85%y,100%y)

So what's the simplest way to the user can drag the image image.png (in pnl1azul) and when he releases the finger to know wheter or not the image is on the area of the label (Lbl1azul)?.

Also would be valid for me to know if it was dropped over a background color like red or blue.

Thanks in advance.
 
Last edited:
Top