Interface

Adw-1AdwSwipeableInterface

Interface for implementing Swipeable. Contains only the virtual methods that need to be implemented.

interface Interface {
    vfunc_get_cancel_progress(): number;
    vfunc_get_distance(): number;
    vfunc_get_progress(): number;
    vfunc_get_snap_points(): number[];
    vfunc_get_swipe_area(
        navigation_direction: Adw.NavigationDirection,
        is_drag: boolean,
    ): Gdk.Rectangle;
}

Hierarchy (View Summary)

Index

Methods

  • Gets the progress self will snap back to after the gesture is canceled.

    Returns number

  • Gets the swipe distance of self.

    This corresponds to how many pixels 1 unit represents.

    Returns number

  • Gets the snap points of self.

    Each snap point represents a progress value that is considered acceptable to end the swipe on.

    Returns number[]

  • 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: Adw.NavigationDirection

      the direction of the swipe

    • is_drag: boolean

      whether the swipe is caused by a dragging gesture

    Returns Gdk.Rectangle