2

I am trying to customize a listviewitem to add a button on the right. The button will slide in on gesture (similar to swipe to delete). Since each listviewitem has that button, I need to find which one to animate. I thought of two ways of doing that and am having trouble with both:

First method:

  • Use the ListView.selected to retrieve the currently selected row (ListView.selected is updated in the onClick event)
  • find the button I want to animate
  • do something with it

Now this works fine except that it is possible to trigger the onGesture event without the onClick. This can result in swiping the element of the wrong item, or null pointer if nothing is selected.

Question: is it possible to somehow trigger ItemClick or ItemClickEx onGesture? Or make onGesture return the index of the item that was swiped over?

Second method:

  • Find the starting point of the gesture as screen coordinates (done)
  • ? Find what ListViewItem is displayed at those coordinates? (tried to look for Item.Top, in vain)
  • do the rest as above.

Question: is there a solution to the second bullet point?

Alternatives?

Anyone think of other ways that could solve this?

Thanks!

Khorkhe
  • 1,024
  • 1
  • 11
  • 26

0 Answers0