Android Question UltimateListView Drag n Drop Sections

Keith Flanagan

Member
Licensed User
Hi All

I am playing with UltimateListView at the moment, I am trying to get a drag and drop concept working.

I can drag in lists and have looked at that example, I am now looking at the Sections_demo, it has drag inside each section if there are multiple rows

But what I want to do is drag a section above or below another section.

I have modified the code to include a name when the Header section Label is added see code below

B4X:
Sub Country_LayoutCreator(LayoutName As String, LayoutPanel As Panel)
    'Layout of the header: just a label over a 9-patch drawable
    Dim lblText As Label
    lblText.Initialize("LblTitle") ' I added LblTitle here


I have then added the following method, and it triggers when i long click the header label in each section
B4X:
Private Sub LblTitle_LongClick
    Log("I am here!")
End Sub

What I cant figure out is what i need to register to allow it to then be dragabble, for example when I catch the event for Albania i want to drag it below Algeria in the image below

Any ideas what event I need to register to enable this functionality? Thanks in advance

Screenshot_20210221_164718_flm.b4a.ulvdemosections.jpg
 
Top