Android Question CustomListView Moving Items

advansis

Active Member
Licensed User
Hi guys,
I use a CustomListView to display a list of items, filled by "AddTextItem" method (it represents a "TO DO" list).
It would be useful to move each item up or down to reflect a priority property.
Is there a way to "MOVE" items or, at least to swap two of them (both text and value properties) ?
Thanks in advance

PS. I tried deleting and inserting items, but the visual effect is very ugly...
 
Last edited:

LucaMs

Expert
Licensed User
Hi guys,
I use a CustomListView to display a list of items, filled by "AddTextItem" method (it represents a "TO DO" list).
It would be useful to move each item up or down to reflect a priority property.
Is there a way to "MOVE" items or, at least to swap two of them (both text and value properties) ?
Thanks in advance

PS. I tried deleting and inserting items, but the visual effect is very ugly...
You have to remove the item you want to move, recreate it and insert it in the new position.
(clv.RemoveAt - clv.InsertAt)
 

advansis

Active Member
Licensed User
Thanks anyway...
... as I said:
I tried deleting and inserting items, but the visual effect is very ugly...
 

Sagenut

Well-Known Member
Licensed User
Thanks anyway...
... as I said:
I tried deleting and inserting items, but the visual effect is very ugly...
What does it mean "Visual Effect Very Ugly"? And what would you like to obtain?
You could try
Disable XCLV Animation:
YourCLV.AnimationDuration = 0
In this way everything related to adding or removing items will happen instantly instead that with a short animation like now.
 

advansis

Active Member
Licensed User
Thanks. I think AnimationDuration=0 will do the trick. For my personal knowledge, is there a way to change the Value member of an item ?
 

Sagenut

Well-Known Member
Licensed User
Thanks. I think AnimationDuration=0 will do the trick. For my personal knowledge, is there a way to change the Value member of an item ?
I think that the only way is to remove the item and recreate it in the same position changing the Value.
 

Sagenut

Well-Known Member
Licensed User
... if you don't like the LucaMs's "solution" 😄

(I have to discover who is LucaMs 😂 )
It's not that I don't appreciate your work, absolutely.
It was just to talk about the standard XCLV usage.
But any good alternative is of course welcome!
 

Erel

Administrator
Staff member
Licensed User

 
Top