-
Notifications
You must be signed in to change notification settings - Fork 2
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
Click and DoubleTap actions #13
base: rr-example-of-new-op
Are you sure you want to change the base?
Conversation
@raulraja
Why not in the case of
|
Normally you add to the ADT class hierarchy those operations that you consider primitive operations. Since you need to setup resources in this case you may just:
Alternatively you could keep them as is and call the operation fun doubleTap() = GestureDSL.binding {
val device = ! withDevice
... setup actionAcknowledgmentTimeout
val result = ! doDoubleTapAction
... tear down actionAcknowledgmentTimeout
yields (result)
} |
If you want to give it a shot at compiling whatever you decide from the proposal above I can once you have the implementation show you how to test the final implementation. The test would look different dependeding if you decide to implement those actions as part of the DSL ADT vs a monadic composition in a function like in the example above. |
d3f1fe7
to
c2918c8
Compare
Addresses #10 #4 #3
Added two new action simply using extension functions. this actions
click()
anddoubleTap
can operate both over singleUiObject
or lists ofUiObject
actions. Note that regardless of this language and the fluid DSL style nothing is executed until you run and pass it aUiDevice
Since we are operating in a monadic context and building the instructions of our program we have to model operations in terms of
flatMap
which represents the next step the program will evaluate. Once the previous one is finished.Since
doubleTap
meansclick
+click
only if the first click has been successful we implement it like this: