Copyright | (C) 2016-2025 David M. Johnson |
---|---|
License | BSD3-style (see the file LICENSE) |
Maintainer | David M. Johnson <code@dmj.io> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Miso.Lynx.Element.View.Event
Description
Synopsis
- onTouchStart :: (TouchEvent -> action) -> Attribute action
- onTouchMove :: (TouchEvent -> action) -> Attribute action
- onTouchEnd :: (TouchEvent -> action) -> Attribute action
- onTouchCancel :: (TouchEvent -> action) -> Attribute action
- onTap :: action -> Attribute action
- onLongPress :: (TouchEvent -> action) -> Attribute action
- onLayoutChange :: (LayoutChangeDetailEvent -> action) -> Attribute action
- onAppear :: (UIAppearanceDetailEvent -> action) -> Attribute action
- onDisappear :: (UIAppearanceDetailEvent -> action) -> Attribute action
- onAnimationStart :: (AnimationEvent -> action) -> Attribute action
- onAnimationEnd :: (AnimationEvent -> action) -> Attribute action
- onAnimationCancel :: (AnimationEvent -> action) -> Attribute action
- onAnimationIteration :: (AnimationEvent -> action) -> Attribute action
- onTransitionStart :: (AnimationEvent -> action) -> Attribute action
- onTransitionEnd :: (AnimationEvent -> action) -> Attribute action
- onTransitionCancel :: (AnimationEvent -> action) -> Attribute action
- data TouchEvent = TouchEvent {}
- data AnimationEvent = AnimationEvent {
- animationType :: AnimationType
- animationName :: MisoString
- newAnimator :: Bool
- data LayoutChangeDetailEvent = LayoutChangeDetailEvent {
- layoutChangeDetailEventId :: MisoString
- layoutChangeDetailEventWidth :: Double
- layoutChangeDetailEventHeight :: Double
- layoutChangeDetailEventTop :: Double
- layoutChangeDetailEventRight :: Double
- layoutChangeDetailEventBottom :: Double
- layoutChangeDetailEventLeft :: Double
- layoutChangeDetailEventDataset :: Object
- data UIAppearanceDetailEvent = UIAppearanceDetailEvent {}
- touchDecoder :: Decoder TouchEvent
- animationDecoder :: Decoder AnimationEvent
- layoutChangeDetailDecoder :: Decoder LayoutChangeDetailEvent
- uiAppearanceDetailDecoder :: Decoder UIAppearanceDetailEvent
- viewEvents :: Events
Events
onTouchStart :: (TouchEvent -> action) -> Attribute action Source #
https://lynxjs.org/api/elements/built-in/view.html#touchstart
It belongs to touch event, which is triggered when the finger starts to touch the touch surface.
@ data Action = HandleTouch TouchEvent
view model = view_ [ onTouchStart HandleTouch ]
update :: Action -> Effect Model Action update (HandleTouch TouchEvent {..}) = do io_ (consoleLog "touch event received")
onTouchMove :: (TouchEvent -> action) -> Attribute action Source #
https://lynxjs.org/api/elements/built-in/view.html#touchmove
It belongs to touch event, which is triggered when the finger moves on the touch surface.
data Action = HandleTouch TouchEvent view :: Model -> View Action view model = view_ [ onTouchMove HandleTouch ] update :: Action -> Effect Model Action update (HandleTouch TouchEvent {..}) = do io_ (consoleLog "touch event received")
onTouchEnd :: (TouchEvent -> action) -> Attribute action Source #
https://lynxjs.org/api/elements/built-in/view.html#touchend
It belongs to touch event, which is triggered when the finger leaves the touch surface.
data Action = HandleTouch TouchEvent view :: Model -> View Action view model = view_ [ onTouchEnd HandleTouch ] update :: Action -> Effect Model Action update (HandleTouch TouchEvent {..}) = do io_ (consoleLog "touch event received")
onTouchCancel :: (TouchEvent -> action) -> Attribute action Source #
https://lynxjs.org/api/elements/built-in/view.html#touchcancel
It belongs to touch event, which is triggered when the touch event, is interrupted by the system or Lynx external gesture.
data Action = HandleTouch TouchEvent view :: Model -> View Action view model = view_ [ onTouchCancel HandleTouch ] update :: Action -> Effect Model Action update (HandleTouch TouchEvent {..}) = do io_ (consoleLog "touch event received")
onTap :: action -> Attribute action Source #
https://lynxjs.org/api/elements/built-in/view.html#tap
It belongs to touch event, which is triggered when the finger clicks on the touch surface.
data Action = HandleTap view :: Model -> View Action view model = view_ [ onTap HandleTap ] update :: Action -> Effect Model Action update HandleTap = do io_ (consoleLog "touch event received")
onLongPress :: (TouchEvent -> action) -> Attribute action Source #
https://lynxjs.org/api/elements/built-in/view.html#longpress
It belongs to the touch event, which is triggered when the finger is long pressed on the touch surface, and the interval between long press triggers is `500 ms`.
data Action = HandleTouch TouchEvent view :: Model -> View Action view model = view_ [ onLongPress HandleTouch ] update :: Action -> Effect Model Action update (HandleTouch TouchEvent {..}) = do io_ (consoleLog "touch event received")
onLayoutChange :: (LayoutChangeDetailEvent -> action) -> Attribute action Source #
https://lynxjs.org/api/elements/built-in/view.html#layoutchange
It belongs to a custom event, which is triggered when the target node layout is completed, and returns the position information of the target node relative to the LynxView viewport coordinate system.
data Action = HandleLayout LayoutChangeDetailEvent view :: Model -> View Action view model = view_ [ onLayoutChange HandleLayout ] update :: Action -> Effect Model Action update (HandleLayout LayoutChangeDetailEvent {..}) = do io_ (consoleLog "layout changed")
onAppear :: (UIAppearanceDetailEvent -> action) -> Attribute action Source #
https://lynxjs.org/api/elements/built-in/view.html#uiappear
It belongs to custom event, which is triggered when the target node appears on the screen.
data Action = HandleUI UIAppearanceDetailEvent view :: Model -> View Action view model = view_ [ onAppear HandleUI ] update :: Action -> Effect Model Action update (HandleUI UIAppearanceDetailEvent {..}) = do io_ (consoleLog "appearance detail event received")
onDisappear :: (UIAppearanceDetailEvent -> action) -> Attribute action Source #
https://lynxjs.org/api/elements/built-in/view.html#uidisappear
It belongs to custom event, which is triggered when the target node appears on the screen.
data Action = HandleUI UIAppearanceDetailEvent view :: Model -> View Action view model = view_ [ onDisappear HandleUI ] update :: Action -> Effect Model Action update (HandleUI UIAppearanceDetailEvent {..}) = do io_ (consoleLog "appearance detail event received")
onAnimationStart :: (AnimationEvent -> action) -> Attribute action Source #
https://lynxjs.org/api/elements/built-in/view.html#animationstart
It belongs to animation event, which is triggered when the Animation animation starts.
data Action = HandleAnimation AnimationEvent view :: Model -> View Action view model = view_ [ onAnimationStart HandleAnimation ] update :: Action -> Effect Model Action update (HandleAnimation AnimationEvent {..}) = do io_ (consoleLog "animation event received")
onAnimationEnd :: (AnimationEvent -> action) -> Attribute action Source #
https://lynxjs.org/api/elements/built-in/view.html#animationend
It belongs to animation event, which is triggered when the Animation animation ends.
data Action = HandleAnimation AnimationEvent view :: Model -> View Action view model = view_ [ onAnimationEnd HandleAnimation ] update :: Action -> Effect Model Action update (HandleAnimation AnimationEvent {..}) = do io_ (consoleLog "animation event received")
onAnimationCancel :: (AnimationEvent -> action) -> Attribute action Source #
https://lynxjs.org/api/elements/built-in/view.html#animationcancel
It belongs to animation event, which is triggered when the Animation animation cancels.
data Action = HandleAnimation AnimationEvent view :: Model -> View Action view model = view_ [ onAnimationCancel HandleAnimation ] update :: Action -> Effect Model Action update (HandleAnimation AnimationEvent {..}) = do io_ (consoleLog "animation event received")
onAnimationIteration :: (AnimationEvent -> action) -> Attribute action Source #
https://lynxjs.org/api/elements/built-in/view.html#animationiteration
It belongs to animation event, which is triggered when the Animation animation iterates.
data Action = HandleAnimation AnimationEvent view :: Model -> View Action view model = view_ [ onAnimationIteration HandleAnimation ] update :: Action -> Effect Model Action update (HandleAnimation AnimationEvent {..}) = do io_ (consoleLog "animation event received")
onTransitionStart :: (AnimationEvent -> action) -> Attribute action Source #
https://lynxjs.org/api/elements/built-in/view.html#transitionstart
It belongs to animation event, which is triggered when the Transition animation starts.
data Action = HandleTransition AnimationEvent view :: Model -> View Action view model = view_ [ onTransitionStart HandleTransition ] update :: Action -> Effect Model Action update (HandleTransition TransitionEvent {..}) = do io_ (consoleLog "transition event received")
onTransitionEnd :: (AnimationEvent -> action) -> Attribute action Source #
https://lynxjs.org/api/elements/built-in/view.html#transitionend
It belongs to animation event, which is triggered when the Transition animation ends.
data Action = HandleTransition AnimationEvent view :: Model -> View Action view model = view_ [ onTransitionEnd HandleTransition ] update :: Action -> Effect Model Action update (HandleTransition TransitionEvent {..}) = do io_ (consoleLog "transition event received")
onTransitionCancel :: (AnimationEvent -> action) -> Attribute action Source #
https://lynxjs.org/api/elements/built-in/view.html#transitioncancel
It belongs to animation event, which is triggered when the Transition animation cancels.
data Action = HandleTransition AnimationEvent view :: Model -> View Action view model = view_ [ onTransitionCancel HandleTransition ] update :: Action -> Effect Model Action update (HandleTransition TransitionEvent {..}) = do io_ (consoleLog "transition event received")
Types
data TouchEvent Source #
Constructors
TouchEvent | |
Fields
|
Instances
Show TouchEvent Source # | |
Defined in Miso.Lynx.Element.View.Event Methods showsPrec :: Int -> TouchEvent -> ShowS # show :: TouchEvent -> String # showList :: [TouchEvent] -> ShowS # | |
Eq TouchEvent Source # | |
Defined in Miso.Lynx.Element.View.Event |
data AnimationEvent Source #
Constructors
AnimationEvent | |
Fields
|
Instances
Show AnimationEvent Source # | |
Defined in Miso.Lynx.Element.View.Event Methods showsPrec :: Int -> AnimationEvent -> ShowS # show :: AnimationEvent -> String # showList :: [AnimationEvent] -> ShowS # | |
Eq AnimationEvent Source # | |
Defined in Miso.Lynx.Element.View.Event Methods (==) :: AnimationEvent -> AnimationEvent -> Bool # (/=) :: AnimationEvent -> AnimationEvent -> Bool # |
data LayoutChangeDetailEvent Source #
Constructors
LayoutChangeDetailEvent | |
Fields
|
Instances
Show LayoutChangeDetailEvent Source # | |
Defined in Miso.Lynx.Element.View.Event Methods showsPrec :: Int -> LayoutChangeDetailEvent -> ShowS # show :: LayoutChangeDetailEvent -> String # showList :: [LayoutChangeDetailEvent] -> ShowS # | |
Eq LayoutChangeDetailEvent Source # | |
Defined in Miso.Lynx.Element.View.Event Methods (==) :: LayoutChangeDetailEvent -> LayoutChangeDetailEvent -> Bool # (/=) :: LayoutChangeDetailEvent -> LayoutChangeDetailEvent -> Bool # |
data UIAppearanceDetailEvent Source #
Constructors
UIAppearanceDetailEvent | |
Fields
|
Instances
Show UIAppearanceDetailEvent Source # | |
Defined in Miso.Lynx.Element.View.Event Methods showsPrec :: Int -> UIAppearanceDetailEvent -> ShowS # show :: UIAppearanceDetailEvent -> String # showList :: [UIAppearanceDetailEvent] -> ShowS # | |
Eq UIAppearanceDetailEvent Source # | |
Defined in Miso.Lynx.Element.View.Event Methods (==) :: UIAppearanceDetailEvent -> UIAppearanceDetailEvent -> Bool # (/=) :: UIAppearanceDetailEvent -> UIAppearanceDetailEvent -> Bool # |
Decoders
touchDecoder :: Decoder TouchEvent Source #
Touch decoder for use with events like onTap
animationDecoder :: Decoder AnimationEvent Source #
Animation decoder for use with events like onAnimationStart
Event Map
viewEvents :: Events Source #