B4J Library [class] CLVDragger - drag to reorder items

CLVDragger.gif


Usage:
- Call dragger.AddDragButtons to add the drag button.
- Call dragger.RemoveDragButtons to remove the buttons.
- Call dragger.Resize when the parent resizes.

See the attached example.

For now it is a B4J only class.

Depends on jXUI v1.91+ and xCustumListView v1.70+
 

Attachments

  • CLVDragger.zip
    3.4 KB · Views: 788

Cableguy

Expert
Licensed User
Longtime User
It just might be handy...
 

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
I Can see something like this on my android 8.

Of course, this can be checked in settings > System> Languages & Input> Language> Language Preferences.

Maybe android version may have others functions:

In android 8 this type of vision is always movable.
There is a title bar and a "more" button on the top right side.
At bottom of list there is a "Add another item" button.

Just a suggestion.
 

cimperia

Active Member
Licensed User
Longtime User
How would it be possible to enhance the drag action so that it does not stop when the dragged item reaches the top of the CLV window when there are still some items above it?

In other words, there's a CLV with 50 items say, and 10 are displayed at a time. You start dragging item 50 and when it reaches item 40, ie the top of the CLV window, the dragging action stops, even though the item is still pressed. One way to keep the dragging going is to continuously wiggle the finger on the item, but it's not very satisfying from a user viewpoint.

How could we modify the code so that the dragging carries on until the finger is lifted?

Thank you.
 

Bill Milleker

Member
Licensed User
When there are only a few items, I'm seeing a problem when the CustomListView resizes.

In the example code, set the loop to add only 6 items. When the window is resized, each item's width shrinks to accommodate a non-existent scroll bar.

When an item is dragged and dropped, it expands to full width.
 

LenS

Member
View attachment 78844

Usage:
- Call dragger.AddDragButtons to add the drag button.
- Call dragger.RemoveDragButtons to remove the buttons.
- Call dragger.Resize when the parent resizes.

See the attached example.

For now it is a B4J only class.

Depends on jXUI v1.91+ and xCustumListView v1.70+

Thank you, thank you, thank you, Erel.

If I can get this to work (I am at the bottom of a steep learning curve) it will be perfect, even better than my original idea of Up and Down buttons for rearranging the list.

I appreciate your prompt reply and the example zip file included.

Len
 
Top