:right-sidebar: True Swipeable =================================================================== .. currentmodule:: gi.repository.Adw .. class:: Swipeable(*args, **kwargs) :no-contents-entry: Implementations: :class:`~gi.repository.Adw.BottomSheet`, :class:`~gi.repository.Adw.Carousel`, :class:`~gi.repository.Adw.Flap`, :class:`~gi.repository.Adw.Leaflet`, :class:`~gi.repository.Adw.NavigationView`, :class:`~gi.repository.Adw.OverlaySplitView` An interface for swipeable widgets. The ``AdwSwipeable`` interface is implemented by all swipeable widgets. See :obj:`~gi.repository.Adw.SwipeTracker` for details about implementing it. Methods ------- .. rst-class:: interim-class .. class:: Swipeable :no-index: .. method:: get_cancel_progress() -> float Gets the progress ``self`` will snap back to after the gesture is canceled. .. method:: get_distance() -> float Gets the swipe distance of ``self``\. This corresponds to how many pixels 1 unit represents. .. method:: get_progress() -> float Gets the current progress of ``self``\. .. method:: get_snap_points() -> list[float] Gets the snap points of ``self``\. Each snap point represents a progress value that is considered acceptable to end the swipe on. .. method:: get_swipe_area(navigation_direction: ~gi.repository.Adw.NavigationDirection, is_drag: bool) -> ~gi.repository.Gdk.Rectangle 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. :param navigation_direction: the direction of the swipe :param is_drag: whether the swipe is caused by a dragging gesture Virtual Methods --------------- .. rst-class:: interim-class .. class:: Swipeable :no-index: .. method:: do_get_cancel_progress() -> float Gets the progress ``self`` will snap back to after the gesture is canceled. .. method:: do_get_distance() -> float Gets the swipe distance of ``self``\. This corresponds to how many pixels 1 unit represents. .. method:: do_get_progress() -> float Gets the current progress of ``self``\. .. method:: do_get_snap_points() -> list[float] Gets the snap points of ``self``\. Each snap point represents a progress value that is considered acceptable to end the swipe on. .. method:: do_get_swipe_area(navigation_direction: ~gi.repository.Adw.NavigationDirection, is_drag: bool) -> ~gi.repository.Gdk.Rectangle 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. :param navigation_direction: the direction of the swipe :param is_drag: whether the swipe is caused by a dragging gesture