-
-
Notifications
You must be signed in to change notification settings - Fork 53
1. support long press like flutter #23
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
bf89458
0b79ae9
b951329
b512710
14f393c
0f7662d
6550a9e
e416dbc
9edd3f9
778fe9b
45292fc
d86e186
c75233b
bc12fda
5eb611f
2bb46ec
348a86b
21a3ced
bb5dd6f
2ce2f3e
edf5349
cad4077
1940d14
616a02c
f61877a
05d3ca4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,20 @@ class Signal { | |
} | ||
} | ||
|
||
enum EventSignalConfKey { | ||
LongPressDuration, | ||
LongPressShakingDistance, | ||
} | ||
|
||
class EventSignal<T> { | ||
Map<EventSignalConfKey,Object> configure = {}; | ||
EventSignal(); | ||
factory EventSignal.longPress(Duration duration,double distance) { | ||
imiskolee marked this conversation as resolved.
Show resolved
Hide resolved
|
||
var signal = EventSignal<T>(); | ||
signal.configure[EventSignalConfKey.LongPressDuration] = duration; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another observation, even if the Duration type makes total sense in Dart/Flutter, GraphX is currently using double to express durations in the tween system and the "ticker" elapsed time since last frame ... ( 0.1 = 100 milliseconds). Just a thought, as that concept is taken from JS/AS3. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think Duration is better on user side, maybe we can translate Duration to double ticks? |
||
signal.configure[EventSignalConfKey.LongPressShakingDistance] = distance; | ||
return signal; | ||
} | ||
void call(EventSignalCallback<T> callback) { | ||
add(callback); | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.