Fusuma

Components / Basics

gestures

view, listening for gestures: add .on_long_press(..) and .on_swipe(..).

Try it

This is the Navigation page of the gallery, running in your browser: gestures is on it, and it is the real widget. Press Run, then use it.

Live: Navigation, where gestures is usedOpen full size

Also on this pagenamedtext_fmttoastmenu

view, listening for gestures: add .on_long_press(..) and .on_swipe(..).

Signature

pub const fn gestures<V, M>(view: V) -> Gestures<V, M>

Methods

  • .on_long_press(message: M) -> Self — Sends message when the node is pressed and held.
  • .on_swipe(axes: Swipe, f: fn(SwipeDir) -> M) -> Self — Sends a message made from the direction when a press travels far enough along axes.

Example

use fusuma::{button, gestures};
let view = gestures(button("Photo").on_press(())).on_long_press(());
let built = fusuma::doc::built::<(), _>(&view);
assert_eq!(built.texts(), ["Photo"]);

All components · Source