Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

danzeeeman
Copy link
Member

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.

@bilderbuchi
Copy link
Member

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){
Copy link
Member

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

@arturoc
Copy link
Member

arturoc commented Aug 21, 2014

didn't saw your comment @bilderbuchi :)

@danzeeeman
Copy link
Member Author

word I'll make two!

@danzeeeman
Copy link
Member Author

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){};
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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).

@artificiel artificiel mentioned this pull request Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants