-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/refactor evnet client #716
Conversation
…events on demand.
TODO: merge 以后修改官网文档,0.9 版本会有个 break。 |
_verticalDragGestureRecognizer.onEnd = | ||
_horizontalDragRecognizer.onEnd = gestureClient.dragEndCallback; | ||
if (gestureListener != null && gestureListener!.onDrag != null) { | ||
_verticalDragGestureRecognizer.onUpdate = _horizontalDragRecognizer.onUpdate = onDragUpdate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为啥_verticalDragGestureRecognizer 与 _horizontalDragRecognizer 命名规范不一致?_horizontalDragRecognizer 中少了 Gesture
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
直接就 break 不太好,中间必须有个过渡版本,需要添加 depracated warning |
这个跟 @yuanyan 讨论了一下,之前的抽象设计不够合理,在大版本的时候做一个 break。之前解决的问题的时候太过依赖业务场景而没有通用性,只有几个业务在用,会做具体通知,这次的能力让这些能力更抽象且通用。 |
重构 EventClient,支持 Widget 全局监听滚动传递以及 Touch 事件。
使用方法:
gestureListener
可按需增加监听函数,Touch
相关事件会注册到window
上以供按需dispatch
优化性能。滚动传递使用
onDrag
监听,一般需要三种状态同时使用,手势相关以标准的Gesture Event
中的state
判断当前触摸状态。触摸传递通过
onTouchXXX
监听,可以独立按需监听,某些场景下只需要监听Start
或者End
,不监听Move
可以防止 dispatch 大量事件以优化性能。close #714