Class Swipeable

All Implemented Interfaces:
PointerInterface

public class Swipeable extends Interface
An interface for swipeable widgets.

The `AdwSwipeable` interface is implemented by all swipeable widgets.

See [class@SwipeTracker] for details about implementing it.

https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/iface.Swipeable.html

  • Constructor Details

  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getCancelProgress

      public double getCancelProgress()
      Gets the progress @self will snap back to after the gesture is canceled.
      Returns:
      the cancel progress, unitless
    • getDistance

      public double getDistance()
      Gets the swipe distance of @self.

      This corresponds to how many pixels 1 unit represents.
      Returns:
      the swipe distance in pixels
    • getProgress

      public double getProgress()
      Gets the current progress of @self.
      Returns:
      the current progress, unitless
    • getSwipeArea

      public void getSwipeArea(int navigation_direction, boolean is_drag, @Nonnull Rectangle rect)
      Gets the area @self can start a swipe from for the given direction and
      gesture type.

      This can be used to restrict swipes to only be possible from a certain area,
      for example, to only allow edge swipes, or to have a draggable element and
      ignore swipes elsewhere.

      If not implemented, the default implementation returns the allocation of
      @self, allowing swipes from anywhere.
      Parameters:
      navigation_direction - the direction of the swipe
      is_drag - whether the swipe is caused by a dragging gesture
      rect - a pointer to a rectangle to store the swipe area
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()