Given a container, how can we differentiate between short press, long press and swipe events?
So assume there is a container that should react differently in either of the following conditions:
- Short press (i.e. single click)
- Long press e.g. > 1s
- Swipe (e.g. swipe left or right).
Is this doable? Could someone maybe post the pseudocode?
I know how to handle single click, by checking in the 'Click Listener' of the container. Then in the screen handleTickEvent() I can differentiate whether the container still pressed or not to differentiate between short press and long press. But now, how to detect swipe event?