Android Question New graphics user - how to drag and drop

DickD

Active Member
Licensed User
I am an experienced B4A programmer but mostly with text, databases, wifi and Bluetooth. I need to do some graphics but have absolutely no idea where to start. I know how to display a bitmap in an imageview but that's it.

Now I need to drag and drop an image from part of the screen to another and know its last location. I see there are some discussions on this that use classes but these date back to 2012. What is the CURRENT 2017 method for doing this in B4A 6.50? A SIMPLE example would be great. A picture is worth a thousand words.
 

DickD

Active Member
Licensed User
Have a look at this library from @Informatix

In his Examples you have everything you need as an example.
Very nice. Easy to implement and use. One question. How do I identify the final position of an image after dragging it. I looked at the log file and see there are x and y coordinates given. Are these absolute or relative positions on the screen in pixels? They don't seem to coincide with that. I see onDrag labeled as deltaX so are these the number of pixels moved regardless of direction? If I'm totally wrong then how do I find the final placement of a dragged object?
 
Upvote 0
Top