Playground icon indicating copy to clipboard operation
Playground copied to clipboard

Swipe

Open alissonrodrigo opened this issue 1 year ago • 11 comments

In the Playground repository there is a Swipe demo that simulates image slides. I would like to assign an action when clicking on the image, but HitTest is disabled, I believe, to be able to scroll the images. Would there be any way I could get around this? Grateful

alissonrodrigo avatar Jan 11 '24 19:01 alissonrodrigo

I've modified the demo to add what is known as an "interposer" class declaration for TImage. This allows the images to have HitTest set to True so that they receive mouse events and can respond to clicks, however the mouse events are also "passed on" to the TSwipeView, so that swiping still works.

DelphiWorlds avatar Jan 11 '24 21:01 DelphiWorlds

very good

alissonrodrigo avatar Jan 12 '24 11:01 alissonrodrigo

Playing with the demo. I noticed that if I click on the image and again a little and still keep it pressed, the image moves from one side to the other quickly, giving a bad effect. This didn't happen after the click update before.

alissonrodrigo avatar Jan 12 '24 14:01 alissonrodrigo

Another detail, when I click on the Image it executes the "UpdateRightImage" event, so the app skips what would be the next image

alissonrodrigo avatar Jan 15 '24 19:01 alissonrodrigo

OK.. I'll take a look this week

DelphiWorlds avatar Jan 15 '24 19:01 DelphiWorlds

when I click on the Image it executes the "UpdateRightImage" event

I haven't been able to reproduce this issue on Android, iOS or Windows. Can you describe the steps?

DelphiWorlds avatar Jan 28 '24 00:01 DelphiWorlds

I noticed that if I click on the image and again a little and still keep it pressed, the image moves from one side to the other quickly, giving a bad effect

I'm unable to reproduce this behaviour, either

DelphiWorlds avatar Jan 28 '24 01:01 DelphiWorlds

I will forward the videos to you so you can have a better view.

alissonrodrigo avatar Jan 31 '24 18:01 alissonrodrigo

https://github.com/DelphiWorlds/Playground/assets/8572209/c6e5e00c-3cfe-47b7-84ad-d67303b99501

1st video runs normally without a click (touch) on the slide

alissonrodrigo avatar Jan 31 '24 18:01 alissonrodrigo

@

https://github.com/DelphiWorlds/Playground/assets/8572209/b9c8d33e-798c-4dd8-bc8b-414fba3e990a

2nd, after clicking on the banner, the ordering of the slides is lost and even duplicated

alissonrodrigo avatar Jan 31 '24 18:01 alissonrodrigo

Can you provide a reproducible test case and attach it here?

DelphiWorlds avatar Feb 09 '24 21:02 DelphiWorlds