Class SwipeLeftEvent


public class SwipeLeftEvent extends TouchEvent
Represents a leftward swipe gesture event that occurs when a user swipes from right to left on a touch-enabled device.

This event is fired when the user makes a rapid sliding gesture from right to left across a touch surface. It extends TouchEvent as it is part of the touch interaction framework and is dispatched to registered TouchListener instances for processing. This event is commonly used for navigation, such as moving to the next item in a carousel or dismissing content.

Features:

  • Detects leftward swipe gestures on touch devices
  • Part of the touch event framework
  • Enables directional navigation and interactions
  • Integrates with the touch event listener pattern

Usage:


 // Create a swipe left event
 SwipeLeftEvent event = new SwipeLeftEvent();

 // Dispatch to a listener to handle leftward swipes
 event.dispatchTo(myTouchListener);

 // Common use case: carousel navigation
 public void onEvent(SwipeLeftEvent event) {
     System.out.println("Swiped left - showing next item");
     showNextItem();
 }
 
Since:
2016
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • SwipeLeftEvent

      public SwipeLeftEvent()
  • Method Details

    • dispatchTo

      public void dispatchTo(TouchListener listener)
      Dispatches this event to the specified listener for processing.

      This method invokes the listener's onEvent method with this event instance, allowing the listener to handle the leftward swipe gesture, such as navigating to the next item or dismissing content.

      Specified by:
      dispatchTo in class Event<TouchListener>
      Parameters:
      listener - the listener to which this event should be dispatched