Android Question clv dragging without extra button

Gfy

Member
Licensed User
Longtime User
I try to implement a function for customlistview to drag items without extra button like in CLVdragging library.

I like to use the ItemLongClick() event to start dragging without lifting the finger.



I have ftry to send via reflection ACTION_UP and then a ACTION_DOWN event, but wihtout a correct result.

Is there a way to do it?
 

AnandGupta

Expert
Licensed User
Longtime User
I try to implement a function for customlistview to drag items without extra button like in CLVdragging library.

I like to use the ItemLongClick() event to start dragging without lifting the finger.



I have ftry to send via reflection ACTION_UP and then a ACTION_DOWN event, but wihtout a correct result.

Is there a way to do it?
Try this,

 
Upvote 0

LucasHeer

Active Member
Licensed User
Longtime User
I try to implement a function for customlistview to drag items without extra button like in CLVdragging library.

I like to use the ItemLongClick() event to start dragging without lifting the finger.



I have ftry to send via reflection ACTION_UP and then a ACTION_DOWN event, but wihtout a correct result.

Is there a way to do it?
Hey sir!

I modified the CLVDragger class that @AnandGupta mentioned.

It allows scrolling and long-click to drag/drop. Is this what you are looking for?:

If this is what you need, do you have anything clickable on the view itself?
 
Upvote 0

Gfy

Member
Licensed User
Longtime User
Hi LucasHeer
Yes, that is exactly what i looking for. Can you share the code please.
 
Upvote 0

LucasHeer

Active Member
Licensed User
Longtime User
Hey sir!

I apologize, I have been away from the PC for holiday.

Attached is the modified clv_dragger class. It only works for B4A, and I do not think it currently allows for clicking items within the CLV items due to touch override.

If you need B4i, or need clickable items, let me know and I will add it 👍

Thank you!!
 

Attachments

  • clv_dragger_drag_anywhere_modified.bas
    10.4 KB · Views: 19
Upvote 0

Xfood

Expert
Licensed User
Longtime User
It would be nice to have the ability to manage the movement of an item with animation via code, such as Moviatem (3.20) moves item 3 to position 20 with animation like the video below.

Rename
.txt in .mp4
 

Attachments

  • VID-20250730-WA0022.mp4.txt
    298.1 KB · Views: 14
Upvote 0
Top