Android Question Select and Move in the UI

FabianGS

Member
Is there a way to move like a Button-UITextEntry just by click on it?
I did this by a setting the Width/Height and its Location when Adding the View but instead, i just want to create a Button with a static Width/Height in the View but when i click on it, DRAG this object around the view
Any help to do this would be really helpfull
Thanks in advance!
 

Brian Dean

Well-Known Member
Licensed User
Longtime User
when i click on it, DRAG this object around the view

Buttons and texts cannot be dragged directly because they do not have a touch event. The way to do it is to cover your activity with a transparent panel, capture touch events on the panel, test for when these are over the target and then use drags on the panel to move the underlying button. I recently provided a demo in this thread.
 
Upvote 0

FabianGS

Member
Buttons and texts cannot be dragged directly because they do not have a touch event. The way to do it is to cover your activity with a transparent panel, capture touch events on the panel, test for when these are over the target and then use drags on the panel to move the underlying button. I recently provided a demo in this thread.
I just saw this DrawableClass inside the forums but i cant fin the Library :c, anyway, i´ll use your method using panel to drag and drop button inside of the object
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
but i cant fin the Library
There IS NO library.

It is just a CLASS. And this class is INSIDE #1 of the thread you linked.
 
Upvote 0

FabianGS

Member
There IS NO library.

It is just a CLASS. And this class is INSIDE #1 of the thread you linked.
My bad, i already biuld this Class inside my project, anyways; there is also a problem with this, i initialize this with a simple button, i can dragged all around the view BUT i cant click on it. Maybe a bug?
The click is not being detected
 
Upvote 0
Top