-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Feature android touch updates #3159
base: master
Are you sure you want to change the base?
Feature android touch updates #3159
Conversation
So, doesn't this mean that anyone using the old onswipe/swipe functions (with two params) will now have a non-compiling project, as the declaration has been removed? If so, I think it would be better to keep the old version, but deprecate it so that people get warned about switching over. |
} | ||
virtual void swipe(ofxAndroidSwipeDir swipeDir, int id){ | ||
virtual void swipe(ofxAndroidSwipeDir swipeDir, int id, float velocityX, float velocityY){ |
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.
would be good to keep the old function and call it from the new one, so we don't break old code
didn't saw your comment @bilderbuchi :) |
word I'll make two! |
updated |
@@ -32,26 +40,36 @@ class ofxAndroidApp: public ofBaseApp{ | |||
virtual void touchUp(int x, int y, int id) {}; | |||
virtual void touchDoubleTap(int x, int y, int id) {}; | |||
virtual void touchCancelled(int x, int y, int id) {}; | |||
virtual void swipe(ofxAndroidSwipeDir swipeDir, int id){}; |
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.
why is the one swipe
method declaration separated from the other one? Also, could you mark this old method as deprecated using our macro? Which one is deprecated, though, as the new one seems to call the old one, further below?
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.
this is the old function retained for compatibility. the new function calls the old one if it is not implemented in your ofAndroid app so the old function would still work.
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.
But then, the old one should call the new one, internally. Otherwise we can't ever phase out the old one as the new one depends on its implementation. Also, the two declarations should still be grouped together for clarity (but that's a nitpick/style issue).
This lets you use the onScroll listener of android to detect scroll events in the horizontal or vertical direction. Also passes down the velocity from the onFling event. These functions are really useful for touch based camera movements.