How can I Differentiate between OnClick and Swipe on a Firemonkey TListView Item with Delphi XE6

  

I have a form with a TListView on it. I load up some items, and it displays fine.
If I tap (OnClick) an item, I can display a second form with the item details, and some additional options.

However, if I swipe right (to activate the “Delete” button), I get the OnClick event, and the detail form displays. When I close the Detail form (or use the “Back” button), the TListView now has the Delete button displayed.

So, the short version of this is how can I stop the OnClick event from firing when a Swipe is done?

I’ve tried adding a flag, and setting the flag in the OnDeleteChangeVisible, and/or OnGesture, but the flag never seems to get set, and I don’t see these events firing when I run in debug mode.

var isDelete: Boolean

procedure TfrmTaskList.lvTaskListDeleteChangeVisible(Sender: TObject;
AValue: Boolean);
begin
if (AValue = True) then
isDelete := True
else
isDelete := False;
end;

procedure TfrmTaskList.lvTaskListGesture(Sender: TObject;
const EventInfo: TGestureEventInfo; var Handled: Boolean);
begin
if (EventInfo.GestureID = sgiRight) then
begin
isDelete := True
end
else
begin
isDelete := False;
end;
end;

Any help, advice, resources would be greatly appreciated. Thanks

Comments are closed.